[lldb] Negate is_signed
variable for argument isUnsigned
in TypeSystemClang.cpp (#120794)
This commit is contained in:
parent
5f98dd5dd5
commit
92f439c4b7
@ -8534,7 +8534,7 @@ clang::EnumConstantDecl *TypeSystemClang::AddEnumerationValueToEnumerationType(
|
||||
bool is_signed = false;
|
||||
underlying_type.IsIntegerType(is_signed);
|
||||
|
||||
llvm::APSInt value(enum_value_bit_size, is_signed);
|
||||
llvm::APSInt value(enum_value_bit_size, !is_signed);
|
||||
value = enum_value;
|
||||
|
||||
return AddEnumerationValueToEnumerationType(enum_type, decl, name, value);
|
||||
|
@ -313,6 +313,16 @@ TEST_F(TestTypeSystemClang, TestGetEnumIntegerTypeBasicTypes) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(TestTypeSystemClang, TestEnumerationValueSign) {
|
||||
CompilerType enum_type = m_ast->CreateEnumerationType(
|
||||
"my_enum_signed", m_ast->GetTranslationUnitDecl(),
|
||||
OptionalClangModuleID(), Declaration(),
|
||||
m_ast->GetBasicType(lldb::eBasicTypeSignedChar), false);
|
||||
auto *enum_decl = m_ast->AddEnumerationValueToEnumerationType(
|
||||
enum_type, Declaration(), "minus_one", -1, 8);
|
||||
EXPECT_TRUE(enum_decl->getInitVal().isSigned());
|
||||
}
|
||||
|
||||
TEST_F(TestTypeSystemClang, TestOwningModule) {
|
||||
auto holder =
|
||||
std::make_unique<clang_utils::TypeSystemClangHolder>("module_ast");
|
||||
|
Loading…
x
Reference in New Issue
Block a user