Skip to content

Commit 1ba4273

Browse files
committed
Fixed formatting since we updated clang-format
1 parent 0b1fdf9 commit 1ba4273

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+399
-385
lines changed

include/smack/BoogieAst.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,6 @@ std::ostream &operator<<(std::ostream &os, const Expr *e);
680680

681681
std::ostream &operator<<(std::ostream &os, Decl &e);
682682
std::ostream &operator<<(std::ostream &os, Decl *e);
683-
}
683+
} // namespace smack
684684

685685
#endif // BOOGIEAST_H

include/smack/BplFilePrinter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ class BplFilePrinter : public llvm::ModulePass {
2323

2424
virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const;
2525
};
26-
}
26+
} // namespace smack
2727

2828
#endif // BPLPRINTER_H

include/smack/BplPrinter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ class BplPrinter : public llvm::ModulePass {
1717
virtual bool runOnModule(llvm::Module &m);
1818
virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const;
1919
};
20-
}
20+
} // namespace smack
2121

2222
#endif // BPLPRINTER_H

include/smack/CodifyStaticInits.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ class CodifyStaticInits : public llvm::ModulePass {
2020
virtual bool runOnModule(llvm::Module &M);
2121
virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const;
2222
};
23-
}
23+
} // namespace smack

include/smack/Contracts.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ class ContractsExtractor : public InstVisitor<ContractsExtractor> {
3333
return ConstantInt::get(Type::getInt32Ty(ctx), slices.size());
3434
}
3535
};
36-
}
36+
} // namespace smack

include/smack/DSAWrapper.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class DSGraph;
1717
class TDDataStructures;
1818
class BUDataStructures;
1919
class DSNodeEquivs;
20-
}
20+
} // namespace llvm
2121

2222
namespace dsa {
2323
template <class dsa> struct TypeSafety;
@@ -74,6 +74,6 @@ class DSAWrapper : public llvm::ModulePass {
7474
const llvm::DSNode *getNode(const llvm::Value *v);
7575
void printDSAGraphs(const char *Filename);
7676
};
77-
}
77+
} // namespace smack
7878

7979
#endif // DSAWRAPPER_H

include/smack/ExtractContracts.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ class ExtractContracts : public ModulePass {
1616
virtual bool runOnModule(Module &M);
1717
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
1818
};
19-
}
19+
} // namespace smack

include/smack/IntegerOverflowChecker.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ class IntegerOverflowChecker : public llvm::ModulePass {
3232
void addBlockingAssume(llvm::Function *va, llvm::Value *flag,
3333
llvm::Instruction *i);
3434
};
35-
}
35+
} // namespace smack
3636

3737
#endif // INTEGEROVERFLOWCHECKER_H

include/smack/MemorySafetyChecker.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ class MemorySafetyChecker : public llvm::FunctionPass,
3535
void visitMemSetInst(llvm::MemSetInst &I);
3636
void visitMemTransferInst(llvm::MemTransferInst &I);
3737
};
38-
}
38+
} // namespace smack
3939

4040
#endif // MEMORYSAFETYCHECKER_H

include/smack/Naming.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,6 @@ class Naming {
116116
static bool isSmackGeneratedName(std::string s);
117117
static std::string escape(std::string s);
118118
};
119-
}
119+
} // namespace smack
120120

121121
#endif

include/smack/NormalizeLoops.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ class NormalizeLoops : public llvm::ModulePass {
1919
virtual bool runOnModule(llvm::Module &m) override;
2020
virtual void getAnalysisUsage(llvm::AnalysisUsage &) const override;
2121
};
22-
}
22+
} // namespace smack
2323

2424
#endif // NORMALIZELOOPS_H

include/smack/Prelude.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,6 @@ class Prelude {
215215
FuncDecl *unsafeStore(Binding elemBinding, const Expr *body,
216216
bool bytes = true);
217217
};
218-
}
218+
} // namespace smack
219219

220220
#endif // PRELUDE_H

include/smack/Regions.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,6 @@ class Regions : public ModulePass, public InstVisitor<Regions> {
9292
void visitMemIntrinsic(MemIntrinsic &);
9393
void visitCallInst(CallInst &);
9494
};
95-
}
95+
} // namespace smack
9696

9797
#endif // REGIONS_H

include/smack/RemoveDeadDefs.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ class RemoveDeadDefs : public llvm::ModulePass {
1818
RemoveDeadDefs() : llvm::ModulePass(ID) {}
1919
virtual bool runOnModule(llvm::Module &M);
2020
};
21-
}
21+
} // namespace smack

include/smack/SimplifyLibCalls.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ class SimplifyLibCalls : public ModulePass,
2525
virtual bool runOnModule(Module &M);
2626
void visitCallInst(CallInst &);
2727
};
28-
}
28+
} // namespace smack

include/smack/Slicing.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ class Slice {
4040
const Decl *getBoogieDecl(Naming *naming, SmackRep *rep);
4141
const Expr *getBoogieExpression(Naming *naming, SmackRep *rep);
4242
};
43-
}
43+
} // namespace smack
4444

4545
#endif

include/smack/SmackInstGenerator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ class SmackInstGenerator : public llvm::InstVisitor<SmackInstGenerator> {
9898
void visitMemSetInst(llvm::MemSetInst &i);
9999
void visitIntrinsicInst(llvm::IntrinsicInst &i);
100100
};
101-
}
101+
} // namespace smack
102102

103103
#endif // SMACKINSTVISITOR_H

include/smack/SmackModuleGenerator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ class SmackModuleGenerator : public llvm::ModulePass {
2323
void generateProgram(llvm::Module &m);
2424
Program *getProgram() { return program; }
2525
};
26-
}
26+
} // namespace smack
2727

2828
#endif // SMACKMODULEGENERATOR_H

include/smack/SmackOptions.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ class SmackOptions {
3232

3333
static bool isEntryPoint(std::string);
3434
};
35-
}
35+
} // namespace smack
3636

3737
#endif // SMACKREP_H

include/smack/SmackRep.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,6 @@ class SmackRep {
197197
std::string opName(const std::string &operation,
198198
std::list<const llvm::Type *> types);
199199
};
200-
}
200+
} // namespace smack
201201

202202
#endif // SMACKREP_H

include/smack/SmackWarnings.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ class SmackWarnings {
5050
static bool isSufficientWarningLevel(WarningLevel level);
5151
static std::string getFlagStr(UnsetFlagsT flags);
5252
};
53-
}
53+
} // namespace smack
5454

5555
#endif // SMACKWARNINGS_H

include/smack/SplitAggregateValue.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ class SplitAggregateValue : public llvm::BasicBlockPass {
3636
std::vector<InfoT> &info, llvm::Value *V);
3737
bool isConstantAggregate(llvm::Value *V);
3838
};
39-
}
39+
} // namespace smack

include/smack/VectorOperations.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ class VectorOperations {
4141
FuncDecl *load(const Value *V);
4242
FuncDecl *store(const Value *V);
4343
};
44-
}
44+
} // namespace smack
4545

4646
#endif // VECTOROPERATIONS_H

include/smack/VerifierCodeMetadata.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ class VerifierCodeMetadata : public ModulePass,
2626
void visitInstruction(Instruction &);
2727
static bool isMarked(const Instruction &I);
2828
};
29-
}
29+
} // namespace smack

lib/smack/BoogieAst.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -685,4 +685,4 @@ void Program::print(std::ostream &os) const {
685685
print_seq<Decl *>(os, decls, "\n");
686686
os << "\n";
687687
}
688-
}
688+
} // namespace smack

lib/smack/BplFilePrinter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ bool BplFilePrinter::runOnModule(llvm::Module &m) {
2828
// DEBUG_WITH_TYPE("bpl", errs() << "" << s.str());
2929
return false;
3030
}
31-
}
31+
} // namespace smack

lib/smack/BplPrinter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ bool BplPrinter::runOnModule(llvm::Module &m) {
2828
DEBUG_WITH_TYPE("bpl", errs() << "" << s.str());
2929
return false;
3030
}
31-
}
31+
} // namespace smack

lib/smack/CodifyStaticInits.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ bool CodifyStaticInits::runOnModule(Module &M) {
2828
LLVMContext &C = M.getContext();
2929
DSAWrapper *DSA = &getAnalysis<DSAWrapper>();
3030

31-
Function *F = dyn_cast<Function>(M.getOrInsertFunction(
32-
Naming::STATIC_INIT_PROC, Type::getVoidTy(C)));
31+
Function *F = dyn_cast<Function>(
32+
M.getOrInsertFunction(Naming::STATIC_INIT_PROC, Type::getVoidTy(C)));
3333

3434
BasicBlock *B = BasicBlock::Create(C, "entry", F);
3535
IRBuilder<> IRB(B);
@@ -101,4 +101,4 @@ char CodifyStaticInits::ID = 0;
101101
// Register the pass
102102
static RegisterPass<CodifyStaticInits> X("codify-static-inits",
103103
"Codify Static Initializers");
104-
}
104+
} // namespace smack

lib/smack/Contracts.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@ void ContractsExtractor::visitCallInst(CallInst &ci) {
9393
head->getInstList().insert(I, &ci);
9494
}
9595
}
96-
}
96+
} // namespace smack

lib/smack/Debug.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void setCurrentDebugTypes(const char **Types, unsigned Count) {
3636
for (size_t T = 0; T < Count; ++T)
3737
CurrentDebugType->push_back(Types[T]);
3838
}
39-
}
39+
} // namespace smack
4040

4141
#ifndef NDEBUG
4242

@@ -57,13 +57,14 @@ struct DebugOnlyOpt {
5757
CurrentDebugType->push_back(dbgType);
5858
}
5959
};
60-
}
60+
} // namespace
6161

6262
static DebugOnlyOpt DebugOnlyOptLoc;
6363

6464
static ::llvm::cl::opt<DebugOnlyOpt, true, cl::parser<std::string>>
65-
DebugOnly("debug-only", cl::desc("Enable a specific type of debug output "
66-
"(comma separated list of types)"),
65+
DebugOnly("debug-only",
66+
cl::desc("Enable a specific type of debug output "
67+
"(comma separated list of types)"),
6768
cl::Hidden, cl::ZeroOrMore, cl::value_desc("debug string"),
6869
cl::location(DebugOnlyOptLoc), cl::ValueRequired);
6970

@@ -80,6 +81,6 @@ raw_ostream &smack::dbgs() {
8081
#else
8182
namespace smack {
8283
raw_ostream &dbgs() { return llvm::errs(); }
83-
}
84+
} // namespace smack
8485

8586
#endif

lib/smack/ExtractContracts.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ std::vector<std::tuple<Function *, Function *>> getContractExprs(Function &F) {
204204
}
205205
return Fs;
206206
}
207-
}
207+
} // namespace
208208

209209
bool ExtractContracts::runOnModule(Module &M) {
210210
bool modified = false;
@@ -303,4 +303,4 @@ char ExtractContracts::ID = 0;
303303
// Register the pass
304304
static RegisterPass<ExtractContracts> X("extract-contracts",
305305
"Extract Contracts");
306-
}
306+
} // namespace smack

lib/smack/IntegerOverflowChecker.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,4 @@ char IntegerOverflowChecker::ID = 0;
222222
StringRef IntegerOverflowChecker::getPassName() const {
223223
return "Checked integer arithmetic intrinsics";
224224
}
225-
}
225+
} // namespace smack

lib/smack/MemorySafetyChecker.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Value *accessSizeAsPointer(StoreInst &I) {
9292
auto &M = *I.getParent()->getParent()->getParent();
9393
return accessSizeAsPointer(M, I.getPointerOperand());
9494
}
95-
}
95+
} // namespace
9696

9797
void MemorySafetyChecker::visitLoadInst(LoadInst &I) {
9898
insertMemoryAccessCheck(I.getPointerOperand(), accessSizeAsPointer(I), &I);
@@ -113,4 +113,4 @@ void MemorySafetyChecker::visitMemTransferInst(MemTransferInst &I) {
113113

114114
// Pass ID variable
115115
char MemorySafetyChecker::ID = 0;
116-
}
116+
} // namespace smack

lib/smack/Naming.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,4 @@ std::string Naming::freshVarName(const Value &V) {
267267
s << varNum++;
268268
return s.str();
269269
}
270-
}
270+
} // namespace smack

lib/smack/NormalizeLoops.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,4 @@ bool NormalizeLoops::runOnModule(Module &m) {
158158
char NormalizeLoops::ID = 0;
159159

160160
StringRef NormalizeLoops::getPassName() const { return "NormalizeLoops"; }
161-
}
161+
} // namespace smack

lib/smack/Prelude.cpp

+21-19
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,17 @@ void IntOpGen::generateArithOps(std::stringstream &s) const {
367367
const auto intBuiltinOp = new BuiltinOp<IntOp::attrT>(IntOp::intAttrFunc);
368368
const auto uninterpretedOp = new UninterpretedOp();
369369
const std::vector<IntOpGen::IntArithOp> intArithOpTable{
370-
{"add", 2, new InlinedOp<IntOp::exprT>(
371-
IntOpGen::IntArithOp::intArithExpr<BinExpr::Plus>),
370+
{"add", 2,
371+
new InlinedOp<IntOp::exprT>(
372+
IntOpGen::IntArithOp::intArithExpr<BinExpr::Plus>),
372373
bvBuiltinOp, true},
373-
{"sub", 2, new InlinedOp<IntOp::exprT>(
374-
IntOpGen::IntArithOp::intArithExpr<BinExpr::Minus>),
374+
{"sub", 2,
375+
new InlinedOp<IntOp::exprT>(
376+
IntOpGen::IntArithOp::intArithExpr<BinExpr::Minus>),
375377
bvBuiltinOp, true},
376-
{"mul", 2, new InlinedOp<IntOp::exprT>(
377-
IntOpGen::IntArithOp::intArithExpr<BinExpr::Times>),
378+
{"mul", 2,
379+
new InlinedOp<IntOp::exprT>(
380+
IntOpGen::IntArithOp::intArithExpr<BinExpr::Times>),
378381
bvBuiltinOp, true},
379382
{"sdiv", 2, intBuiltinOp, bvBuiltinOp, false},
380383
{"smod", 2, intBuiltinOp, bvBuiltinOp, false},
@@ -874,9 +877,9 @@ void MemDeclGen::generateGlobalAllocations(std::stringstream &s) const {
874877

875878
std::list<const Stmt *> stmts;
876879
for (auto E : prelude.rep.globalAllocations)
877-
stmts.push_back(Stmt::call(
878-
"$galloc",
879-
{prelude.rep.expr(E.first), prelude.rep.pointerLit(E.second)}));
880+
stmts.push_back(
881+
Stmt::call("$galloc", {prelude.rep.expr(E.first),
882+
prelude.rep.pointerLit(E.second)}));
880883
s << Decl::procedure("$global_allocations", {}, {}, {},
881884
{Block::block("", stmts)})
882885
<< "\n";
@@ -924,9 +927,8 @@ void PtrOpGen::generatePreds(std::stringstream &s) const {
924927
indexedName(pred, {Naming::PTR_TYPE}),
925928
{{"p1", Naming::PTR_TYPE}, {"p2", Naming::PTR_TYPE}},
926929
prelude.rep.intType(1),
927-
Expr::cond(Expr::fn(indexedName(pred,
928-
{prelude.rep.pointerType(),
929-
Naming::BOOL_TYPE}),
930+
Expr::cond(Expr::fn(indexedName(pred, {prelude.rep.pointerType(),
931+
Naming::BOOL_TYPE}),
930932
{Expr::id("p1"), Expr::id("p2")}),
931933
prelude.rep.integerLit(1LL, 1),
932934
prelude.rep.integerLit(0LL, 1)),
@@ -1449,9 +1451,10 @@ void FpOpGen::generateMemOps(std::stringstream &s) const {
14491451
// e.g., function {:inline} $load.unsafe.bvhalf(M: [ref] i8, p: ref)
14501452
// returns (bvhalf) { $bitcast.i16.bvhalf($load.i16(M, p)) }
14511453
s << prelude.unsafeLoad(
1452-
type, Expr::fn(indexedName("$bitcast", {intType, type}),
1453-
Expr::fn(indexedName("$load", {intType}),
1454-
makeMapVarExpr(0), makePtrVarExpr(0))),
1454+
type,
1455+
Expr::fn(indexedName("$bitcast", {intType, type}),
1456+
Expr::fn(indexedName("$load", {intType}),
1457+
makeMapVarExpr(0), makePtrVarExpr(0))),
14551458
false)
14561459
<< "\n";
14571460
// e.g., function {:inline} $store.unsafe.bvfloat(M: [ref] i8, p: ref,
@@ -1488,10 +1491,9 @@ void FpOpGen::generateMemOps(std::stringstream &s) const {
14881491
// function {:inline} $store.bytes.float(M: [ref] bv8, p: ref, f: float)
14891492
// returns ([ref] bv8) { M[p := $bitcast.float.bv8(f)] }
14901493
s << prelude.unsafeStore(
1491-
binding,
1492-
prelude.mapUpdExpr(
1493-
0, Expr::fn(indexedName("$bitcast", {type, bvType}),
1494-
makeFpVarExpr(0))))
1494+
binding, prelude.mapUpdExpr(
1495+
0, Expr::fn(indexedName("$bitcast", {type, bvType}),
1496+
makeFpVarExpr(0))))
14951497
<< "\n";
14961498
} else {
14971499
std::string intType = getIntTypeName(8);

0 commit comments

Comments
 (0)