diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-04-05 22:42:53 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-04-05 22:42:53 +0000 |
commit | fa254cb46cc04097cf2cef4429dd394049b6740a (patch) | |
tree | 86a733f9b92776fb7aac07787fc370a341eef8d5 /lib/AsmParser | |
parent | b29a2b0c4c69971a179652cb262e970fde5fc9ed (diff) | |
download | llvm-fa254cb46cc04097cf2cef4429dd394049b6740a.tar.gz llvm-fa254cb46cc04097cf2cef4429dd394049b6740a.tar.bz2 llvm-fa254cb46cc04097cf2cef4429dd394049b6740a.tar.xz |
AsmParser: add a warning for compatibility parsing
This adds a warning when linker_private or linker_private_weak is provided and
we handle it in a compatible manner.
Suggested by Chris Lattner!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205681 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser')
-rw-r--r-- | lib/AsmParser/LLLexer.cpp | 4 | ||||
-rw-r--r-- | lib/AsmParser/LLLexer.h | 4 | ||||
-rw-r--r-- | lib/AsmParser/LLParser.cpp | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/lib/AsmParser/LLLexer.cpp b/lib/AsmParser/LLLexer.cpp index 4fec7e60fa..c717a53f3a 100644 --- a/lib/AsmParser/LLLexer.cpp +++ b/lib/AsmParser/LLLexer.cpp @@ -34,6 +34,10 @@ bool LLLexer::Error(LocTy ErrorLoc, const Twine &Msg) const { return true; } +void LLLexer::Warning(LocTy WarningLoc, const Twine &Msg) const { + SM.PrintMessage(WarningLoc, SourceMgr::DK_Warning, Msg); +} + //===----------------------------------------------------------------------===// // Helper functions. //===----------------------------------------------------------------------===// diff --git a/lib/AsmParser/LLLexer.h b/lib/AsmParser/LLLexer.h index 85703c766b..ad11d49b25 100644 --- a/lib/AsmParser/LLLexer.h +++ b/lib/AsmParser/LLLexer.h @@ -63,6 +63,10 @@ namespace llvm { bool Error(LocTy L, const Twine &Msg) const; bool Error(const Twine &Msg) const { return Error(getLoc(), Msg); } + + void Warning(LocTy WarningLoc, const Twine &Msg) const; + void Warning(const Twine &Msg) const { return Warning(getLoc(), Msg); } + std::string getFilename() const; private: diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index b53b4ce7c0..b5c7f16ea2 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -1312,6 +1312,8 @@ bool LLParser::ParseOptionalLinkage(unsigned &Res, bool &HasLinkage) { case lltok::kw_linker_private: case lltok::kw_linker_private_weak: + Lex.Warning("'" + Lex.getStrVal() + "' is deprecated, treating as" + " PrivateLinkage"); Lex.Lex(); // treat linker_private and linker_private_weak as PrivateLinkage Res = GlobalValue::PrivateLinkage; |