summaryrefslogtreecommitdiff
path: root/lib/TableGen/TGParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/TableGen/TGParser.cpp')
-rw-r--r--lib/TableGen/TGParser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/TableGen/TGParser.cpp b/lib/TableGen/TGParser.cpp
index 17f0abc974..e5875ad795 100644
--- a/lib/TableGen/TGParser.cpp
+++ b/lib/TableGen/TGParser.cpp
@@ -2406,7 +2406,11 @@ bool TGParser::ParseDefm(MultiClass *CurMultiClass) {
Init *DefmPrefix = 0;
- if (Lex.Lex() == tgtok::Id) { // eat the defm.
+ Lex.Lex(); // eat the defm.
+
+ // Note that tgtok::paste is here to allow starting with #NAME.
+ if (Lex.getCode() == tgtok::Id ||
+ Lex.getCode() == tgtok::paste) {
DefmPrefix = ParseObjectName(CurMultiClass);
}