summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>2019-06-13 21:46:57 +0000
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>2019-06-13 21:46:57 +0000
commit6e6e3af55bb97e1a4c97375c15a2b0099120c5a7 (patch)
tree4dc151e7deced1ab1a3ebab57fd420e8a0cf0138 /llvm/lib/LTO/ThinLTOCodeGenerator.cpp
parenta5b12be60f98012dc8b75933d6dc1210bd742054 (diff)
downloadbcm5719-llvm-6e6e3af55bb97e1a4c97375c15a2b0099120c5a7.tar.gz
bcm5719-llvm-6e6e3af55bb97e1a4c97375c15a2b0099120c5a7.zip
[Remarks] Refactor optimization remarks setup
* Add a common function to setup opt-remarks * Rename common options to the same names * Add error types to distinguish between file errors and regex errors llvm-svn: 363328
Diffstat (limited to 'llvm/lib/LTO/ThinLTOCodeGenerator.cpp')
-rw-r--r--llvm/lib/LTO/ThinLTOCodeGenerator.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
index df18dd3f9ca..5d9aa8e571b 100644
--- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -29,6 +29,7 @@
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Mangler.h"
#include "llvm/IR/PassTimingInfo.h"
+#include "llvm/IR/RemarkStreamer.h"
#include "llvm/IR/Verifier.h"
#include "llvm/IRReader/IRReader.h"
#include "llvm/LTO/LTO.h"
@@ -69,9 +70,9 @@ using namespace llvm;
namespace llvm {
// Flags -discard-value-names, defined in LTOCodeGenerator.cpp
extern cl::opt<bool> LTODiscardValueNames;
-extern cl::opt<std::string> LTORemarksFilename;
-extern cl::opt<std::string> LTORemarksPasses;
-extern cl::opt<bool> LTOPassRemarksWithHotness;
+extern cl::opt<std::string> RemarksFilename;
+extern cl::opt<std::string> RemarksPasses;
+extern cl::opt<bool> RemarksWithHotness;
}
namespace {
@@ -1019,8 +1020,8 @@ void ThinLTOCodeGenerator::run() {
Context.setDiscardValueNames(LTODiscardValueNames);
Context.enableDebugTypeODRUniquing();
auto DiagFileOrErr = lto::setupOptimizationRemarks(
- Context, LTORemarksFilename, LTORemarksPasses,
- LTOPassRemarksWithHotness, count);
+ Context, RemarksFilename, RemarksPasses,
+ RemarksWithHotness, count);
if (!DiagFileOrErr) {
errs() << "Error: " << toString(DiagFileOrErr.takeError()) << "\n";
report_fatal_error("ThinLTO: Can't get an output file for the "
OpenPOWER on IntegriCloud