summaryrefslogtreecommitdiff
path: root/lib/Analysis/IPA
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2005-04-21 21:13:18 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2005-04-21 21:13:18 +0000
commit2b37d7cf28b1382420b5e4007042feeb66d21ac8 (patch)
treeedf1e11bc9d3208c7e04392a840f8812b506a751 /lib/Analysis/IPA
parent019b63931b946a7dbf55282f4dce7d94d617c5fb (diff)
downloadllvm-2b37d7cf28b1382420b5e4007042feeb66d21ac8.tar.gz
llvm-2b37d7cf28b1382420b5e4007042feeb66d21ac8.tar.bz2
llvm-2b37d7cf28b1382420b5e4007042feeb66d21ac8.tar.xz
Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21416 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA')
-rw-r--r--lib/Analysis/IPA/Andersens.cpp32
-rw-r--r--lib/Analysis/IPA/CallGraph.cpp10
-rw-r--r--lib/Analysis/IPA/CallGraphSCCPass.cpp4
-rw-r--r--lib/Analysis/IPA/FindUnsafePointerTypes.cpp14
-rw-r--r--lib/Analysis/IPA/FindUsedTypes.cpp16
-rw-r--r--lib/Analysis/IPA/GlobalsModRef.cpp22
-rw-r--r--lib/Analysis/IPA/PrintSCC.cpp8
7 files changed, 53 insertions, 53 deletions
diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp
index 50ee474339..8362be596b 100644
--- a/lib/Analysis/IPA/Andersens.cpp
+++ b/lib/Analysis/IPA/Andersens.cpp
@@ -1,10 +1,10 @@
//===- Andersens.cpp - Andersen's Interprocedural Alias Analysis ----------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file defines a very simple implementation of Andersen's interprocedural
@@ -43,8 +43,8 @@
//
// Future Improvements:
// This implementation of Andersen's algorithm is extremely slow. To make it
-// scale reasonably well, the inclusion constraints could be sorted (easy),
-// offline variable substitution would be a huge win (straight-forward), and
+// scale reasonably well, the inclusion constraints could be sorted (easy),
+// offline variable substitution would be a huge win (straight-forward), and
// online cycle elimination (trickier) might help as well.
//
//===----------------------------------------------------------------------===//
@@ -137,7 +137,7 @@ namespace {
std::map<Value*, unsigned> ValueNodes;
/// ObjectNodes - This map contains entries for each memory object in the
- /// program: globals, alloca's and mallocs.
+ /// program: globals, alloca's and mallocs.
std::map<Value*, unsigned> ObjectNodes;
/// ReturnNodes - This map contains an entry for each function in the
@@ -161,7 +161,7 @@ namespace {
Constraint(ConstraintType Ty, Node *D, Node *S)
: Type(Ty), Dest(D), Src(S) {}
};
-
+
/// Constraints - This vector contains a list of all of the constraints
/// identified by the program.
std::vector<Constraint> Constraints;
@@ -193,7 +193,7 @@ namespace {
NullPtr = 1,
NullObject = 2,
};
-
+
public:
bool runOnModule(Module &M) {
InitializeAliasAnalysis(this);
@@ -209,7 +209,7 @@ namespace {
ReturnNodes.clear();
VarargNodes.clear();
EscapingInternalFunctions.clear();
- std::vector<Constraint>().swap(Constraints);
+ std::vector<Constraint>().swap(Constraints);
return false;
}
@@ -232,7 +232,7 @@ namespace {
//------------------------------------------------
// Implement the AliasAnalysis API
- //
+ //
AliasResult alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size);
ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
@@ -265,7 +265,7 @@ namespace {
}
return &GraphNodes[I->second];
}
-
+
/// getObject - Return the node corresponding to the memory object for the
/// specified global or allocation instruction.
Node *getObject(Value *V) {
@@ -415,7 +415,7 @@ void Andersens::getMustAliases(Value *P, std::vector<Value*> &RetVals) {
}
}
}
-
+
AliasAnalysis::getMustAliases(P, RetVals);
}
@@ -572,7 +572,7 @@ void Andersens::AddGlobalInitializerConstraints(Node *N, Constant *C) {
if (C->getType()->isFirstClassType()) {
if (isa<PointerType>(C->getType()))
N->copyFrom(getNodeForConstantPointer(C));
-
+
} else if (C->isNullValue()) {
N->addPointerTo(&GraphNodes[NullObject]);
return;
@@ -607,7 +607,7 @@ bool Andersens::AddConstraintsForExternalCall(CallSite CS, Function *F) {
F->getName() == "atol" || F->getName() == "atoll" ||
F->getName() == "remove" || F->getName() == "unlink" ||
F->getName() == "rename" || F->getName() == "memcmp" ||
- F->getName() == "llvm.memset" ||
+ F->getName() == "llvm.memset" ||
F->getName() == "strcmp" || F->getName() == "strncmp" ||
F->getName() == "execl" || F->getName() == "execlp" ||
F->getName() == "execle" || F->getName() == "execv" ||
@@ -703,7 +703,7 @@ void Andersens::CollectConstraints(Module &M) {
&GraphNodes[UniversalSet]));
}
}
-
+
for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
// Make the function address point to the function object.
getNodeValue(*F)->addPointerTo(getObject(F)->setValue(F));
@@ -902,7 +902,7 @@ void Andersens::AddConstraintsForCall(CallSite CS, Function *F) {
&GraphNodes[UniversalSet],
getReturnNode(F)));
}
-
+
Function::arg_iterator AI = F->arg_begin(), AE = F->arg_end();
CallSite::arg_iterator ArgI = CS.arg_begin(), ArgE = CS.arg_end();
for (; AI != AE && ArgI != ArgE; ++AI, ++ArgI)
@@ -920,7 +920,7 @@ void Andersens::AddConstraintsForCall(CallSite CS, Function *F) {
&GraphNodes[UniversalSet],
getNode(*ArgI)));
}
-
+
// Copy all pointers passed through the varargs section to the varargs node.
if (F->getFunctionType()->isVarArg())
for (; ArgI != ArgE; ++ArgI)
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index 6ca23c662a..3caafd9233 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/lib/Analysis/IPA/CallGraph.cpp
@@ -1,10 +1,10 @@
//===- CallGraph.cpp - Build a Module's call graph ------------------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements the CallGraph class.
@@ -57,7 +57,7 @@ void CallGraph::addToCallGraph(Function *F) {
Root = Node; // Found a main, keep track of it!
}
}
-
+
// If this function is not defined in this translation unit, it could call
// anything.
if (F->isExternal() && !F->getIntrinsicID())
@@ -113,7 +113,7 @@ bool CallGraph::runOnModule(Module &M) {
// If we didn't find a main function, use the external call graph node
if (Root == 0) Root = ExternalCallingNode;
-
+
return false;
}
@@ -148,7 +148,7 @@ void CallGraph::print(std::ostream &OS, const Module *M) const {
OS << F->getName() << "\n";
else
OS << "<<null function: 0x" << getRoot() << ">>\n";
-
+
for (CallGraph::const_iterator I = begin(), E = end(); I != E; ++I)
I->second->print(OS);
}
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp
index 8eb1c120b0..360bc23be3 100644
--- a/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp
@@ -1,10 +1,10 @@
//===- CallGraphSCCPass.cpp - Pass that operates BU on call graph ---------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements the CallGraphSCCPass class, which is used for passes
diff --git a/lib/Analysis/IPA/FindUnsafePointerTypes.cpp b/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
index c0d0a62850..934931b2e9 100644
--- a/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
+++ b/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
@@ -1,13 +1,13 @@
//===- FindUnsafePointerTypes.cpp - Check pointer usage safety ------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
-// This file defines a pass that can be used to determine, interprocedurally,
+// This file defines a pass that can be used to determine, interprocedurally,
// which pointer types are accessed unsafely in a program. If there is an
// "unsafe" access to a specific pointer type, transformations that depend on
// type safety cannot be permitted.
@@ -20,7 +20,7 @@
//
// Currently, the only allowed operations on pointer types are:
// alloca, malloc, free, getelementptr, load, and store
-//
+//
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/FindUnsafePointerTypes.h"
@@ -37,7 +37,7 @@ X("unsafepointertypes", "Find Unsafe Pointer Types");
// Provide a command line option to turn on printing of which instructions cause
// a type to become invalid
//
-static cl::opt<bool>
+static cl::opt<bool>
PrintFailures("printunsafeptrinst", cl::Hidden,
cl::desc("Print Unsafe Pointer Access Instructions"));
@@ -96,9 +96,9 @@ void FindUnsafePointerTypes::print(std::ostream &o, const Module *M) const {
o << "SafePointerAccess Analysis: Found these unsafe types:\n";
unsigned Counter = 1;
- for (std::set<PointerType*>::const_iterator I = getUnsafeTypes().begin(),
+ for (std::set<PointerType*>::const_iterator I = getUnsafeTypes().begin(),
E = getUnsafeTypes().end(); I != E; ++I, ++Counter) {
-
+
o << " #" << Counter << ". ";
CW << **I << "\n";
}
diff --git a/lib/Analysis/IPA/FindUsedTypes.cpp b/lib/Analysis/IPA/FindUsedTypes.cpp
index e37a40ac66..83b994b53e 100644
--- a/lib/Analysis/IPA/FindUsedTypes.cpp
+++ b/lib/Analysis/IPA/FindUsedTypes.cpp
@@ -1,10 +1,10 @@
//===- FindUsedTypes.cpp - Find all Types used by a module ----------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This pass is used to seek out all of the types in use by the program. Note
@@ -32,10 +32,10 @@ void FindUsedTypes::stub() {}
// collection of used types.
//
void FindUsedTypes::IncorporateType(const Type *Ty) {
- // If ty doesn't already exist in the used types map, add it now, otherwise
+ // If ty doesn't already exist in the used types map, add it now, otherwise
// return.
if (!UsedTypes.insert(Ty).second) return; // Already contain Ty.
-
+
// Make sure to add any types this type references now.
//
for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
@@ -45,7 +45,7 @@ void FindUsedTypes::IncorporateType(const Type *Ty) {
void FindUsedTypes::IncorporateValue(const Value *V) {
IncorporateType(V->getType());
-
+
// If this is a constant, it could be using other types...
if (const Constant *C = dyn_cast<Constant>(V)) {
if (!isa<GlobalValue>(C))
@@ -71,21 +71,21 @@ bool FindUsedTypes::runOnModule(Module &m) {
for (Module::iterator MI = m.begin(), ME = m.end(); MI != ME; ++MI) {
IncorporateType(MI->getType());
const Function &F = *MI;
-
+
// Loop over all of the instructions in the function, adding their return
// type as well as the types of their operands.
//
for (const_inst_iterator II = inst_begin(F), IE = inst_end(F);
II != IE; ++II) {
const Instruction &I = *II;
-
+
IncorporateType(I.getType()); // Incorporate the type of the instruction
for (User::const_op_iterator OI = I.op_begin(), OE = I.op_end();
OI != OE; ++OI)
IncorporateValue(*OI); // Insert inst operand types as well
}
}
-
+
return false;
}
diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp
index 40700f9b6d..4ffd91ad2b 100644
--- a/lib/Analysis/IPA/GlobalsModRef.cpp
+++ b/lib/Analysis/IPA/GlobalsModRef.cpp
@@ -1,10 +1,10 @@
//===- GlobalsModRef.cpp - Simple Mod/Ref Analysis for Globals ------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This simple pass provides alias and mod/ref information for global values
@@ -58,7 +58,7 @@ namespace {
return I->second;
return 0;
}
-
+
/// FunctionEffect - Capture whether or not this function reads or writes to
/// ANY memory. If not, we can do a lot of aggressive analysis on it.
unsigned FunctionEffect;
@@ -92,7 +92,7 @@ namespace {
//------------------------------------------------
// Implement the AliasAnalysis API
- //
+ //
AliasResult alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size);
ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
@@ -111,7 +111,7 @@ namespace {
return DoesNotAccessMemory;
else if ((FR->FunctionEffect & Mod) == 0)
return OnlyReadsMemory;
- return AliasAnalysis::getModRefBehavior(F, CS, Info);
+ return AliasAnalysis::getModRefBehavior(F, CS, Info);
}
virtual void deleteValue(Value *V);
@@ -134,7 +134,7 @@ namespace {
bool AnalyzeUsesOfGlobal(Value *V, std::vector<Function*> &Readers,
std::vector<Function*> &Writers);
};
-
+
RegisterOpt<GlobalsModRef> X("globalsmodref-aa",
"Simple mod/ref analysis for globals");
RegisterAnalysisGroup<AliasAnalysis, GlobalsModRef> Y;
@@ -211,7 +211,7 @@ bool GlobalsModRef::AnalyzeUsesOfGlobal(Value *V,
return true;
} else {
return true;
- }
+ }
} else if (GlobalValue *GV = dyn_cast<GlobalValue>(*UI)) {
if (AnalyzeUsesOfGlobal(GV, Readers, Writers)) return true;
} else {
@@ -223,7 +223,7 @@ bool GlobalsModRef::AnalyzeUsesOfGlobal(Value *V,
/// AnalyzeCallGraph - At this point, we know the functions where globals are
/// immediately stored to and read from. Propagate this information up the call
/// graph to all callers and compute the mod/ref info for all memory for each
-/// function.
+/// function.
void GlobalsModRef::AnalyzeCallGraph(CallGraph &CG, Module &M) {
// We do a bottom-up SCC traversal of the call graph. In other words, we
// visit all callees before callers (leaf-first).
@@ -298,13 +298,13 @@ void GlobalsModRef::AnalyzeSCC(std::vector<CallGraphNode *> &SCC) {
FunctionInfo.erase(SCC[i]->getFunction());
return;
}
-
+
// Otherwise, unless we already know that this function mod/refs memory, scan
// the function bodies to see if there are any explicit loads or stores.
if (FunctionEffect != ModRef) {
for (unsigned i = 0, e = SCC.size(); i != e && FunctionEffect != ModRef;++i)
for (inst_iterator II = inst_begin(SCC[i]->getFunction()),
- E = inst_end(SCC[i]->getFunction());
+ E = inst_end(SCC[i]->getFunction());
II != E && FunctionEffect != ModRef; ++II)
if (isa<LoadInst>(*II))
FunctionEffect |= Ref;
@@ -334,7 +334,7 @@ static const GlobalValue *getUnderlyingObject(const Value *V) {
// If we are at some type of object... return it.
if (const GlobalValue *GV = dyn_cast<GlobalValue>(V)) return GV;
-
+
// Traverse through different addressing mechanisms...
if (const Instruction *I = dyn_cast<Instruction>(V)) {
if (isa<CastInst>(I) || isa<GetElementPtrInst>(I))
diff --git a/lib/Analysis/IPA/PrintSCC.cpp b/lib/Analysis/IPA/PrintSCC.cpp
index d37c4caa83..c0adf5ca03 100644
--- a/lib/Analysis/IPA/PrintSCC.cpp
+++ b/lib/Analysis/IPA/PrintSCC.cpp
@@ -1,10 +1,10 @@
//===- PrintSCC.cpp - Enumerate SCCs in some key graphs -------------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file provides passes to print out SCCs in a CFG or a CallGraph.
@@ -17,10 +17,10 @@
// analyze -cfgscc to print the SCCs in each CFG of a module.
// analyze -cfgscc -stats to print the #SCCs and the maximum SCC size.
// analyze -cfgscc -debug > /dev/null to watch the algorithm in action.
-//
+//
// and similarly:
// analyze -callscc [-stats] [-debug] to print SCCs in the CallGraph
-//
+//
// (3) To test the scc_iterator.
//
//===----------------------------------------------------------------------===//