diff --git a/src/mapleall/maple_ir/include/keywords.def b/src/mapleall/maple_ir/include/keywords.def index 69244cf8d256e0f9dc9a963875015181c9bf1e37..737d37a490ba3b7ce4f06895fa2b81c6ad2fbd9e 100644 --- a/src/mapleall/maple_ir/include/keywords.def +++ b/src/mapleall/maple_ir/include/keywords.def @@ -32,8 +32,6 @@ KEYWORD(tempvar) KEYWORD(reg) KEYWORD(type) - KEYWORD(enumeration) - KEYWORD(typedef) KEYWORD(func) KEYWORD(struct) KEYWORD(structincomplete) @@ -96,9 +94,11 @@ KEYWORD(importpath) // source position information KEYWORD(LOC) - // scope and source var to mpl var mapping + // dwarf related KEYWORD(SCOPE) KEYWORD(ALIAS) + KEYWORD(ENUMERATION) + KEYWORD(TYPEDEF) // storage class KEYWORD(pstatic) KEYWORD(fstatic) diff --git a/src/mapleall/maple_ir/src/global_tables.cpp b/src/mapleall/maple_ir/src/global_tables.cpp index d0d9e086d179a5e198fb3df1d936f15680bf221b..0cf09309596d166e292e55bcbeb3cef77968c97c 100644 --- a/src/mapleall/maple_ir/src/global_tables.cpp +++ b/src/mapleall/maple_ir/src/global_tables.cpp @@ -490,7 +490,7 @@ void TypedefTable::Dump() const { const std::string name = GlobalTables::GetStrTable().GetStringFromStrIdx(it->first); MIRType *underlyingType = GlobalTables::GetTypeTable().GetTypeFromTyIdx(it->second); CHECK_NULL_FATAL(underlyingType); - LogInfo::MapleLogger() << "typedef $" << name << " "; + LogInfo::MapleLogger() << "TYPEDEF $" << name << " "; underlyingType->Dump(1); LogInfo::MapleLogger() << "\n"; } diff --git a/src/mapleall/maple_ir/src/mir_enum.cpp b/src/mapleall/maple_ir/src/mir_enum.cpp index da5cfb0f839fab1d2d337a56e96502a6893370a7..2fc4bb915d9bc1ba609bef6eed050a19bc08d6c3 100644 --- a/src/mapleall/maple_ir/src/mir_enum.cpp +++ b/src/mapleall/maple_ir/src/mir_enum.cpp @@ -18,7 +18,7 @@ #include "mir_enum.h" // The syntax of enumerated type in Maple IR is: -// enumeration { = , ... } +// ENUMERATION { = , ... } // If '=' is not specified, will adopt the last value plus 1. // The default starting is 0. @@ -29,7 +29,7 @@ const std::string &MIREnum::GetName() const { } void MIREnum::Dump() const { - LogInfo::MapleLogger() << "enumeration $" << GetName() << " " << GetPrimTypeName(primType) << " {"; + LogInfo::MapleLogger() << "ENUMERATION $" << GetName() << " " << GetPrimTypeName(primType) << " {"; if (elements.empty()) { LogInfo::MapleLogger() << " }\n"; return; diff --git a/src/mapleall/maple_ir/src/parser.cpp b/src/mapleall/maple_ir/src/parser.cpp index 9591537863b10c5feb7cb8db7e92efda44fb73a5..21843f0bf4c110d3813b499e1c586732dc7d7de8 100644 --- a/src/mapleall/maple_ir/src/parser.cpp +++ b/src/mapleall/maple_ir/src/parser.cpp @@ -1699,7 +1699,7 @@ bool MIRParser::ParseTypeDefine() { } bool MIRParser::ParseEnumeration() { - if (lexer.GetTokenKind() != TK_enumeration) { + if (lexer.GetTokenKind() != TK_ENUMERATION) { Error("expect enum but get "); return false; } @@ -1775,7 +1775,7 @@ bool MIRParser::ParseEnumeration() { // for debuginfo parsing c typedef bool MIRParser::ParseTypedef() { - if (lexer.GetTokenKind() != TK_typedef) { + if (lexer.GetTokenKind() != TK_TYPEDEF) { Error("expect typedef but get "); return false; } @@ -2893,8 +2893,6 @@ std::map MIRParser::InitFuncPtrMap funcPtrMap[TK_javaclass] = &MIRParser::ParseMIRForClass; funcPtrMap[TK_javainterface] = &MIRParser::ParseMIRForInterface; funcPtrMap[TK_type] = &MIRParser::ParseTypeDefine; - funcPtrMap[TK_enumeration] = &MIRParser::ParseEnumeration; - funcPtrMap[TK_typedef] = &MIRParser::ParseTypedef; funcPtrMap[TK_flavor] = &MIRParser::ParseMIRForFlavor; funcPtrMap[TK_srclang] = &MIRParser::ParseMIRForSrcLang; funcPtrMap[TK_globalmemsize] = &MIRParser::ParseMIRForGlobalMemSize; @@ -2913,6 +2911,8 @@ std::map MIRParser::InitFuncPtrMap funcPtrMap[TK_LOC] = &MIRParser::ParseLoc; funcPtrMap[TK_ALIAS] = &MIRParser::ParseAlias; funcPtrMap[TK_SCOPE] = &MIRParser::ParseScope; + funcPtrMap[TK_ENUMERATION] = &MIRParser::ParseEnumeration; + funcPtrMap[TK_TYPEDEF] = &MIRParser::ParseTypedef; return funcPtrMap; }