[PATCH] D44802: Add the ShadowCallStack pass

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 28 14:23:02 PDT 2018


vitalybuka added inline comments.


================
Comment at: lib/Target/X86/ShadowCallStack.cpp:64
+
+  void addProlog(MachineFunction &Fn, MachineBasicBlock *MBB,
+                 const DebugLoc &DL);
----------------
Do you need this functions like members.
probably static non member should work as well


================
Comment at: lib/Target/X86/ShadowCallStack.cpp:90
+
+void ShadowCallStack::addProlog(MachineFunction &Fn, MachineBasicBlock *MBB,
+                                const DebugLoc &DL) {
----------------
Why is there inconsistency reference vs pointer?


================
Comment at: lib/Target/X86/ShadowCallStack.cpp:287
+      if (!Used) {
+        LeafFuncOptimization = true;
+        LeafFuncRegister = Reg;
----------------
LeafFuncOptimization looks redundunt: LeafFuncOptimization  == ( LeafFuncRegister != X86::NoRegister)


================
Comment at: lib/Target/X86/ShadowCallStack.cpp:293
+
+    for (auto I = ++Fn.begin(), E = Fn.end(); I != E; ++I)
+      I->addLiveIn(LeafFuncRegister);
----------------
```
for (auto &MBB : Fn)
  MBB.addLiveIn(LeafFuncRegister);
```


================
Comment at: lib/Target/X86/ShadowCallStack.cpp:324
+    NonEmpty = MBB->getFallThrough();
+  const DebugLoc &DL = NonEmpty->front().getDebugLoc();
+
----------------
can getFallThrough return null?


Repository:
  rL LLVM

https://reviews.llvm.org/D44802





More information about the llvm-commits mailing list