diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-05-10 02:44:57 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-05-10 02:44:57 +0000 |
commit | 9c8821bbef7f26d80e34c3ed2f771af7aa365d4b (patch) | |
tree | 9aae7ffd4a23bf2c8e8b8d7bc3ed77fcec956474 /clang/lib | |
parent | d7af8a334c9fc45593519de921da5a0c2453d478 (diff) | |
download | bcm5719-llvm-9c8821bbef7f26d80e34c3ed2f771af7aa365d4b.tar.gz bcm5719-llvm-9c8821bbef7f26d80e34c3ed2f771af7aa365d4b.zip |
Add FIXME describing the limitation of using column info to disambiguate inlining.
Also tidy up, simplify, and extend the test coverage to demonstrate the
limitations. This test should now fail if the bugs are fixed (&
hopefully whoever ends up in this situation sees the FIXMEs and realizes
that the test needs to be updated to positively test their change that
has fixed some or all of these issues).
I do wonder whether I could demonstrate breakage without a macro here,
but any way I slice it I can't think of a way to get two calls to the
same function on the same line/column in non-macro C++ - implicit
conversions happen at the same location as an explicit function, but
you'd never get an implicit conversion on the result of an explicit call
to the same implicit conversion operator (since the value is already
converted to the desired result)...
llvm-svn: 208468
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 40870f89066..2be47b46e22 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -2862,6 +2862,10 @@ RValue CodeGenFunction::EmitCallExpr(const CallExpr *E, SourceLocation Loc = E->getLocStart(); // Force column info to be generated so we can differentiate // multiple call sites on the same line in the debug info. + // FIXME: This is insufficient. Two calls coming from the same macro + // expansion will still get the same line/column and break debug info. It's + // possible that LLVM can be fixed to not rely on this uniqueness, at which + // point this workaround can be removed. const FunctionDecl* Callee = E->getDirectCallee(); bool ForceColumnInfo = Callee && Callee->isInlineSpecified(); DI->EmitLocation(Builder, Loc, ForceColumnInfo); @@ -3131,6 +3135,10 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType, llvm::Value *Callee, // Force column info to differentiate multiple inlined call sites on // the same line, analoguous to EmitCallExpr. + // FIXME: This is insufficient. Two calls coming from the same macro expansion + // will still get the same line/column and break debug info. It's possible + // that LLVM can be fixed to not rely on this uniqueness, at which point this + // workaround can be removed. bool ForceColumnInfo = false; if (const FunctionDecl* FD = dyn_cast_or_null<const FunctionDecl>(TargetDecl)) ForceColumnInfo = FD->isInlineSpecified(); |