X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FIR%2FLLVMContextImpl.cpp;h=4c2791f0a8d531aeb1bd36dd673df16eee5ecd39;hb=0c5071f56198367ea2b29f8e34ddb9ecd1773985;hp=78a3c2d304b92a49edae1a6c97a0a4494678a035;hpb=218bad2bc5292bec2a46d59e0f85d4c9fde05bf4;p=oota-llvm.git diff --git a/lib/IR/LLVMContextImpl.cpp b/lib/IR/LLVMContextImpl.cpp index 78a3c2d304b..4c2791f0a8d 100644 --- a/lib/IR/LLVMContextImpl.cpp +++ b/lib/IR/LLVMContextImpl.cpp @@ -14,9 +14,8 @@ #include "LLVMContextImpl.h" #include "llvm/ADT/STLExtras.h" #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 using namespace llvm; @@ -41,58 +40,16 @@ LLVMContextImpl::LLVMContextImpl(LLVMContext &C) InlineAsmDiagContext = nullptr; DiagnosticHandler = nullptr; DiagnosticContext = nullptr; + YieldCallback = nullptr; + YieldOpaqueHandle = nullptr; NamedStructTypesUniqueID = 0; } -namespace { - -/// \brief Regular expression corresponding to the value given in the -/// command line flag -pass-remarks. Passes whose name matches this -/// regexp will emit a diagnostic when calling -/// LLVMContext::emitOptimizationRemark. -static Regex *OptimizationRemarkPattern = nullptr; - -struct PassRemarksOpt { - void operator=(const std::string &Val) const { - // Create a regexp object to match pass names for emitOptimizationRemark. - if (!Val.empty()) { - delete OptimizationRemarkPattern; - OptimizationRemarkPattern = new Regex(Val); - std::string RegexError; - if (!OptimizationRemarkPattern->isValid(RegexError)) - report_fatal_error("Invalid regular expression '" + Val + - "' in -pass-remarks: " + RegexError, - false); - } - }; -}; - -static PassRemarksOpt PassRemarksOptLoc; - -// -pass-remarks -// Command line flag to enable LLVMContext::emitOptimizationRemark() -// and LLVMContext::emitOptimizationNote() calls. -static cl::opt> -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); -} - -bool -LLVMContextImpl::optimizationRemarksEnabledFor(const char *PassName) const { - return OptimizationRemarkPattern && - OptimizationRemarkPattern->match(PassName); -} - - namespace { struct DropReferences { // Takes the value_type of a ConstantUniqueMap's internal map, whose 'second' // is a Constant*. - template - void operator()(const PairT &P) { + template void operator()(const PairT &P) { P.second->dropAllReferences(); } };