[PATCH] D18706: [DWARF] Force a linkage_name on an inlined subprogram's abstract origin

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 12:51:54 PDT 2016


dblaikie added a comment.

In http://reviews.llvm.org/D18706#391247, @probinson wrote:

> Re not passing constants down:  It looks like applySubprogramDefinitionAttributes could figure out if the SP is abstract with something like this?


What I was thinking of was more raising the addition of the linkage name up into the callers - so that we don't turn a static property at the call site into a dynamic property of the caller if we can avoid it without complicating things.

But I suppose pushing up/duplicating the logic for getting the decl linkage name, testing !Minimal, etc, isn't really any good...

I'm fine with either way, then.

Also - depending on how far you want to go, you could probably skip the mangled name for abstract subprograms that have a concrete definition (it'd mean having to search through the DWARF to find the concrete subprogram, then looking at its high/low pc to find the symbol in the symbol table with the mangled name there)


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:108-112
@@ -107,8 +107,7 @@
 
-static cl::opt<DefaultOnOff>
-DwarfLinkageNames("dwarf-linkage-names", cl::Hidden,
-                  cl::desc("Emit DWARF linkage-name attributes."),
-                  cl::values(clEnumVal(Default, "Default for platform"),
-                             clEnumVal(Enable, "Enabled"),
-                             clEnumVal(Disable, "Disabled"), clEnumValEnd),
-                  cl::init(Default));
+enum LinkageNameOption {
+  DefaultLinkageNames,
+  AllLinkageNames,
+  AbstractLinkageNames
+};
+static cl::opt<LinkageNameOption>
----------------
Why did this need to become a 3 state when it was a boolean before? (when it's still only about 2 states, I think - before it was all-or-nothing, and now it's all-or-abstract)


http://reviews.llvm.org/D18706





More information about the llvm-commits mailing list