Return SmallVectorImpl& instead of SmallVector& in a couple places to avoid having...
authorCraig Topper <craig.topper@gmail.com>
Wed, 3 Jul 2013 04:30:58 +0000 (04:30 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 3 Jul 2013 04:30:58 +0000 (04:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185507 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/LexicalScopes.h
lib/CodeGen/LexicalScopes.cpp

index 72491d310cebde6f65b97ef3269aa83e326b28a0..26563a605574dcb689e348fc052f97d7173a57c4 100644 (file)
@@ -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); }
index 81721541cd89bbcbd71d63053a66f23e54b0361d..6ea0aa4eb5198fbd04bbca28ec39684037c02ef6 100644 (file)
@@ -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;