[PATCH] D29203: Change debug-info-for-profiling from a TargetOption to a function attribute.

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 17:26:55 PST 2017


mehdi_amini added inline comments.


================
Comment at: include/llvm/IR/Attributes.td:182
 def NoJumpTables : StrBoolAttr<"no-jump-tables">;
+def DebugInfoForProfiling : StrBoolAttr<"debug-info-for-profiling">;
 
----------------
That'll be long in the IR, where there is already a long list, what about "prof-dbg-info" or something like that that would make sense? 


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1138
+    HasDebugInfoForProfiling=true;
+
   // If there's no debug info for the function we're not going to do anything.
----------------
ahatanak wrote:
> Is debug-info-for-profiling used to turn on and off debug info for profiling on a per-function basis? I'm not very familiar with this function, but it looks like HasDebugInfoForProfiling is initialized to false in the constructor and then it will always be true after beginFunction is called on a function that has attribute debug-info-for-profiling=true.
Yep that seems broken to me. If foo has the attribute and not bar, we'll emit the profiling debug info for bar if foo is processed first.


https://reviews.llvm.org/D29203





More information about the llvm-commits mailing list