[PATCH] D27549: [DebugInfo] Add support for __fp16, float, and double constants.
Paul Robinson via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 7 15:29:25 PST 2016
probinson added subscribers: cfe-commits, probinson.
probinson added a comment.
Hi David!
As this is a Clang patch, you should subscribe cfe-commits rather than llvm-commits. I've done that for you.
See also inline comments.
================
Comment at: lib/CodeGen/CGDebugInfo.cpp:3765
+ InitExpr =
+ DBuilder.createConstantValueExpression(Init.getFloat().bitcastToAPInt().getZExtValue());
GV.reset(DBuilder.createGlobalVariable(
----------------
This line exceeds 80 columns. clang-format is your friend.
================
Comment at: test/CodeGen/debug-info-static-const-fp.c:19
+// CHECK: !4 = distinct !DIGlobalVariable(name: "hVal", scope: !0, file: !1, line: 6, type: !5, isLocal: true, isDefinition: true, expr: !7)
+// CHECK: !7 = !DIExpression(DW_OP_constu, 16502, DW_OP_stack_value)
+// CHECK: !8 = distinct !DIGlobalVariable(name: "fVal", scope: !0, file: !1, line: 8, type: !9, isLocal: true, isDefinition: true, expr: !11)
----------------
Checking for the entire exact line for the variable is a bit fragile. Really what you want to do is associate the variable with the correct expression, and ignore all the irrelevant details. Something like this:
```
// CHECK: DIGlobalVariable(name: "hVal", {{.*}} expr: ![[HEXPR:{{[0-9]+}}]]
// CHECK: ![[HEXPR] = ! DIExpression(DW_OP_constu, 16502, DW_OP_stack_value)
```
And similar pairs for the other variables. I'd use a different FileCheck variable for each case.
https://reviews.llvm.org/D27549
More information about the cfe-commits
mailing list