mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
Fix the handling of !if result, avoiding null results for non 'int'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106201 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c73993b678
commit
477bf62048
@ -981,8 +981,9 @@ Init *TernOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) {
|
||||
}
|
||||
|
||||
case IF: {
|
||||
IntInit *LHSi =
|
||||
dynamic_cast<IntInit*>(LHS->convertInitializerTo(new IntRecTy()));
|
||||
IntInit *LHSi = dynamic_cast<IntInit*>(LHS);
|
||||
if (Init *I = LHS->convertInitializerTo(new IntRecTy()))
|
||||
LHSi = dynamic_cast<IntInit*>(I);
|
||||
if (LHSi) {
|
||||
if (LHSi->getValue()) {
|
||||
return MHS;
|
||||
@ -1001,8 +1002,9 @@ 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->convertInitializerTo(new IntRecTy()));
|
||||
IntInit *Value = dynamic_cast<IntInit*>(lhs);
|
||||
if (Init *I = lhs->convertInitializerTo(new IntRecTy()))
|
||||
Value = dynamic_cast<IntInit*>(I);
|
||||
if (Value != 0) {
|
||||
// Short-circuit
|
||||
if (Value->getValue()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user