[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 11:40:44 PDT 2019


rnk created this revision.
rnk added reviewers: ajpaverd, efriedma, hans.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

The general Function::hasAddressTaken has two issues that make it
inappropriate for our purposes:

1. it is sensitive to dead constant users (PR43858 / crbug.com/1019970), leading to different codegen when debu info is enabled
2. it considers direct calls via a function cast to be address escapes

The first is fixable, but the second is not, because IPO clients rely on
this behavior. They assume this function means that all call sites are
analyzable for IPO purposes.

So, implement our own analysis, which gets closer to finding functions
that may be indirect call targets.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69676

Files:
  llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp
  llvm/test/CodeGen/WinCFGuard/cfguard-cast.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69676.227319.patch
Type: text/x-patch
Size: 3547 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191031/a40f8a33/attachment.bin>


More information about the llvm-commits mailing list