aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BasicInliner.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-10-28 23:24:26 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-10-28 23:24:26 +0000
commitcc2045534623f86869933b5288bc8dc2745bf92c (patch)
treeffdf21658ee5d7bb700da97ddd177d62b505192d /llvm/lib/Transforms/Utils/BasicInliner.cpp
parent2c34c130bff3661556af9e3b420945a4736f1778 (diff)
downloadllvm-cc2045534623f86869933b5288bc8dc2745bf92c.zip
llvm-cc2045534623f86869933b5288bc8dc2745bf92c.tar.gz
llvm-cc2045534623f86869933b5288bc8dc2745bf92c.tar.bz2
Assorted comment/naming fixes, 80-col violations, and reindentation.
- No functionality change. llvm-svn: 58352
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicInliner.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/BasicInliner.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicInliner.cpp b/llvm/lib/Transforms/Utils/BasicInliner.cpp
index 5c2c698..ba1fb3d 100644
--- a/llvm/lib/Transforms/Utils/BasicInliner.cpp
+++ b/llvm/lib/Transforms/Utils/BasicInliner.cpp
@@ -28,7 +28,7 @@ using namespace llvm;
static cl::opt<unsigned>
BasicInlineThreshold("inline-threshold", cl::Hidden, cl::init(200),
- cl::desc("Control the amount of basic inlining to perform (default = 200)"));
+ cl::desc("Control the amount of basic inlining to perform (default = 200)"));
namespace llvm {
@@ -95,22 +95,23 @@ void BasicInlinerImpl::inlineFunctions() {
bool Changed = false;
do {
Changed = false;
- for (unsigned index = 0; index != CallSites.size() && !CallSites.empty(); ++index) {
+ for (unsigned index = 0; index != CallSites.size() && !CallSites.empty();
+ ++index) {
CallSite CS = CallSites[index];
if (Function *Callee = CS.getCalledFunction()) {
- // Eliminate calls taht are never inlinable.
+ // Eliminate calls that are never inlinable.
if (Callee->isDeclaration() ||
CS.getInstruction()->getParent()->getParent() == Callee) {
CallSites.erase(CallSites.begin() + index);
- --index;
- continue;
+ --index;
+ continue;
}
int InlineCost = CA.getInlineCost(CS, NeverInline);
if (InlineCost >= (int) BasicInlineThreshold) {
- DOUT << " NOT Inlining: cost = " << InlineCost
- << ", call: " << *CS.getInstruction();
- continue;
+ DOUT << " NOT Inlining: cost = " << InlineCost
+ << ", call: " << *CS.getInstruction();
+ continue;
}
DOUT << " Inlining: cost=" << InlineCost
@@ -119,7 +120,7 @@ void BasicInlinerImpl::inlineFunctions() {
// Inline
if (InlineFunction(CS, NULL, TD)) {
if (Callee->use_empty() && Callee->hasInternalLinkage())
- DeadFunctions.insert(Callee);
+ DeadFunctions.insert(Callee);
Changed = true;
CallSites.erase(CallSites.begin() + index);
--index;