summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/tools/llvm-rc/ResourceScriptParser.cpp4
-rw-r--r--llvm/tools/llvm-rc/ResourceScriptToken.cpp8
-rw-r--r--llvm/tools/llvm-rc/ResourceScriptToken.h6
-rw-r--r--llvm/tools/llvm-rc/ResourceScriptTokenList.def (renamed from llvm/tools/llvm-rc/ResourceScriptTokenList.h)3
-rw-r--r--llvm/tools/llvm-rc/llvm-rc.cpp4
5 files changed, 9 insertions, 16 deletions
diff --git a/llvm/tools/llvm-rc/ResourceScriptParser.cpp b/llvm/tools/llvm-rc/ResourceScriptParser.cpp
index 769b47a20bd..cf1579ee2a1 100644
--- a/llvm/tools/llvm-rc/ResourceScriptParser.cpp
+++ b/llvm/tools/llvm-rc/ResourceScriptParser.cpp
@@ -245,9 +245,7 @@ Error RCParser::consumeType(Kind TokenKind) {
#define SHORT_TOKEN(TokenName, TokenCh) \
case Kind::TokenName: \
return getExpectedError(#TokenCh);
-#include "ResourceScriptTokenList.h"
-#undef SHORT_TOKEN
-#undef TOKEN
+#include "ResourceScriptTokenList.def"
}
llvm_unreachable("All case options exhausted.");
diff --git a/llvm/tools/llvm-rc/ResourceScriptToken.cpp b/llvm/tools/llvm-rc/ResourceScriptToken.cpp
index 5a3473a4b08..7bbf0d16f04 100644
--- a/llvm/tools/llvm-rc/ResourceScriptToken.cpp
+++ b/llvm/tools/llvm-rc/ResourceScriptToken.cpp
@@ -212,9 +212,7 @@ Error Tokenizer::consumeToken(const Kind TokenKind) {
// One-character token consumption.
#define TOKEN(Name)
#define SHORT_TOKEN(Name, Ch) case Kind::Name:
-#include "ResourceScriptTokenList.h"
-#undef TOKEN
-#undef SHORT_TOKEN
+#include "ResourceScriptTokenList.def"
advance();
return Error::success();
@@ -340,9 +338,7 @@ Kind Tokenizer::classifyCurrentToken() const {
#define SHORT_TOKEN(Name, Ch) \
case Ch: \
return Kind::Name;
-#include "ResourceScriptTokenList.h"
-#undef TOKEN
-#undef SHORT_TOKEN
+#include "ResourceScriptTokenList.def"
default:
return Kind::Invalid;
diff --git a/llvm/tools/llvm-rc/ResourceScriptToken.h b/llvm/tools/llvm-rc/ResourceScriptToken.h
index af22fa8d3eb..0f108b50ed1 100644
--- a/llvm/tools/llvm-rc/ResourceScriptToken.h
+++ b/llvm/tools/llvm-rc/ResourceScriptToken.h
@@ -9,7 +9,7 @@
//
// This declares the .rc script tokens and defines an interface for tokenizing
// the input data. The list of available tokens is located at
-// ResourceScriptTokenList.h.
+// ResourceScriptTokenList.def.
//
// Note that the tokenizer does not support comments or preprocessor
// directives. The preprocessor should do its work on the .rc file before
@@ -47,9 +47,7 @@ public:
enum class Kind {
#define TOKEN(Name) Name,
#define SHORT_TOKEN(Name, Ch) Name,
-#include "ResourceScriptTokenList.h"
-#undef TOKEN
-#undef SHORT_TOKEN
+#include "ResourceScriptTokenList.def"
};
RCToken(RCToken::Kind RCTokenKind, StringRef Value);
diff --git a/llvm/tools/llvm-rc/ResourceScriptTokenList.h b/llvm/tools/llvm-rc/ResourceScriptTokenList.def
index 2a7e15f9332..085b728ff52 100644
--- a/llvm/tools/llvm-rc/ResourceScriptTokenList.h
+++ b/llvm/tools/llvm-rc/ResourceScriptTokenList.def
@@ -35,3 +35,6 @@ SHORT_TOKEN(Amp, '&') // Bitwise-AND operator.
SHORT_TOKEN(Tilde, '~') // Bitwise-NOT operator.
SHORT_TOKEN(LeftParen, '(') // Left parenthesis in the script expressions.
SHORT_TOKEN(RightParen, ')') // Right parenthesis.
+
+#undef TOKEN
+#undef SHORT_TOKEN
diff --git a/llvm/tools/llvm-rc/llvm-rc.cpp b/llvm/tools/llvm-rc/llvm-rc.cpp
index 2fab3440e1c..4a1f52e66de 100644
--- a/llvm/tools/llvm-rc/llvm-rc.cpp
+++ b/llvm/tools/llvm-rc/llvm-rc.cpp
@@ -124,9 +124,7 @@ int main(int argc_, const char *argv_[]) {
const Twine TokenNames[] = {
#define TOKEN(Name) #Name,
#define SHORT_TOKEN(Name, Ch) #Name,
-#include "ResourceScriptTokenList.h"
-#undef TOKEN
-#undef SHORT_TOKEN
+#include "ResourceScriptTokenList.def"
};
for (const RCToken &Token : Tokens) {
OpenPOWER on IntegriCloud