diff options
Diffstat (limited to 'lib/VMCore/LLVMContext.cpp')
-rw-r--r-- | lib/VMCore/LLVMContext.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp index ebd1e0a..68c5621 100644 --- a/lib/VMCore/LLVMContext.cpp +++ b/lib/VMCore/LLVMContext.cpp @@ -43,6 +43,16 @@ LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) { // Create the 'prof' metadata kind. unsigned ProfID = getMDKindID("prof"); assert(ProfID == MD_prof && "prof kind id drifted"); (void)ProfID; + + // Create the 'fpaccuracy' metadata kind. + unsigned FPAccuracyID = getMDKindID("fpaccuracy"); + assert(FPAccuracyID == MD_fpaccuracy && "fpaccuracy kind id drifted"); + (void)FPAccuracyID; + + // Create the 'range' metadata kind. + unsigned RangeID = getMDKindID("range"); + assert(RangeID == MD_range && "range kind id drifted"); + (void)RangeID; } LLVMContext::~LLVMContext() { delete pImpl; } @@ -78,11 +88,11 @@ void *LLVMContext::getInlineAsmDiagnosticContext() const { return pImpl->InlineAsmDiagContext; } -void LLVMContext::emitError(StringRef ErrorStr) { +void LLVMContext::emitError(const Twine &ErrorStr) { emitError(0U, ErrorStr); } -void LLVMContext::emitError(const Instruction *I, StringRef ErrorStr) { +void LLVMContext::emitError(const Instruction *I, const Twine &ErrorStr) { unsigned LocCookie = 0; if (const MDNode *SrcLoc = I->getMetadata("srcloc")) { if (SrcLoc->getNumOperands() != 0) @@ -92,7 +102,7 @@ void LLVMContext::emitError(const Instruction *I, StringRef ErrorStr) { return emitError(LocCookie, ErrorStr); } -void LLVMContext::emitError(unsigned LocCookie, StringRef ErrorStr) { +void LLVMContext::emitError(unsigned LocCookie, const Twine &ErrorStr) { // If there is no error handler installed, just print the error and exit. if (pImpl->InlineAsmDiagHandler == 0) { errs() << "error: " << ErrorStr << "\n"; @@ -100,7 +110,7 @@ void LLVMContext::emitError(unsigned LocCookie, StringRef ErrorStr) { } // If we do have an error handler, we can report the error and keep going. - SMDiagnostic Diag("", "error: " + ErrorStr.str()); + SMDiagnostic Diag("", SourceMgr::DK_Error, ErrorStr.str()); pImpl->InlineAsmDiagHandler(Diag, pImpl->InlineAsmDiagContext, LocCookie); } |