summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/TGParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/TableGen/TGParser.cpp')
-rw-r--r--llvm/utils/TableGen/TGParser.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/llvm/utils/TableGen/TGParser.cpp b/llvm/utils/TableGen/TGParser.cpp
index b0389ddb729..188ba4d2b1b 100644
--- a/llvm/utils/TableGen/TGParser.cpp
+++ b/llvm/utils/TableGen/TGParser.cpp
@@ -17,8 +17,14 @@
#include <algorithm>
#include <sstream>
#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/CommandLine.h"
using namespace llvm;
+/// LLVMCHack - This is a temporary hack that changes how "(foo [1, 2, 3])"
+/// parses.
+/// FIXME: REMOVE THIS.
+static cl::opt<bool> LLVMCHack("llvmc-temp-hack", cl::ReallyHidden);
+
//===----------------------------------------------------------------------===//
// Support Code for the Semantic Actions.
//===----------------------------------------------------------------------===//
@@ -1213,11 +1219,18 @@ Init *TGParser::ParseSimpleValue(Record *CurRec, RecTy *ItemType) {
return 0;
}
- Init *Operator = 0;
- if (Lex.getCode() == tgtok::Id)
- Operator = ParseIDValue(CurRec);
- else
- Operator = ParseOperation(CurRec);
+ Init *Operator;
+ /// LLVMC Requires an old grammar and I don't know how to update it, placate
+ /// it in the short term by changing the grammar specifically for llvmc.
+ /// FIXME: REMOVE THIS.
+ if (!LLVMCHack)
+ Operator = ParseValue(CurRec);
+ else {
+ if (Lex.getCode() == tgtok::Id)
+ Operator = ParseIDValue(CurRec);
+ else
+ Operator = ParseOperation(CurRec);
+ }
if (Operator == 0) return 0;
// If the operator name is present, parse it.
OpenPOWER on IntegriCloud