[PATCH] D51075: [SafeStack] Set debug location for calls to __safestack_pointer_address.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 21 17:53:03 PDT 2018


efriedma planned changes to this revision.
efriedma added inline comments.


================
Comment at: lib/CodeGen/SafeStack.cpp:781
+  if (DISubprogram *Subprogram = F.getSubprogram())
+    IRB.SetCurrentDebugLocation(
+        DILocation::get(F.getContext(), 0, 0, Subprogram));
----------------
eugenis wrote:
> Should this be checked in module verifier?
We do, if both the caller and callee have debug info.


================
Comment at: lib/CodeGen/SafeStack.cpp:782
+    IRB.SetCurrentDebugLocation(
+        DILocation::get(F.getContext(), 0, 0, Subprogram));
   if (SafeStackUsePointerAddress) {
----------------
eugenis wrote:
> In ASan we do this:
>   if (auto SP = F.getSubprogram())
>      EntryDebugLocation = DebugLoc::get(SP->getScopeLine(), 0, SP);
> 
> Is that better? I think it will point to the opening curling bracket of the function instead of line 0.
I guess so, given we're inserting this code at the beginning of the function.  I'll change it.


Repository:
  rL LLVM

https://reviews.llvm.org/D51075





More information about the llvm-commits mailing list