diff options
author | Davide Italiano <davide@freebsd.org> | 2017-11-30 22:10:35 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2017-11-30 22:10:35 +0000 |
commit | 9d939c8f19854b94c99c37365d6c567deb4acc95 (patch) | |
tree | a31c39a0c515e64f11128a060fcefcc07af48d74 /llvm/lib/Analysis/InlineCost.cpp | |
parent | a7ac2cb6fe741a18f17580110ddcee7c722e3363 (diff) | |
download | bcm5719-llvm-9d939c8f19854b94c99c37365d6c567deb4acc95.tar.gz bcm5719-llvm-9d939c8f19854b94c99c37365d6c567deb4acc95.zip |
[InlineCost] Prefer getFunction() to two calls to getParent().
Improves clarity, also slightly cheaper. NFCI.
llvm-svn: 319481
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index b7fe884cc22..8fd74ccdc50 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -1103,7 +1103,7 @@ bool CallAnalyzer::visitCallSite(CallSite CS) { } } - if (F == CS.getInstruction()->getParent()->getParent()) { + if (F == CS.getInstruction()->getFunction()) { // This flag will fully abort the analysis, so don't bother with anything // else. IsRecursiveCall = true; @@ -1559,14 +1559,14 @@ bool CallAnalyzer::analyzeCall(CallSite CS) { if (F.empty()) return true; - Function *Caller = CS.getInstruction()->getParent()->getParent(); + Function *Caller = CS.getInstruction()->getFunction(); // Check if the caller function is recursive itself. for (User *U : Caller->users()) { CallSite Site(U); if (!Site) continue; Instruction *I = Site.getInstruction(); - if (I->getParent()->getParent() == Caller) { + if (I->getFunction() == Caller) { IsCallerRecursive = true; break; } |