[PATCH] D44802: Add the ShadowCallStack pass

Vlad Tsyrklevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 28 15:36:41 PDT 2018


vlad.tsyrklevich added inline comments.


================
Comment at: lib/Target/X86/ShadowCallStack.cpp:293
+
+    for (auto I = ++Fn.begin(), E = Fn.end(); I != E; ++I)
+      I->addLiveIn(LeafFuncRegister);
----------------
vitalybuka wrote:
> ```
> for (auto &MBB : Fn)
>   MBB.addLiveIn(LeafFuncRegister);
> ```
The original loop actually skips the first basic bock: ++Fn.begin(), I'll add a comment to make that clearer.


================
Comment at: lib/Target/X86/ShadowCallStack.cpp:324
+    NonEmpty = MBB->getFallThrough();
+  const DebugLoc &DL = NonEmpty->front().getDebugLoc();
+
----------------
vitalybuka wrote:
> can getFallThrough return null?
I don't think so, the check at 241 demonstrates there is at least one instruction in this function so if the first MBB is empty then there has to be another MBB following it.


Repository:
  rL LLVM

https://reviews.llvm.org/D44802





More information about the llvm-commits mailing list