summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/LLVMContextImpl.cpp
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2014-05-22 17:19:01 +0000
committerDiego Novillo <dnovillo@google.com>2014-05-22 17:19:01 +0000
commit0b761a48cf017079907d520ffb1177f04037c037 (patch)
tree9415315ee7e85b752e9710f626792af9a6378a09 /llvm/lib/IR/LLVMContextImpl.cpp
parentfbce07ced0a4170db71b75dda6022e175e2a5ad1 (diff)
downloadbcm5719-llvm-0b761a48cf017079907d520ffb1177f04037c037.tar.gz
bcm5719-llvm-0b761a48cf017079907d520ffb1177f04037c037.zip
Remove LLVMContextImpl::optimizationRemarkEnabledFor.
Summary: This patch moves the handling of -pass-remarks* over to lib/DiagnosticInfo.cpp. This allows the removal of the optimizationRemarkEnabledFor functions from LLVMContextImpl, as they're not needed anymore. Reviewers: qcolombet Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D3878 llvm-svn: 209453
Diffstat (limited to 'llvm/lib/IR/LLVMContextImpl.cpp')
-rw-r--r--llvm/lib/IR/LLVMContextImpl.cpp77
1 files changed, 0 insertions, 77 deletions
diff --git a/llvm/lib/IR/LLVMContextImpl.cpp b/llvm/lib/IR/LLVMContextImpl.cpp
index 24d325246d2..4c2791f0a8d 100644
--- a/llvm/lib/IR/LLVMContextImpl.cpp
+++ b/llvm/lib/IR/LLVMContextImpl.cpp
@@ -16,8 +16,6 @@
#include "llvm/IR/Attributes.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Module.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Regex.h"
#include <algorithm>
using namespace llvm;
@@ -48,81 +46,6 @@ LLVMContextImpl::LLVMContextImpl(LLVMContext &C)
}
namespace {
-
-/// \brief Regular expression corresponding to the value given in one of the
-/// -pass-remarks* command line flags. Passes whose name matches this regexp
-/// will emit a diagnostic when calling the associated diagnostic function
-/// (emitOptimizationRemark, emitOptimizationRemarkMissed or
-/// emitOptimizationRemarkAnalysis).
-struct PassRemarksOpt {
- std::shared_ptr<Regex> Pattern;
-
- void operator=(const std::string &Val) {
- // Create a regexp object to match pass names for emitOptimizationRemark.
- if (!Val.empty()) {
- Pattern = std::make_shared<Regex>(Val);
- std::string RegexError;
- if (!Pattern->isValid(RegexError))
- report_fatal_error("Invalid regular expression '" + Val +
- "' in -pass-remarks: " + RegexError,
- false);
- }
- };
-};
-
-static PassRemarksOpt PassRemarksOptLoc;
-static PassRemarksOpt PassRemarksMissedOptLoc;
-static PassRemarksOpt PassRemarksAnalysisOptLoc;
-
-// -pass-remarks
-// Command line flag to enable emitOptimizationRemark()
-static cl::opt<PassRemarksOpt, true, cl::parser<std::string>>
-PassRemarks("pass-remarks", cl::value_desc("pattern"),
- cl::desc("Enable optimization remarks from passes whose name match "
- "the given regular expression"),
- cl::Hidden, cl::location(PassRemarksOptLoc), cl::ValueRequired,
- cl::ZeroOrMore);
-
-// -pass-remarks-missed
-// Command line flag to enable emitOptimizationRemarkMissed()
-static cl::opt<PassRemarksOpt, true, cl::parser<std::string>> PassRemarksMissed(
- "pass-remarks-missed", cl::value_desc("pattern"),
- cl::desc("Enable missed optimization remarks from passes whose name match "
- "the given regular expression"),
- cl::Hidden, cl::location(PassRemarksMissedOptLoc), cl::ValueRequired,
- cl::ZeroOrMore);
-
-// -pass-remarks-analysis
-// Command line flag to enable emitOptimizationRemarkAnalysis()
-static cl::opt<PassRemarksOpt, true, cl::parser<std::string>>
-PassRemarksAnalysis(
- "pass-remarks-analysis", cl::value_desc("pattern"),
- cl::desc(
- "Enable optimization analysis remarks from passes whose name match "
- "the given regular expression"),
- cl::Hidden, cl::location(PassRemarksAnalysisOptLoc), cl::ValueRequired,
- cl::ZeroOrMore);
-}
-
-bool LLVMContextImpl::optimizationRemarkEnabledFor(
- const DiagnosticInfoOptimizationRemark *DI) const {
- return PassRemarksOptLoc.Pattern &&
- PassRemarksOptLoc.Pattern->match(DI->getPassName());
-}
-
-bool LLVMContextImpl::optimizationRemarkEnabledFor(
- const DiagnosticInfoOptimizationRemarkMissed *DI) const {
- return PassRemarksMissedOptLoc.Pattern &&
- PassRemarksMissedOptLoc.Pattern->match(DI->getPassName());
-}
-
-bool LLVMContextImpl::optimizationRemarkEnabledFor(
- const DiagnosticInfoOptimizationRemarkAnalysis *DI) const {
- return PassRemarksAnalysisOptLoc.Pattern &&
- PassRemarksAnalysisOptLoc.Pattern->match(DI->getPassName());
-}
-
-namespace {
struct DropReferences {
// Takes the value_type of a ConstantUniqueMap's internal map, whose 'second'
// is a Constant*.
OpenPOWER on IntegriCloud