summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2010-06-17 00:31:36 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2010-06-17 00:31:36 +0000
commiteba8f1893b5d8b115fc4d537cddf02f1a9269dda (patch)
tree3809907dbc8b86973929558b22c440d12f9d8593 /utils
parente3f647360c5ac01c54441c98d21350c8801a7785 (diff)
downloadllvm-eba8f1893b5d8b115fc4d537cddf02f1a9269dda.tar.gz
llvm-eba8f1893b5d8b115fc4d537cddf02f1a9269dda.tar.bz2
llvm-eba8f1893b5d8b115fc4d537cddf02f1a9269dda.tar.xz
For a tablegen expression such as !if(a,b,c), let 'a'
be evaluated for 'bit' operators git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106185 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/Record.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp
index d9c5dd30e1..53a4abdaf2 100644
--- a/utils/TableGen/Record.cpp
+++ b/utils/TableGen/Record.cpp
@@ -981,7 +981,8 @@ Init *TernOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) {
}
case IF: {
- IntInit *LHSi = dynamic_cast<IntInit*>(LHS);
+ IntInit *LHSi =
+ dynamic_cast<IntInit*>(LHS->convertInitializerTo(new IntRecTy()));
if (LHSi) {
if (LHSi->getValue()) {
return MHS;
@@ -1000,7 +1001,8 @@ Init *TernOpInit::resolveReferences(Record &R, const RecordVal *RV) {
Init *lhs = LHS->resolveReferences(R, RV);
if (Opc == IF && lhs != LHS) {
- IntInit *Value = dynamic_cast<IntInit*>(lhs);
+ IntInit *Value =
+ dynamic_cast<IntInit*>(LHS->convertInitializerTo(new IntRecTy()));
if (Value != 0) {
// Short-circuit
if (Value->getValue()) {