summaryrefslogtreecommitdiff
path: root/lib/TableGen
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2012-12-27 06:32:52 +0000
committerCraig Topper <craig.topper@gmail.com>2012-12-27 06:32:52 +0000
commit025c5de9bac36e98340944e29fa316e53002e354 (patch)
tree38d3bf22153444b00a1c58cdc84e9a89b3236446 /lib/TableGen
parent87073aad8fca0663405c4318bf70794e149342ab (diff)
downloadllvm-025c5de9bac36e98340944e29fa316e53002e354.tar.gz
llvm-025c5de9bac36e98340944e29fa316e53002e354.tar.bz2
llvm-025c5de9bac36e98340944e29fa316e53002e354.tar.xz
Update tablegen parser to allow defm names to start with #NAME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171140 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/TableGen')
-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);
}