[llvm-commits] [llvm] r137485 - in /llvm/trunk: include/llvm/CodeGen/LexicalScopes.h lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Devang Patel
dpatel at apple.com
Fri Aug 12 11:10:19 PDT 2011
Author: dpatel
Date: Fri Aug 12 13:10:19 2011
New Revision: 137485
URL: http://llvm.org/viewvc/llvm-project?rev=137485&view=rev
Log:
Use ArrayRef.
Modified:
llvm/trunk/include/llvm/CodeGen/LexicalScopes.h
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/trunk/include/llvm/CodeGen/LexicalScopes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LexicalScopes.h?rev=137485&r1=137484&r2=137485&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LexicalScopes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LexicalScopes.h Fri Aug 12 13:10:19 2011
@@ -18,6 +18,7 @@
#define LLVM_CODEGEN_LEXICALSCOPES_H
#include "llvm/Metadata.h"
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
@@ -79,7 +80,7 @@
LexicalScope *findLexicalScope(DebugLoc DL);
/// getAbstractScopesList - Return a reference to list of abstract scopes.
- SmallVector<LexicalScope *, 4> &getAbstractScopesList() {
+ ArrayRef<LexicalScope *> getAbstractScopesList() const {
return AbstractScopesList;
}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=137485&r1=137484&r2=137485&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Aug 12 13:10:19 2011
@@ -1680,10 +1680,10 @@
collectVariableInfo(MF, ProcessedVars);
// Construct abstract scopes.
- SmallVector<LexicalScope *, 4> &AList = LScopes.getAbstractScopesList();
- for (SmallVector<LexicalScope *, 4>::iterator AI = AList.begin(),
- AE = AList.end(); AI != AE; ++AI) {
- DISubprogram SP((*AI)->getScopeNode());
+ ArrayRef<LexicalScope *> AList = LScopes.getAbstractScopesList();
+ for (unsigned i = 0, e = AList.size(); i != e; ++i) {
+ LexicalScope *AScope = AList[i];
+ DISubprogram SP(AScope->getScopeNode());
if (SP.Verify()) {
// Collect info for variables that were optimized out.
StringRef FName = SP.getLinkageName();
@@ -1700,8 +1700,8 @@
}
}
}
- if (ProcessedSPNodes.count((*AI)->getScopeNode()) == 0)
- constructScopeDIE(*AI);
+ if (ProcessedSPNodes.count(AScope->getScopeNode()) == 0)
+ constructScopeDIE(AScope);
}
DIE *CurFnDIE = constructScopeDIE(LScopes.getCurrentFunctionScope());
More information about the llvm-commits
mailing list