Verifier: Loosen r233559 check for 'function:' field in MDSubprogram

Stop worrying about what the `function:` field is in `MDSubprogram`,
since it could be a bitcast [1].  Just check its type and leave it at
that.

[1]: http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build/3540/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233562 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2015-03-30 17:04:06 +00:00
parent d3ec0ca17e
commit a3dbc680a7

View File

@ -846,9 +846,8 @@ void Verifier::visitMDSubprogram(const MDSubprogram &N) {
auto *FMD = dyn_cast<ConstantAsMetadata>(RawF); auto *FMD = dyn_cast<ConstantAsMetadata>(RawF);
auto *F = FMD ? FMD->getValue() : nullptr; auto *F = FMD ? FMD->getValue() : nullptr;
auto *FT = F ? dyn_cast<PointerType>(F->getType()) : nullptr; auto *FT = F ? dyn_cast<PointerType>(F->getType()) : nullptr;
Assert(F && (isa<Function>(F) || isa<ConstantPointerNull>(F)) && FT && Assert(F && FT && isa<FunctionType>(FT->getElementType()),
isa<FunctionType>(FT->getElementType()), "invalid function", &N, F, FT);
"invalid function", &N, F);
} }
if (N.getRawTemplateParams()) { if (N.getRawTemplateParams()) {
auto *Params = dyn_cast<MDTuple>(N.getRawTemplateParams()); auto *Params = dyn_cast<MDTuple>(N.getRawTemplateParams());