[llvm-commits] [patch] BranchFolding debug infomation
Bill Wendling
wendling at apple.com
Thu Mar 1 12:28:09 PST 2012
On Mar 1, 2012, at 4:06 AM, Andrew Stanford-Jason <andrew at xmos.com> wrote:
> Ping. Is there anyone who could review this path? Thanks
>
Hi Andrew,
Sorry for the delay. The patch looks okay. There are a few changes.
+/// getBranchDL - Find and return, if any, the DebugLoc of the branch
Please rename this to "getBranchDebugLoc".
+/// instructions on the block. Always use the DebugLoc of the first
+/// branching instruction found unless its absent, in which case use the
+/// DebugLoc of the second if present.
+static DebugLoc getBranchDL(MachineBasicBlock &MBB) {
+ DebugLoc dl;
This variable is never set. Instead just make the return statements this:
return DebugLoc();
+ MachineBasicBlock::iterator I = MBB.end();
+ if (I == MBB.begin())
+ return dl;
+ --I;
+ while (I->isDebugValue() && I != MBB.begin())
+ --I;
+ if (I->isBranch())
+ return I->getDebugLoc();
+ return dl;
+}
I think it should be okay with these changes. :)
Thanks!
-bw
More information about the llvm-commits
mailing list