diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-11-28 08:41:48 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-11-28 08:41:48 +0000 |
commit | 3defc0bfa600cc253f0cba0fe781aa49435d968a (patch) | |
tree | 518884295520bfcff3a0838d8c53c48d85efe9d4 /lib/AsmParser/LLParser.cpp | |
parent | 8b1496c922b6a21296f7d42172df45bf205d5419 (diff) |
Add back support for reading and parsing 'deplibs'.
This is for backwards compatibility for pre-3.x bc files. The code reads the
code, but does nothing with it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/LLParser.cpp')
-rw-r--r-- | lib/AsmParser/LLParser.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 8a9f951908..57b67fe612 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -168,6 +168,7 @@ bool LLParser::ParseTopLevelEntities() { case lltok::kw_define: if (ParseDefine()) return true; break; case lltok::kw_module: if (ParseModuleAsm()) return true; break; case lltok::kw_target: if (ParseTargetDefinition()) return true; break; + case lltok::kw_deplibs: if (ParseDepLibs()) return true; break; case lltok::LocalVarID: if (ParseUnnamedType()) return true; break; case lltok::LocalVar: if (ParseNamedType()) return true; break; case lltok::GlobalID: if (ParseUnnamedGlobal()) return true; break; @@ -263,6 +264,28 @@ bool LLParser::ParseTargetDefinition() { } } +/// toplevelentity +/// ::= 'deplibs' '=' '[' ']' +/// ::= 'deplibs' '=' '[' STRINGCONSTANT (',' STRINGCONSTANT)* ']' +/// FIXME: Remove in 4.0. Currently parse, but ignore. +bool LLParser::ParseDepLibs() { + assert(Lex.getKind() == lltok::kw_deplibs); + Lex.Lex(); + if (ParseToken(lltok::equal, "expected '=' after deplibs") || + ParseToken(lltok::lsquare, "expected '=' after deplibs")) + return true; + + if (EatIfPresent(lltok::rsquare)) + return false; + + do { + std::string Str; + if (ParseStringConstant(Str)) return true; + } while (EatIfPresent(lltok::comma)); + + return ParseToken(lltok::rsquare, "expected ']' at end of list"); +} + /// ParseUnnamedType: /// ::= LocalVarID '=' 'type' type bool LLParser::ParseUnnamedType() { |