summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index 730d336ce94..3394afca6e2 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -2566,10 +2566,12 @@ TreePatternNodePtr TreePattern::ParseTreePattern(Init *TheInit,
return Res;
}
- if (IntInit *II = dyn_cast<IntInit>(TheInit)) {
+ if (isa<IntInit>(TheInit) || isa<BitInit>(TheInit)) {
if (!OpName.empty())
- error("Constant int argument should not have a name!");
- return std::make_shared<TreePatternNode>(II, 1);
+ error("Constant int or bit argument should not have a name!");
+ if (isa<BitInit>(TheInit))
+ TheInit = TheInit->convertInitializerTo(IntRecTy::get());
+ return std::make_shared<TreePatternNode>(TheInit, 1);
}
if (BitsInit *BI = dyn_cast<BitsInit>(TheInit)) {
OpenPOWER on IntegriCloud