Change the prototype for MCContext::FatalError() so it can be called
authorKevin Enderby <enderby@apple.com>
Tue, 22 Apr 2014 21:42:18 +0000 (21:42 +0000)
committerKevin Enderby <enderby@apple.com>
Tue, 22 Apr 2014 21:42:18 +0000 (21:42 +0000)
from places like MCCodeEmitter() in the MC backend when the
MCContext is const.

I was going to use this in my change for r206669 but Jim convinced
me to use an assert there. But this still is a good tweak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206923 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCContext.h
lib/MC/MCContext.cpp

index fbfde5e3f445d850e934e925277911951654b6f4..d2397154b4783dcdfb47c75c4743cb4e5c2f7f36 100644 (file)
@@ -417,7 +417,7 @@ namespace llvm {
     // Unrecoverable error has occurred. Display the best diagnostic we can
     // and bail via exit(1). For now, most MC backend errors are unrecoverable.
     // FIXME: We should really do something about that.
-    LLVM_ATTRIBUTE_NORETURN void FatalError(SMLoc L, const Twine &Msg);
+    LLVM_ATTRIBUTE_NORETURN void FatalError(SMLoc L, const Twine &Msg) const;
   };
 
 } // end namespace llvm
index 6f0c391769f483d249a1078000de7869151cee97..601903a17312f24fdc67bcf048ded702ce28ee94 100644 (file)
@@ -339,7 +339,7 @@ bool MCContext::isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID) {
   return !MCDwarfFiles[FileNumber].Name.empty();
 }
 
-void MCContext::FatalError(SMLoc Loc, const Twine &Msg) {
+void MCContext::FatalError(SMLoc Loc, const Twine &Msg) const {
   // If we have a source manager and a location, use it. Otherwise just
   // use the generic report_fatal_error().
   if (!SrcMgr || Loc == SMLoc())