summaryrefslogtreecommitdiffstats
path: root/lldb/source/Symbol/ClangASTContext.cpp
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2019-10-08 17:59:02 +0000
committerFrederic Riss <friss@apple.com>2019-10-08 17:59:02 +0000
commit5d415b706f678108fa7f5dca7ade588cd8da24eb (patch)
tree485ee30af66501d2092cc72cb7bb8f37555551cc /lldb/source/Symbol/ClangASTContext.cpp
parent085328eeeeba63ab3ef2d59f1bb8fa83ca069d33 (diff)
downloadbcm5719-llvm-5d415b706f678108fa7f5dca7ade588cd8da24eb.tar.gz
bcm5719-llvm-5d415b706f678108fa7f5dca7ade588cd8da24eb.zip
Fix sign extension handling in DumpEnumValue
When an enumerator has an unsigned type and its high bit set, the code introduced in r374067 would fail to match it due to a sign extension snafu. This commit fixes this aspec of the code and should fix the bots. I think it's not a complete fix though, I'll add more test coverage and additional tweaks in a follow-up commit. llvm-svn: 374095
Diffstat (limited to 'lldb/source/Symbol/ClangASTContext.cpp')
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 6b82831dfe7..038b1f316d6 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -9374,6 +9374,7 @@ static bool DumpEnumValue(const clang::QualType &qual_type, Stream *s,
// flags.
for (auto enumerator : enum_decl->enumerators()) {
uint64_t val = enumerator->getInitVal().getSExtValue();
+ val = llvm::SignExtend64(val, 8*byte_size);
if (llvm::countPopulation(val) != 1 && (val & ~covered_bits) != 0)
can_be_bitfield = false;
covered_bits |= val;
OpenPOWER on IntegriCloud