Skip to content

Commit

Permalink
style:
Browse files Browse the repository at this point in the history
  • Loading branch information
misonijnik committed Aug 13, 2024
1 parent a8d5677 commit 292a765
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 18 deletions.
4 changes: 3 additions & 1 deletion lib/Core/Executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5331,7 +5331,9 @@ void Executor::callExternalFunction(ExecutionState &state, KInstruction *target,
ae = arguments.end();
ai != ae; ++ai) {
if (ExternalCalls == ExternalCallPolicy::All ||
ExternalCalls == ExternalCallPolicy::OverApprox) { // don't bother checking uniqueness
ExternalCalls ==
ExternalCallPolicy::OverApprox) { // don't bother checking
// uniqueness
ref<Expr> arg = *ai;
if (auto pointer = dyn_cast<PointerExpr>(arg)) {
arg = pointer->getValue();
Expand Down
8 changes: 3 additions & 5 deletions lib/Module/InstrumentLegacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ void klee::checkModule(bool DontVerify, llvm::Module *module) {
}

void klee::optimiseAndPrepare(bool OptimiseKLEECall, bool Optimize,
bool Simplify,
bool WithFPRuntime, SwitchImplType SwitchType,
std::string EntryPoint,
bool Simplify, bool WithFPRuntime,
SwitchImplType SwitchType, std::string EntryPoint,
llvm::ArrayRef<const char *> preservedFunctions,
llvm::Module *module) {
// Preserve all functions containing klee-related function calls from being
Expand All @@ -107,8 +106,7 @@ void klee::optimiseAndPrepare(bool OptimiseKLEECall, bool Optimize,
if (WithFPRuntime) {
if (UseKleeFloatInternals) {
for (const auto &p : klee::floatReplacements) {
replaceOrRenameFunction(module, p.first.c_str(),
p.second.c_str());
replaceOrRenameFunction(module, p.first.c_str(), p.second.c_str());
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Module/KModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ void KModule::optimiseAndPrepare(
if (opts.CheckOvershift)
addInternalFunction("klee_overshift_check");

klee::optimiseAndPrepare(OptimiseKLEECall, opts.Optimize, opts.Simplify, opts.WithFPRuntime,
SwitchType, opts.EntryPoint, preservedFunctions,
module.get());
klee::optimiseAndPrepare(OptimiseKLEECall, opts.Optimize, opts.Simplify,
opts.WithFPRuntime, SwitchType, opts.EntryPoint,
preservedFunctions, module.get());
}

class InstructionToLineAnnotator : public llvm::AssemblyAnnotationWriter {
Expand Down
3 changes: 1 addition & 2 deletions lib/Module/ModuleHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ enum class SwitchImplType {
eSwitchTypeInternal
};

void optimiseAndPrepare(bool OptimiseKLEECall, bool Optimize,
bool Simplify,
void optimiseAndPrepare(bool OptimiseKLEECall, bool Optimize, bool Simplify,
bool WithFPRuntime, SwitchImplType SwitchType,
std::string EntryPoint,
llvm::ArrayRef<const char *> preservedFunctions,
Expand Down
6 changes: 2 additions & 4 deletions lib/Module/Optimize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Scalar/GVN.h"
#include "llvm/Transforms/Utils.h"
#include "llvm/IR/Module.h"

using namespace klee;
void klee::optimiseAndPrepare(bool OptimiseKLEECall, bool Optimize,
bool Simplify,
bool WithFPRuntime, SwitchImplType SwitchType,
std::string EntryPoint,
bool Simplify, bool WithFPRuntime,
SwitchImplType SwitchType, std::string EntryPoint,
llvm::ArrayRef<const char *> preservedFunctions,
llvm::Module *module) {
assert(0);
Expand Down
6 changes: 3 additions & 3 deletions test/Runtime/POSIX/FilePerm.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
#include <sys/types.h>
#include <unistd.h>


int main(int argc, char** argv) {
int main(int argc, char **argv) {
int fd = open("A", O_RDWR);
if (fd != -1)
printf("File 'A' opened successfully\n");
// CHECK-DAG: File 'A' opened successfully
else printf("Cannot open file 'A'\n");
else
printf("Cannot open file 'A'\n");
// CHECK-DAG: Cannot open file 'A'
if (fd != -1)
close(fd);
Expand Down

0 comments on commit 292a765

Please sign in to comment.