From 8090285d42f95bb28f06976718a1a6539dd0f7ec Mon Sep 17 00:00:00 2001 From: Vsevolod Livinskiy Date: Fri, 13 Feb 2015 21:39:18 +0300 Subject: [PATCH] Fix for cast --- cbackend.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cbackend.cpp b/cbackend.cpp index fcf3c28e..8a26b4dc 100644 --- a/cbackend.cpp +++ b/cbackend.cpp @@ -185,13 +185,22 @@ namespace { // Incorporate the type of the instruction and all its operands. incorporateType(I.getType()); + if (llvm::isa(&I)) + if (llvm::IntegerType *ITy = llvm::dyn_cast(I.getType())) { + IntegerTypes.push_back(ITy); + const llvm::StoreInst *St = llvm::dyn_cast(&I); + IsVolatile.push_back(St->isVolatile()); + Alignment.push_back(St->getAlignment()); + } + if (llvm::isa(&I)) if (llvm::IntegerType *ITy = llvm::dyn_cast(I.getType())) { IntegerTypes.push_back(ITy); -// llvm::StoreInst St = llvm::dyn_cast(I); -// IsVolatile.push_back(St.isVolatile()); -// Alignment.push_back(St.getAlignment()); + const llvm::LoadInst *St = llvm::dyn_cast(&I); + IsVolatile.push_back(St->isVolatile()); + Alignment.push_back(St->getAlignment()); } + for (llvm::User::const_op_iterator OI = I.op_begin(), OE = I.op_end(); OI != OE; ++OI) incorporateValue(*OI);