public:
ReduceMiscompilingPasses(BugDriver &bd) : BD(bd) {}
- virtual TestResult doTest(std::vector<std::string> &Prefix,
- std::vector<std::string> &Suffix,
- std::string &Error);
+ TestResult doTest(std::vector<std::string> &Prefix,
+ std::vector<std::string> &Suffix,
+ std::string &Error) override;
};
}
// Ok, so now we know that the prefix passes work, try running the suffix
// passes on the result of the prefix passes.
//
- OwningPtr<Module> PrefixOutput(ParseInputFile(BitcodeResult,
- BD.getContext()));
+ std::unique_ptr<Module> PrefixOutput(
+ ParseInputFile(BitcodeResult, BD.getContext()));
if (!PrefixOutput) {
errs() << BD.getToolName() << ": Error reading bitcode file '"
<< BitcodeResult << "'!\n";
<< "' passes compile correctly after the '"
<< getPassesString(Prefix) << "' passes: ";
- OwningPtr<Module> OriginalInput(BD.swapProgramIn(PrefixOutput.release()));
+ std::unique_ptr<Module> OriginalInput(
+ BD.swapProgramIn(PrefixOutput.release()));
if (BD.runPasses(BD.getProgram(), Suffix, BitcodeResult, false/*delete*/,
true/*quiet*/)) {
errs() << " Error running this sequence of passes"
std::string &))
: BD(bd), TestFn(F) {}
- virtual TestResult doTest(std::vector<Function*> &Prefix,
- std::vector<Function*> &Suffix,
- std::string &Error) {
+ TestResult doTest(std::vector<Function*> &Prefix,
+ std::vector<Function*> &Suffix,
+ std::string &Error) override {
if (!Suffix.empty()) {
bool Ret = TestFuncs(Suffix, Error);
if (!Error.empty())
if (!Error.empty()) {
// Delete the linked module
delete M1;
- return NULL;
+ return nullptr;
}
return M1;
}
const std::vector<Function*> &Fns)
: BD(bd), TestFn(F), FunctionsBeingTested(Fns) {}
- virtual TestResult doTest(std::vector<BasicBlock*> &Prefix,
- std::vector<BasicBlock*> &Suffix,
- std::string &Error) {
+ TestResult doTest(std::vector<BasicBlock*> &Prefix,
+ std::vector<BasicBlock*> &Suffix,
+ std::string &Error) override {
if (!Suffix.empty()) {
bool Ret = TestFuncs(Suffix, Error);
if (!Error.empty())
MiscompiledFunctions,
VMap);
Module *Extracted = BD.ExtractMappedBlocksFromModule(Blocks, ToExtract);
- if (Extracted == 0) {
+ if (!Extracted) {
// Weird, extraction should have worked.
errs() << "Nondeterministic problem extracting blocks??\n";
delete ProgClone;
Safe->getOrInsertFunction("getPointerToNamedFunction",
Type::getInt8PtrTy(Safe->getContext()),
Type::getInt8PtrTy(Safe->getContext()),
- (Type *)0);
+ (Type *)nullptr);
// Use the function we just added to get addresses of functions we need.
for (Module::iterator F = Safe->begin(), E = Safe->end(); F != E; ++F) {