diff options
| author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-01-07 02:28:31 +0000 |
|---|---|---|
| committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-01-07 02:28:31 +0000 |
| commit | 69c7caf63068aac90c413c221c437b648bafa6bc (patch) | |
| tree | 722652db07fc00b87d9750366c4890bd04d2cd05 /llvm/lib | |
| parent | 9deac1b7c2731eca2513c886611db5c3ee1b97ea (diff) | |
| download | bcm5719-llvm-69c7caf63068aac90c413c221c437b648bafa6bc.tar.gz bcm5719-llvm-69c7caf63068aac90c413c221c437b648bafa6bc.zip | |
MCParser: introduce Note and use it for ARM AsmParser
Introduce a new virtual method Note into the AsmParser. This completements the
existing Warning and Error methods. Use the new method to clean up the output
of the unwind routines in the ARM AsmParser.
llvm-svn: 198661
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 15 |
2 files changed, 15 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index 4b83144f3bd..451ae7ae407 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -211,6 +211,7 @@ public: AssemblerDialect = i; } + virtual void Note(SMLoc L, const Twine &Msg, ArrayRef<SMRange> Ranges = None); virtual bool Warning(SMLoc L, const Twine &Msg, ArrayRef<SMRange> Ranges = None); virtual bool Error(SMLoc L, const Twine &Msg, @@ -537,6 +538,11 @@ void AsmParser::printMacroInstantiations() { "while in macro instantiation"); } +void AsmParser::Note(SMLoc L, const Twine &Msg, ArrayRef<SMRange> Ranges) { + printMessage(L, SourceMgr::DK_Note, Msg, Ranges); + printMacroInstantiations(); +} + bool AsmParser::Warning(SMLoc L, const Twine &Msg, ArrayRef<SMRange> Ranges) { if (FatalAssemblerWarnings) return Error(L, Msg, Ranges); diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index b57527c91e3..be148ca7d29 100644 --- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -190,6 +190,9 @@ class ARMAsmParser : public MCTargetAsmParser { MCAsmParser &getParser() const { return Parser; } MCAsmLexer &getLexer() const { return Parser.getLexer(); } + void Note(SMLoc L, const Twine &Msg, ArrayRef<SMRange> Ranges = None) { + return Parser.Note(L, Msg, Ranges); + } bool Warning(SMLoc L, const Twine &Msg, ArrayRef<SMRange> Ranges = None) { return Parser.Warning(L, Msg, Ranges); @@ -8245,7 +8248,7 @@ bool ARMAsmParser::parseDirectiveFPU(SMLoc L) { bool ARMAsmParser::parseDirectiveFnStart(SMLoc L) { if (FnStartLoc.isValid()) { Error(L, ".fnstart starts before the end of previous one"); - Error(FnStartLoc, "previous .fnstart starts here"); + Note(FnStartLoc, "previous .fnstart starts here"); return false; } @@ -8280,12 +8283,12 @@ bool ARMAsmParser::parseDirectiveCantUnwind(SMLoc L) { } if (HandlerDataLoc.isValid()) { Error(L, ".cantunwind can't be used with .handlerdata directive"); - Error(HandlerDataLoc, ".handlerdata was specified here"); + Note(HandlerDataLoc, ".handlerdata was specified here"); return false; } if (PersonalityLoc.isValid()) { Error(L, ".cantunwind can't be used with .personality directive"); - Error(PersonalityLoc, ".personality was specified here"); + Note(PersonalityLoc, ".personality was specified here"); return false; } @@ -8304,12 +8307,12 @@ bool ARMAsmParser::parseDirectivePersonality(SMLoc L) { } if (CantUnwindLoc.isValid()) { Error(L, ".personality can't be used with .cantunwind directive"); - Error(CantUnwindLoc, ".cantunwind was specified here"); + Note(CantUnwindLoc, ".cantunwind was specified here"); return false; } if (HandlerDataLoc.isValid()) { Error(L, ".personality must precede .handlerdata directive"); - Error(HandlerDataLoc, ".handlerdata was specified here"); + Note(HandlerDataLoc, ".handlerdata was specified here"); return false; } @@ -8338,7 +8341,7 @@ bool ARMAsmParser::parseDirectiveHandlerData(SMLoc L) { } if (CantUnwindLoc.isValid()) { Error(L, ".handlerdata can't be used with .cantunwind directive"); - Error(CantUnwindLoc, ".cantunwind was specified here"); + Note(CantUnwindLoc, ".cantunwind was specified here"); return false; } |

