From: Sam McCall Date: Thu, 19 May 2022 06:18:34 +0000 (+0200) Subject: [pseudo] Squash some warnings. NFC X-Git-Tag: upstream/15.0.7~7278 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd387e43bf89438a83352d47e3d33bc34b697761;p=platform%2Fupstream%2Fllvm.git [pseudo] Squash some warnings. NFC Explicitly sizing Kind enum suggests that too-large values are allowed, and that putting it in a bitfield is dangerous. GCC doesn't like condition ? integer : enum. --- diff --git a/clang-tools-extra/pseudo/include/clang-pseudo/Forest.h b/clang-tools-extra/pseudo/include/clang-pseudo/Forest.h index 39b3559..c699c4c 100644 --- a/clang-tools-extra/pseudo/include/clang-pseudo/Forest.h +++ b/clang-tools-extra/pseudo/include/clang-pseudo/Forest.h @@ -43,7 +43,7 @@ namespace pseudo { // doesn't have parent pointers. class alignas(class ForestNode *) ForestNode { public: - enum Kind : uint8_t { + enum Kind { // A Terminal node is a single terminal symbol bound to a token. Terminal, // A Sequence node is a nonterminal symbol parsed from a grammar rule, diff --git a/clang-tools-extra/pseudo/lib/LRTable.cpp b/clang-tools-extra/pseudo/lib/LRTable.cpp index 34e7fce..745ad44b 100644 --- a/clang-tools-extra/pseudo/lib/LRTable.cpp +++ b/clang-tools-extra/pseudo/lib/LRTable.cpp @@ -97,7 +97,7 @@ LRTable::StateID LRTable::getGoToState(StateID State, } llvm::ArrayRef LRTable::find(StateID Src, SymbolID ID) const { - size_t Idx = isToken(ID) ? symbolToToken(ID) : ID; + size_t Idx = isToken(ID) ? static_cast(symbolToToken(ID)) : ID; assert(isToken(ID) ? Idx + 1 < TerminalOffset.size() : Idx + 1 < NontermOffset.size()); std::pair TargetStateRange =