Use ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137485 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2011-08-12 18:10:19 +00:00
parent 0285e7d1c1
commit cd9f6c53de
2 changed files with 8 additions and 7 deletions

View File

@ -18,6 +18,7 @@
#define LLVM_CODEGEN_LEXICALSCOPES_H #define LLVM_CODEGEN_LEXICALSCOPES_H
#include "llvm/Metadata.h" #include "llvm/Metadata.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallVector.h"
@ -79,7 +80,7 @@ public:
LexicalScope *findLexicalScope(DebugLoc DL); LexicalScope *findLexicalScope(DebugLoc DL);
/// getAbstractScopesList - Return a reference to list of abstract scopes. /// getAbstractScopesList - Return a reference to list of abstract scopes.
SmallVector<LexicalScope *, 4> &getAbstractScopesList() { ArrayRef<LexicalScope *> getAbstractScopesList() const {
return AbstractScopesList; return AbstractScopesList;
} }

View File

@ -1680,10 +1680,10 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
collectVariableInfo(MF, ProcessedVars); collectVariableInfo(MF, ProcessedVars);
// Construct abstract scopes. // Construct abstract scopes.
SmallVector<LexicalScope *, 4> &AList = LScopes.getAbstractScopesList(); ArrayRef<LexicalScope *> AList = LScopes.getAbstractScopesList();
for (SmallVector<LexicalScope *, 4>::iterator AI = AList.begin(), for (unsigned i = 0, e = AList.size(); i != e; ++i) {
AE = AList.end(); AI != AE; ++AI) { LexicalScope *AScope = AList[i];
DISubprogram SP((*AI)->getScopeNode()); DISubprogram SP(AScope->getScopeNode());
if (SP.Verify()) { if (SP.Verify()) {
// Collect info for variables that were optimized out. // Collect info for variables that were optimized out.
StringRef FName = SP.getLinkageName(); StringRef FName = SP.getLinkageName();
@ -1700,8 +1700,8 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
} }
} }
} }
if (ProcessedSPNodes.count((*AI)->getScopeNode()) == 0) if (ProcessedSPNodes.count(AScope->getScopeNode()) == 0)
constructScopeDIE(*AI); constructScopeDIE(AScope);
} }
DIE *CurFnDIE = constructScopeDIE(LScopes.getCurrentFunctionScope()); DIE *CurFnDIE = constructScopeDIE(LScopes.getCurrentFunctionScope());