OSDN Git Service

[CallSite removal] Migrate all Alias Analysis APIs to use the newly
authorChandler Carruth <chandlerc@gmail.com>
Mon, 7 Jan 2019 05:42:51 +0000 (05:42 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 7 Jan 2019 05:42:51 +0000 (05:42 +0000)
commit81aa712273fec5c566762dd0a14561527bb70a86
tree1c98ffb7dd3450aea13f9c2a530cffbbd8aba372
parent4196919f29b2f5618b9965e25f04237de75fcfe6
[CallSite removal] Migrate all Alias Analysis APIs to use the newly
minted `CallBase` class instead of the `CallSite` wrapper.

This moves the largest interwoven collection of APIs that traffic in
`CallSite`s. While a handful of these could have been migrated with
a minorly more shallow migration by converting from a `CallSite` to
a `CallBase`, it hardly seemed worth it. Most of the APIs needed to
migrate together because of the complex interplay of AA APIs and the
fact that converting from a `CallBase` to a `CallSite` isn't free in its
current implementation.

Out of tree users of these APIs can fairly reliably migrate with some
combination of `.getInstruction()` on the `CallSite` instance and
casting the resulting pointer. The most generic form will look like `CS`
-> `cast_or_null<CallBase>(CS.getInstruction())` but in most cases there
is a more elegant migration. Hopefully, this migrates enough APIs for
users to fully move from `CallSite` to the base class. All of the
in-tree users were easily migrated in that fashion.

Thanks for the review from Saleem!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350503 91177308-0d34-0410-b5e6-96231b3b80d8
32 files changed:
include/llvm/Analysis/AliasAnalysis.h
include/llvm/Analysis/BasicAliasAnalysis.h
include/llvm/Analysis/GlobalsModRef.h
include/llvm/Analysis/MemoryDependenceAnalysis.h
include/llvm/Analysis/MemoryLocation.h
include/llvm/Analysis/ObjCARCAliasAnalysis.h
include/llvm/Analysis/ScopedNoAliasAA.h
include/llvm/Analysis/TypeBasedAliasAnalysis.h
include/llvm/Analysis/ValueTracking.h
lib/Analysis/AliasAnalysis.cpp
lib/Analysis/AliasAnalysisEvaluator.cpp
lib/Analysis/AliasSetTracker.cpp
lib/Analysis/BasicAliasAnalysis.cpp
lib/Analysis/CaptureTracking.cpp
lib/Analysis/GlobalsModRef.cpp
lib/Analysis/Loads.cpp
lib/Analysis/MemDepPrinter.cpp
lib/Analysis/MemoryDependenceAnalysis.cpp
lib/Analysis/MemoryLocation.cpp
lib/Analysis/MemorySSA.cpp
lib/Analysis/ObjCARCAliasAnalysis.cpp
lib/Analysis/ScopedNoAliasAA.cpp
lib/Analysis/TypeBasedAliasAnalysis.cpp
lib/Analysis/ValueTracking.cpp
lib/Transforms/IPO/FunctionAttrs.cpp
lib/Transforms/ObjCARC/DependencyAnalysis.cpp
lib/Transforms/Scalar/DeadStoreElimination.cpp
lib/Transforms/Scalar/GVN.cpp
lib/Transforms/Scalar/LoopVersioningLICM.cpp
lib/Transforms/Scalar/MemCpyOptimizer.cpp
lib/Transforms/Scalar/Sink.cpp
lib/Transforms/Utils/InlineFunction.cpp