[PATCH] D44802: Add the ShadowCallStack pass

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 28 15:59:11 PDT 2018


pcc added inline comments.


================
Comment at: lib/Target/X86/ShadowCallStack.cpp:95
+  if (MBB->empty())
+    Noop = BuildMI(MBB, DL, TII->get(X86::NOOP));
+
----------------
vlad.tsyrklevich wrote:
> eugenis wrote:
> > AFAIK you can do it without a dummy instruction by using the iterator form of BuildMI and passing MBB->end() or MBB->begin() in case of the empty basic block.
> You could use the MBB->begin() form and insert them backwards, but for the sake of readability I insert them forwards.
I would imagine that you could save the result of `MBB->begin()` and use that to insert instructions forwards, as it should always refer to what used to be the first instruction. Does that not work?


Repository:
  rL LLVM

https://reviews.llvm.org/D44802





More information about the llvm-commits mailing list