r177164 - Force column info only for direct inlined functions. This should strike
Bill Schmidt
wschmidt at linux.vnet.ibm.com
Tue Mar 19 06:18:11 PDT 2013
Hi Adrian,
This commit introduced a test that fails on powerpc64-unknown-linux-gnu:
/home/wschmidt/llvm/build/llvm-test/Release+Asserts/bin/clang -cc1
-internal-isystem /home/wschmidt/llvm/build/llvm-test/Release
+Asserts/bin/../lib/clang/3.3/include -g -emit-llvm -o
- /home/wschmidt/llvm/llvm-test/tools/clang/test/CodeGenCXX/debug-info-same-line.cpp | FileCheck /home/wschmidt/llvm/llvm-test/tools/clang/test/CodeGenCXX/debug-info-same-line.cpp
--
Exit Code: 1
Command Output (stderr):
--
/home/wschmidt/llvm/llvm-test/tools/clang/test/CodeGenCXX/debug-info-same-line.cpp:97:11: error: expected string not found in input
// CHECK: call {{.*}} @_Z11strange_maxii(i32 %{{.*}}, i32 %{{.*}}), !
dbg ![[DBG]]
^
<stdin>:189:2: note: scanning from here
%call8 = call signext i32 @_Z11strange_maxii(i32 signext %1, i32
signext %2), !dbg !74
^
<stdin>:189:2: note: with variable "DBG" equal to "74"
%call8 = call signext i32 @_Z11strange_maxii(i32 signext %1, i32
signext %2), !dbg !74
^
<stdin>:189:26: note: possible intended match here
%call8 = call signext i32 @_Z11strange_maxii(i32 signext %1, i32
signext %2), !dbg !74
^
--
Looks like you could take the %'s off the parms to account for the
possibility of extends.
Thanks,
Bill
On Fri, 2013-03-15 at 17:09 +0000, Adrian Prantl wrote:
> Author: adrian
> Date: Fri Mar 15 12:09:05 2013
> New Revision: 177164
>
> URL: http://llvm.org/viewvc/llvm-project?rev=177164&view=rev
> Log:
> Force column info only for direct inlined functions. This should strike
> the balance between expected behavior and compatibility with the gdb
> testsuite.
> (GDB gets confused if we break an expression into multiple debug
> stmts so we enable this behavior only for inlined functions. For the
> full experience people can still use -gcolumn-info.)
>
> Modified:
> cfe/trunk/lib/CodeGen/CGExpr.cpp
> cfe/trunk/test/CodeGenCXX/debug-info-same-line.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=177164&r1=177163&r2=177164&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGExpr.cpp Fri Mar 15 12:09:05 2013
> @@ -2857,9 +2857,11 @@ RValue CodeGenFunction::EmitCallExpr(con
> ReturnValueSlot ReturnValue) {
> if (CGDebugInfo *DI = getDebugInfo()) {
> SourceLocation Loc = E->getLocStart();
> - DI->EmitLocation(Builder, Loc,
> - /* Force column info to be generated so we can differentiate
> - multiple call sites on the same line in the debug info. */ true);
> + // Force column info to be generated so we can differentiate
> + // multiple call sites on the same line in the debug info.
> + const FunctionDecl* Callee = E->getDirectCallee();
> + bool ForceColumnInfo = Callee && Callee->isInlineSpecified();
> + DI->EmitLocation(Builder, Loc, ForceColumnInfo);
> }
>
> // Builtins never have block type.
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-same-line.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-same-line.cpp?rev=177164&r1=177163&r2=177164&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-same-line.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-same-line.cpp Fri Mar 15 12:09:05 2013
> @@ -47,12 +47,15 @@ main(int argc, char const *argv[])
> {
>
> int array[3];
> + int n;
>
> array[0] = foo (1238, 78392);
> array[1] = foo (379265, 23674);
> array[2] = foo (872934, 234);
>
> - return 0;
> + n = strange_max(array[0], strange_max(array[1], array[2]));
> +
> + return n & 0xf;
> }
>
> // CHECK: define {{.*}} @_Z3fooii
> @@ -79,3 +82,17 @@ main(int argc, char const *argv[])
> // CHECK: call void @llvm.dbg.declare(metadata !{i32* %{{.*}}}, metadata ![[B_MD]]), !dbg !{{.*}}
> // result
> // CHECK: call void @llvm.dbg.declare
> +
> +// CHECK: define {{.*}} @main
> +// CHECK: call {{.*}} @_Z3fooii
> +// CHECK: call {{.*}} @_Z3fooii
> +// CHECK: call {{.*}} @_Z3fooii
> +// CHECK: store
> +// CHECK: getelementptr
> +// We want to see the same !dbg node for non-inlined functions.
> +// Needed for GDB compatibility.
> +// CHECK: load {{.*}} !dbg ![[DBG:.*]]
> +// CHECK: load {{.*}} !dbg ![[DBG]]
> +// CHECK: load {{.*}} !dbg ![[DBG]]
> +// CHECK: call {{.*}} @_Z11strange_maxii(i32 %{{.*}}, i32 %{{.*}}), !dbg ![[DBG]]
> +// CHECK: call {{.*}} @_Z11strange_maxii(i32 %{{.*}}, i32 %{{.*}}), !dbg ![[DBG]]
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
More information about the cfe-commits
mailing list