[PATCH] Support using sample profiles with partial debug info.
David Blaikie
dblaikie at gmail.com
Tue Oct 21 15:55:38 PDT 2014
Some optional tidbits, but otherwise fine.
================
Comment at: lib/Transforms/Scalar/SampleProfile.cpp:646
@@ +645,3 @@
+ DebugLoc DLoc = Inst.getDebugLoc();
+ if (!DLoc.isUnknown()) {
+ const MDNode *Scope = DLoc.getScopeNode(Ctx);
----------------
usually we do this with an early continue to avoid extra indentation
if (DLoc.isKnown())
continue;
/* more stuff */
& yeah, no worries about the range-for loops, a single cleanup would be fine
================
Comment at: lib/Transforms/Scalar/SampleProfile.cpp:675
@@ -658,1 +674,3 @@
+ // about the missed opportunity.
F.getContext().diagnose(DiagnosticInfoSampleProfile(
+ "No debug information found in function " + F.getName() +
----------------
Separating the change in text and error->warning (& the subsequent test changes) into a separate commit would be nice.
http://reviews.llvm.org/D5887
More information about the llvm-commits
mailing list