aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index d93bccd2ff..67c60aae07 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -289,10 +289,11 @@ llvm::DIType CGDebugInfo::CreateType(const EnumType *Ty,
llvm::SmallVector<llvm::DIDescriptor, 32> Enumerators;
// Create DIEnumerator elements for each enumerator.
- for (EnumConstantDecl *Elt = Decl->getEnumConstantList(); Elt;
- Elt = dyn_cast_or_null<EnumConstantDecl>(Elt->getNextDeclarator())) {
- Enumerators.push_back(DebugFactory.CreateEnumerator(Elt->getNameAsString(),
- Elt->getInitVal().getZExtValue()));
+ for (EnumDecl::enumerator_iterator Enum = Decl->enumerator_begin(),
+ EnumEnd = Decl->enumerator_end();
+ Enum != EnumEnd; ++Enum) {
+ Enumerators.push_back(DebugFactory.CreateEnumerator(Enum->getNameAsString(),
+ Enum->getInitVal().getZExtValue()));
}
// Return a CompositeType for the enum itself.