diff options
Diffstat (limited to 'lib/LTO/LTOBackend.cpp')
-rw-r--r-- | lib/LTO/LTOBackend.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/LTO/LTOBackend.cpp b/lib/LTO/LTOBackend.cpp index 7456e7175163..2761f8367b0d 100644 --- a/lib/LTO/LTOBackend.cpp +++ b/lib/LTO/LTOBackend.cpp @@ -28,6 +28,7 @@ #include "llvm/MC/SubtargetFeature.h" #include "llvm/Object/ModuleSymbolTable.h" #include "llvm/Passes/PassBuilder.h" +#include "llvm/Passes/StandardInstrumentations.h" #include "llvm/Support/Error.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" @@ -57,8 +58,8 @@ Error Config::addSaveTemps(std::string OutputFileName, ShouldDiscardValueNames = false; std::error_code EC; - ResolutionFile = llvm::make_unique<raw_fd_ostream>( - OutputFileName + "resolution.txt", EC, sys::fs::OpenFlags::F_Text); + ResolutionFile = std::make_unique<raw_fd_ostream>( + OutputFileName + "resolution.txt", EC, sys::fs::OpenFlags::OF_Text); if (EC) return errorCodeToError(EC); @@ -83,7 +84,7 @@ Error Config::addSaveTemps(std::string OutputFileName, PathPrefix = M.getModuleIdentifier() + "."; std::string Path = PathPrefix + PathSuffix + ".bc"; std::error_code EC; - raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::OF_None); // Because -save-temps is a debugging feature, we report the error // directly and exit. if (EC) @@ -103,7 +104,7 @@ Error Config::addSaveTemps(std::string OutputFileName, CombinedIndexHook = [=](const ModuleSummaryIndex &Index) { std::string Path = OutputFileName + "index.bc"; std::error_code EC; - raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::OF_None); // Because -save-temps is a debugging feature, we report the error // directly and exit. if (EC) @@ -111,7 +112,7 @@ Error Config::addSaveTemps(std::string OutputFileName, WriteIndexToFile(Index, OS); Path = OutputFileName + "index.dot"; - raw_fd_ostream OSDot(Path, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream OSDot(Path, EC, sys::fs::OpenFlags::OF_None); if (EC) reportOpenError(Path, EC.message()); Index.exportToDot(OSDot); @@ -165,7 +166,10 @@ static void runNewPMPasses(Config &Conf, Module &Mod, TargetMachine *TM, PGOOptions::IRUse, PGOOptions::CSIRUse); } - PassBuilder PB(TM, PipelineTuningOptions(), PGOOpt); + PassInstrumentationCallbacks PIC; + StandardInstrumentations SI; + SI.registerCallbacks(PIC); + PassBuilder PB(TM, PipelineTuningOptions(),PGOOpt, &PIC); AAManager AA; // Parse a custom AA pipeline if asked to. @@ -329,7 +333,7 @@ void codegen(Config &Conf, TargetMachine *TM, AddStreamFn AddStream, if (!DwoFile.empty()) { std::error_code EC; - DwoOut = llvm::make_unique<ToolOutputFile>(DwoFile, EC, sys::fs::F_None); + DwoOut = std::make_unique<ToolOutputFile>(DwoFile, EC, sys::fs::OF_None); if (EC) report_fatal_error("Failed to open " + DwoFile + ": " + EC.message()); } |