diff options
author | Mircea Trofin <mtrofin@google.com> | 2020-04-22 13:19:15 -0700 |
---|---|---|
committer | Mircea Trofin <mtrofin@google.com> | 2020-04-23 08:23:16 -0700 |
commit | cea6f4d5f8431ea723e85f6e57812feb3633ecbe (patch) | |
tree | 16e5af7c04fb1a9c6bfff2468df03b0b7a9f8b41 /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | |
parent | 367229e100eca714276253bf95a0dd3d084a9624 (diff) | |
download | llvm-cea6f4d5f8431ea723e85f6e57812feb3633ecbe.zip llvm-cea6f4d5f8431ea723e85f6e57812feb3633ecbe.tar.gz llvm-cea6f4d5f8431ea723e85f6e57812feb3633ecbe.tar.bz2 |
[llvm][NFC][CallSite] Remove CallSite from TypeMetadataUtils & related
Reviewers: craig.topper, dblaikie
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78666
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp index 1ff47e1..b78115b 100644 --- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp +++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp @@ -28,7 +28,6 @@ #include "llvm/Analysis/TypeMetadataUtils.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/BasicBlock.h" -#include "llvm/IR/CallSite.h" #include "llvm/IR/Constant.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Dominators.h" @@ -99,7 +98,7 @@ static bool findRefEdges(ModuleSummaryIndex &Index, const User *CurUser, if (!Visited.insert(U).second) continue; - ImmutableCallSite CS(U); + const auto *CB = dyn_cast<CallBase>(U); for (const auto &OI : U->operands()) { const User *Operand = dyn_cast<User>(OI); @@ -113,7 +112,7 @@ static bool findRefEdges(ModuleSummaryIndex &Index, const User *CurUser, // We have a reference to a global value. This should be added to // the reference set unless it is a callee. Callees are handled // specially by WriteFunction and are added to a separate list. - if (!(CS && CS.isCallee(&OI))) + if (!(CB && CB->isCallee(&OI))) RefEdges.insert(Index.getOrInsertValueInfo(GV)); continue; } @@ -145,7 +144,7 @@ static void addVCallToSet(DevirtCallSite Call, GlobalValue::GUID Guid, SetVector<FunctionSummary::ConstVCall> &ConstVCalls) { std::vector<uint64_t> Args; // Start from the second argument to skip the "this" pointer. - for (auto &Arg : make_range(Call.CS.arg_begin() + 1, Call.CS.arg_end())) { + for (auto &Arg : make_range(Call.CB.arg_begin() + 1, Call.CB.arg_end())) { auto *CI = dyn_cast<ConstantInt>(Arg); if (!CI || CI->getBitWidth() > 64) { VCalls.insert({Guid, Call.Offset}); @@ -304,8 +303,8 @@ static void computeFunctionSummary(ModuleSummaryIndex &Index, const Module &M, } } findRefEdges(Index, &I, RefEdges, Visited); - auto CS = ImmutableCallSite(&I); - if (!CS) + const auto *CB = dyn_cast<CallBase>(&I); + if (!CB) continue; const auto *CI = dyn_cast<CallInst>(&I); @@ -317,8 +316,8 @@ static void computeFunctionSummary(ModuleSummaryIndex &Index, const Module &M, if (HasLocalsInUsedOrAsm && CI && CI->isInlineAsm()) HasInlineAsmMaybeReferencingInternal = true; - auto *CalledValue = CS.getCalledValue(); - auto *CalledFunction = CS.getCalledFunction(); + auto *CalledValue = CB->getCalledValue(); + auto *CalledFunction = CB->getCalledFunction(); if (CalledValue && !CalledFunction) { CalledValue = CalledValue->stripPointerCasts(); // Stripping pointer casts can reveal a called function. |