[PATCH] Add DIBuilder functions to build RAUWable DIVariables and DIFunctions.
Frederic Riss
friss at apple.com
Fri Sep 12 09:37:33 PDT 2014
================
Comment at: lib/IR/DIBuilder.cpp:1062
@@ -1035,3 +1061,3 @@
ConstantInt::get(Type::getInt32Ty(VMContext), isLocalToUnit),
ConstantInt::get(Type::getInt32Ty(VMContext), 1), /* isDefinition*/
Val,
----------------
dblaikie wrote:
> Should this be hardcoded as a definition? Seems like the "createTempStaticVariableFwdDecl" would want a declaration, not a definition.
Doh! you're right. I had it and then reworked the patch and lost that change...
================
Comment at: lib/IR/DIBuilder.cpp:1240
@@ +1239,3 @@
+
+ if (Temporary)
+ Node = MDNode::getTemporary(VMContext, Elts);
----------------
dblaikie wrote:
> Wonder if there's a nicer way to do this - templated & pass in a lambda?
>
> But it's nothing drastic either way.
I had a /simpler/ way, but I'm not sure you'll find it nicer (In fact I changed it because I thought you'd not like it). In the first incarnation of the patch, I just checked the isDefinition value and decided upon temporary or not based on that. I audited all users and if I didn't miss anything, none passes false for isDefinition today. Thus only the ones I will introduce would need to care about the temporary aspect.
And similarly for the variables (where I introduced a new argument for isDefinition that I lost in this version of the patch).
http://reviews.llvm.org/D5328
More information about the llvm-commits
mailing list