[llvm] r233562 - Verifier: Loosen r233559 check for 'function:' field in MDSubprogram

David Blaikie dblaikie at gmail.com
Mon Mar 30 10:39:35 PDT 2015


On Mon, Mar 30, 2015 at 10:04 AM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:

> Author: dexonsmith
> Date: Mon Mar 30 12:04:06 2015
> New Revision: 233562
>
> URL: http://llvm.org/viewvc/llvm-project?rev=233562&view=rev
> Log:
> 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/


Is this an acceptable thing? How does this arise? Could we have a small
test case demonstrating it? (and/or demonstrating how it comes about?)


>
>
> Modified:
>     llvm/trunk/lib/IR/Verifier.cpp
>
> Modified: llvm/trunk/lib/IR/Verifier.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=233562&r1=233561&r2=233562&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/IR/Verifier.cpp (original)
> +++ llvm/trunk/lib/IR/Verifier.cpp Mon Mar 30 12:04:06 2015
> @@ -846,9 +846,8 @@ void Verifier::visitMDSubprogram(const M
>      auto *FMD = dyn_cast<ConstantAsMetadata>(RawF);
>      auto *F = FMD ? FMD->getValue() : nullptr;
>      auto *FT = F ? dyn_cast<PointerType>(F->getType()) : nullptr;
> -    Assert(F && (isa<Function>(F) || isa<ConstantPointerNull>(F)) && FT &&
> -               isa<FunctionType>(FT->getElementType()),
> -           "invalid function", &N, F);
> +    Assert(F && FT && isa<FunctionType>(FT->getElementType()),
> +           "invalid function", &N, F, FT);
>    }
>    if (N.getRawTemplateParams()) {
>      auto *Params = dyn_cast<MDTuple>(N.getRawTemplateParams());
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150330/10681d80/attachment.html>


More information about the llvm-commits mailing list