summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorMomchil Velikov <momchil.velikov@arm.com>2018-02-07 19:57:04 +0000
committerMomchil Velikov <momchil.velikov@arm.com>2018-02-07 19:57:04 +0000
commitcd0ac251240ba430459cc2bbdf989bdaa6af8cd9 (patch)
treed5ef36eb278451bf71b5c16387b8aac5a0b81d39 /clang/lib/CodeGen
parent46163786e5bd6b48838fc624dbf372a343c3cd68 (diff)
downloadbcm5719-llvm-cd0ac251240ba430459cc2bbdf989bdaa6af8cd9.tar.gz
bcm5719-llvm-cd0ac251240ba430459cc2bbdf989bdaa6af8cd9.zip
Revert [DebugInfo] Improvements to representation of enumeration types (PR36168)"
Revert due to breaking buildbots (LLDB tests) llvm-svn: 324508
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 9d12130376f..e766ccc203b 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -2492,12 +2492,9 @@ llvm::DIType *CGDebugInfo::CreateTypeDefinition(const EnumType *Ty) {
// Create elements for each enumerator.
SmallVector<llvm::Metadata *, 16> Enumerators;
ED = ED->getDefinition();
- bool IsSigned = ED->getIntegerType()->isSignedIntegerType();
for (const auto *Enum : ED->enumerators()) {
- const auto &InitVal = Enum->getInitVal();
- auto Value = IsSigned ? InitVal.getSExtValue() : InitVal.getZExtValue();
- Enumerators.push_back(
- DBuilder.createEnumerator(Enum->getName(), Value, !IsSigned));
+ Enumerators.push_back(DBuilder.createEnumerator(
+ Enum->getName(), Enum->getInitVal().getSExtValue()));
}
// Return a CompositeType for the enum itself.
@@ -2506,10 +2503,11 @@ llvm::DIType *CGDebugInfo::CreateTypeDefinition(const EnumType *Ty) {
llvm::DIFile *DefUnit = getOrCreateFile(ED->getLocation());
unsigned Line = getLineNumber(ED->getLocation());
llvm::DIScope *EnumContext = getDeclContextDescriptor(ED);
- llvm::DIType *ClassTy = getOrCreateType(ED->getIntegerType(), DefUnit);
+ llvm::DIType *ClassTy =
+ ED->isFixed() ? getOrCreateType(ED->getIntegerType(), DefUnit) : nullptr;
return DBuilder.createEnumerationType(EnumContext, ED->getName(), DefUnit,
Line, Size, Align, EltArray, ClassTy,
- FullName, ED->isFixed());
+ FullName);
}
llvm::DIMacro *CGDebugInfo::CreateMacro(llvm::DIMacroFile *Parent,
OpenPOWER on IntegriCloud