summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-07-18 16:23:02 +0000
committerChris Lattner <sabre@nondot.org>2002-07-18 16:23:02 +0000
commita990291462b460e58a19210db8ca85075339ea46 (patch)
treeadb199f2b2ec77f13922b84e2a39f5e4a81ab140 /include/llvm
parentc44e9bfa5cbac3f56ebfc2e74d19c75bb36de8b6 (diff)
downloadllvm-a990291462b460e58a19210db8ca85075339ea46.tar.gz
llvm-a990291462b460e58a19210db8ca85075339ea46.tar.bz2
llvm-a990291462b460e58a19210db8ca85075339ea46.tar.xz
Simplify saveOrigFunctionCalls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2967 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Analysis/DataStructure.h15
-rw-r--r--include/llvm/Analysis/DataStructure/DataStructure.h15
2 files changed, 10 insertions, 20 deletions
diff --git a/include/llvm/Analysis/DataStructure.h b/include/llvm/Analysis/DataStructure.h
index b4493602c5..1a269e8de8 100644
--- a/include/llvm/Analysis/DataStructure.h
+++ b/include/llvm/Analysis/DataStructure.h
@@ -197,11 +197,12 @@ class DSGraph {
// call, the second is the function scalar being invoked, and the rest are
// pointer arguments to the function.
//
+ std::vector<std::vector<DSNodeHandle> > FunctionCalls;
+
// OrigFunctionCalls - This vector retains a copy of the original function
// calls of the current graph. This is needed to support top-down inlining
// after bottom-up inlining is complete, since the latter deletes call nodes.
//
- std::vector<std::vector<DSNodeHandle> > FunctionCalls;
std::vector<std::vector<DSNodeHandle> > OrigFunctionCalls;
// PendingCallers - This vector records all unresolved callers of the
@@ -224,17 +225,11 @@ private:
// clone all the call nodes and save the copies in OrigFunctionCalls
void saveOrigFunctionCalls() {
assert(OrigFunctionCalls.size() == 0 && "Do this only once!");
- OrigFunctionCalls.reserve(FunctionCalls.size());
- for (unsigned i = 0, ei = FunctionCalls.size(); i != ei; ++i) {
- OrigFunctionCalls.push_back(std::vector<DSNodeHandle>());
- OrigFunctionCalls[i].reserve(FunctionCalls[i].size());
- for (unsigned j = 0, ej = FunctionCalls[i].size(); j != ej; ++j)
- OrigFunctionCalls[i].push_back(FunctionCalls[i][j]);
- }
+ OrigFunctionCalls = FunctionCalls;
}
// get the saved copies of the original function call nodes
- std::vector<std::vector<DSNodeHandle> >& getOrigFunctionCalls() {
+ std::vector<std::vector<DSNodeHandle> > &getOrigFunctionCalls() {
return OrigFunctionCalls;
}
@@ -411,7 +406,7 @@ public:
~TDDataStructures() { releaseMemory(); }
virtual const char *getPassName() const {
- return "Top-downData Structure Analysis Closure";
+ return "Top-down Data Structure Analysis Closure";
}
virtual bool run(Module &M);
diff --git a/include/llvm/Analysis/DataStructure/DataStructure.h b/include/llvm/Analysis/DataStructure/DataStructure.h
index b4493602c5..1a269e8de8 100644
--- a/include/llvm/Analysis/DataStructure/DataStructure.h
+++ b/include/llvm/Analysis/DataStructure/DataStructure.h
@@ -197,11 +197,12 @@ class DSGraph {
// call, the second is the function scalar being invoked, and the rest are
// pointer arguments to the function.
//
+ std::vector<std::vector<DSNodeHandle> > FunctionCalls;
+
// OrigFunctionCalls - This vector retains a copy of the original function
// calls of the current graph. This is needed to support top-down inlining
// after bottom-up inlining is complete, since the latter deletes call nodes.
//
- std::vector<std::vector<DSNodeHandle> > FunctionCalls;
std::vector<std::vector<DSNodeHandle> > OrigFunctionCalls;
// PendingCallers - This vector records all unresolved callers of the
@@ -224,17 +225,11 @@ private:
// clone all the call nodes and save the copies in OrigFunctionCalls
void saveOrigFunctionCalls() {
assert(OrigFunctionCalls.size() == 0 && "Do this only once!");
- OrigFunctionCalls.reserve(FunctionCalls.size());
- for (unsigned i = 0, ei = FunctionCalls.size(); i != ei; ++i) {
- OrigFunctionCalls.push_back(std::vector<DSNodeHandle>());
- OrigFunctionCalls[i].reserve(FunctionCalls[i].size());
- for (unsigned j = 0, ej = FunctionCalls[i].size(); j != ej; ++j)
- OrigFunctionCalls[i].push_back(FunctionCalls[i][j]);
- }
+ OrigFunctionCalls = FunctionCalls;
}
// get the saved copies of the original function call nodes
- std::vector<std::vector<DSNodeHandle> >& getOrigFunctionCalls() {
+ std::vector<std::vector<DSNodeHandle> > &getOrigFunctionCalls() {
return OrigFunctionCalls;
}
@@ -411,7 +406,7 @@ public:
~TDDataStructures() { releaseMemory(); }
virtual const char *getPassName() const {
- return "Top-downData Structure Analysis Closure";
+ return "Top-down Data Structure Analysis Closure";
}
virtual bool run(Module &M);