aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-01-14 21:48:00 +0000
committerEric Christopher <echristo@apple.com>2010-01-14 21:48:00 +0000
commit745d8c95ef75b76ad3f6325f13876d8195e18ebd (patch)
treeb93676de3c9a0de57bd63fcc1c7c9186b83593cf /lib/Analysis/InlineCost.cpp
parent86e69fa901ea0e04bc24ae3d8f757bccc84c10e6 (diff)
downloadexternal_llvm-745d8c95ef75b76ad3f6325f13876d8195e18ebd.zip
external_llvm-745d8c95ef75b76ad3f6325f13876d8195e18ebd.tar.gz
external_llvm-745d8c95ef75b76ad3f6325f13876d8195e18ebd.tar.bz2
Few minor changes that were requested. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/InlineCost.cpp')
-rw-r--r--lib/Analysis/InlineCost.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp
index 87b2361..578b2b6 100644
--- a/lib/Analysis/InlineCost.cpp
+++ b/lib/Analysis/InlineCost.cpp
@@ -102,11 +102,15 @@ unsigned InlineCostAnalyzer::FunctionInfo::
return Reduction;
}
-// callIsSmall - If a call will lower to a single selection DAG node, or
+// callIsSmall - If a call is likely to lower to a single target instruction, or
// is otherwise deemed small return true.
// TODO: Perhaps calls like memcpy, strcpy, etc?
static bool callIsSmall(const Function *F) {
- if (F && !F->hasLocalLinkage() && F->hasName()) {
+ if (!F) return false;
+
+ if (F->hasLocalLinkage()) return false;
+
+ if (F->hasName()) {
StringRef Name = F->getName();
// These will all likely lower to a single selection DAG node.