[all-commits] [llvm/llvm-project] f5d935: [WinCFG] Handle constant casts carefully in .gfids...

Reid Kleckner via All-commits all-commits at lists.llvm.org
Fri Nov 1 13:32:59 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f5d935c16777c39142043c429ccebb65259dc767
      https://github.com/llvm/llvm-project/commit/f5d935c16777c39142043c429ccebb65259dc767
  Author: Reid Kleckner <rnk at google.com>
  Date:   2019-11-01 (Fri, 01 Nov 2019)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp
    A llvm/test/CodeGen/WinCFGuard/cfguard-cast.ll

  Log Message:
  -----------
  [WinCFG] Handle constant casts carefully in .gfids emission

Summary:
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.

Reviewers: ajpaverd, efriedma, hans

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69676




More information about the All-commits mailing list