Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
shaobo-he committed Mar 29, 2022
1 parent 4e8ec19 commit 2452feb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions lib/smack/AddTiming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,14 @@ InstructionCost AddTiming::getInstructionCost(const Instruction *I) const {
case Instruction::Select: {
const SelectInst *SI = cast<SelectInst>(I);
Type *CondTy = SI->getCondition()->getType();
return TTI->getCmpSelInstrCost(I->getOpcode(), I->getType(), CondTy, CmpInst::BAD_ICMP_PREDICATE);
return TTI->getCmpSelInstrCost(I->getOpcode(), I->getType(), CondTy,
CmpInst::BAD_ICMP_PREDICATE);
}
case Instruction::ICmp:
case Instruction::FCmp: {
Type *ValTy = I->getOperand(0)->getType();
return TTI->getCmpSelInstrCost(I->getOpcode(), ValTy, nullptr, CmpInst::BAD_ICMP_PREDICATE);
return TTI->getCmpSelInstrCost(I->getOpcode(), ValTy, nullptr,
CmpInst::BAD_ICMP_PREDICATE);
}
case Instruction::Store: {
const StoreInst *SI = cast<StoreInst>(I);
Expand Down
5 changes: 4 additions & 1 deletion lib/smack/CodifyStaticInits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ bool CodifyStaticInits::runOnModule(Module &M) {
if (V->getType()->isIntegerTy() || V->getType()->isPointerTy() ||
V->getType()->isFloatingPointTy() || V->getType()->isVectorTy())

IRB.CreateStore(V, IRB.CreateGEP(P->getType()->getScalarType()->getPointerElementType(), P, ArrayRef<Value *>(I)));
IRB.CreateStore(
V,
IRB.CreateGEP(P->getType()->getScalarType()->getPointerElementType(),
P, ArrayRef<Value *>(I)));

else if (ArrayType *AT = dyn_cast<ArrayType>(V->getType()))
for (unsigned i = AT->getNumElements(); i-- > 0;) {
Expand Down
1 change: 0 additions & 1 deletion lib/smack/ExtractContracts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// This file is distributed under the MIT License. See LICENSE for details.
//


#include "smack/ExtractContracts.h"
#include "smack/Debug.h"
#include "smack/Naming.h"
Expand Down
4 changes: 3 additions & 1 deletion lib/smack/SplitAggregateValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ Value *SplitAggregateValue::splitAggregateLoad(Type *T, Value *P,
IndexT idxs = std::get<0>(e);
Value *p = irb.CreateGEP(T, P, ArrayRef<Value *>(getFirsts(idxs)));
V = irb.CreateInsertValue(
V, irb.CreateLoad(p->getType()->getScalarType()->getPointerElementType(), p),
V,
irb.CreateLoad(p->getType()->getScalarType()->getPointerElementType(),
p),
ArrayRef<unsigned>(getSeconds(idxs)));
}
return V;
Expand Down

0 comments on commit 2452feb

Please sign in to comment.