[PATCH] D69676: [WinCFG] Handle constant casts carefully in .gfids emission
    Reid Kleckner via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Oct 31 13:29:28 PDT 2019
    
    
  
rnk marked an inline comment as done.
rnk added a comment.
> I mentioned this on the bug, but do we care if a reference to a function is optimized away at the MIR level?
I don't think it's worth the work of tracking these things at the MIR level. The new implementation will come with its own set of bugs and quirks, some of which I mentioned on the bug: large code model, target specificity, separate codepath for emission as a global initializer.
We promise that adding -g doesn't change the code we generate, but we don't promise that adding -guard:cf,nochecks won't change the generated code.
================
Comment at: llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp:71
+        // constants, such as vtable initializers, to escape the function.
+        if (C->stripPointerCasts() == FnOrCast)
+          Users.push_back(FnUser);
----------------
efriedma wrote:
> Does stripPointerCasts do the right thing here?  It can look through multiple levels of casts.
Thanks, this should compare to Fn. I couldn't think of another simple way to identify pointer casts.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69676/new/
https://reviews.llvm.org/D69676
    
    
More information about the llvm-commits
mailing list