diff options
author | Craig Topper <craig.topper@gmail.com> | 2013-07-03 04:30:58 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2013-07-03 04:30:58 +0000 |
commit | 9f4c37915fbf11d16ed609ac016595387860ac3a (patch) | |
tree | 1a138e88bbc2ec7f7d1836376484266a327d4773 | |
parent | 1c3751c21f22f136dd577d262ea7ac1151567d01 (diff) | |
download | llvm-9f4c37915fbf11d16ed609ac016595387860ac3a.tar.gz llvm-9f4c37915fbf11d16ed609ac016595387860ac3a.tar.bz2 llvm-9f4c37915fbf11d16ed609ac016595387860ac3a.tar.xz |
Return SmallVectorImpl& instead of SmallVector& in a couple places to avoid having to specify the vector size in multiple places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185507 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/CodeGen/LexicalScopes.h | 14 | ||||
-rw-r--r-- | lib/CodeGen/LexicalScopes.cpp | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/include/llvm/CodeGen/LexicalScopes.h b/include/llvm/CodeGen/LexicalScopes.h index 72491d310c..26563a6055 100644 --- a/include/llvm/CodeGen/LexicalScopes.h +++ b/include/llvm/CodeGen/LexicalScopes.h @@ -166,13 +166,13 @@ public: virtual ~LexicalScope() {} // Accessors. - LexicalScope *getParent() const { return Parent; } - const MDNode *getDesc() const { return Desc; } - const MDNode *getInlinedAt() const { return InlinedAtLocation; } - const MDNode *getScopeNode() const { return Desc; } - bool isAbstractScope() const { return AbstractScope; } - SmallVector<LexicalScope *, 4> &getChildren() { return Children; } - SmallVector<InsnRange, 4> &getRanges() { return Ranges; } + LexicalScope *getParent() const { return Parent; } + const MDNode *getDesc() const { return Desc; } + const MDNode *getInlinedAt() const { return InlinedAtLocation; } + const MDNode *getScopeNode() const { return Desc; } + bool isAbstractScope() const { return AbstractScope; } + SmallVectorImpl<LexicalScope *> &getChildren() { return Children; } + SmallVectorImpl<InsnRange> &getRanges() { return Ranges; } /// addChild - Add a child scope. void addChild(LexicalScope *S) { Children.push_back(S); } diff --git a/lib/CodeGen/LexicalScopes.cpp b/lib/CodeGen/LexicalScopes.cpp index 81721541cd..6ea0aa4eb5 100644 --- a/lib/CodeGen/LexicalScopes.cpp +++ b/lib/CodeGen/LexicalScopes.cpp @@ -218,7 +218,7 @@ void LexicalScopes::constructScopeNest(LexicalScope *Scope) { unsigned Counter = 0; while (!WorkStack.empty()) { LexicalScope *WS = WorkStack.back(); - const SmallVector<LexicalScope *, 4> &Children = WS->getChildren(); + const SmallVectorImpl<LexicalScope *> &Children = WS->getChildren(); bool visitedChildren = false; for (SmallVector<LexicalScope *, 4>::const_iterator SI = Children.begin(), SE = Children.end(); SI != SE; ++SI) { @@ -279,7 +279,7 @@ getMachineBasicBlocks(DebugLoc DL, return; } - SmallVector<InsnRange, 4> &InsnRanges = Scope->getRanges(); + SmallVectorImpl<InsnRange> &InsnRanges = Scope->getRanges(); for (SmallVector<InsnRange, 4>::iterator I = InsnRanges.begin(), E = InsnRanges.end(); I != E; ++I) { InsnRange &R = *I; |