diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2009-01-15 20:18:42 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2009-01-15 20:18:42 +0000 |
commit | bb46f52027416598a662dc1c58f48d9d56b1a65b (patch) | |
tree | ebdd7fc62b19bc9bdb7cc03563fd817d3943f17e /lib/AsmParser | |
parent | f193ff05909c2de373032f773e76804474b1ef4e (diff) | |
download | external_llvm-bb46f52027416598a662dc1c58f48d9d56b1a65b.zip external_llvm-bb46f52027416598a662dc1c58f48d9d56b1a65b.tar.gz external_llvm-bb46f52027416598a662dc1c58f48d9d56b1a65b.tar.bz2 |
Add the private linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser')
-rw-r--r-- | lib/AsmParser/LLLexer.cpp | 1 | ||||
-rw-r--r-- | lib/AsmParser/LLParser.cpp | 7 | ||||
-rw-r--r-- | lib/AsmParser/LLToken.h | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/lib/AsmParser/LLLexer.cpp b/lib/AsmParser/LLLexer.cpp index 6a3777d..fb491d3 100644 --- a/lib/AsmParser/LLLexer.cpp +++ b/lib/AsmParser/LLLexer.cpp @@ -453,6 +453,7 @@ lltok::Kind LLLexer::LexIdentifier() { KEYWORD(declare); KEYWORD(define); KEYWORD(global); KEYWORD(constant); + KEYWORD(private); KEYWORD(internal); KEYWORD(linkonce); KEYWORD(weak); diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index edfdf15..401dc39 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -113,6 +113,7 @@ bool LLParser::ParseTopLevelEntities() { // optional leading prefixes, the production is: // GlobalVar ::= OptionalLinkage OptionalVisibility OptionalThreadLocal // OptionalAddrSpace ('constant'|'global') ... + case lltok::kw_private: // OptionalLinkage case lltok::kw_internal: // OptionalLinkage case lltok::kw_weak: // OptionalLinkage case lltok::kw_linkonce: // OptionalLinkage @@ -375,7 +376,8 @@ bool LLParser::ParseAlias(const std::string &Name, LocTy NameLoc, if (Linkage != GlobalValue::ExternalLinkage && Linkage != GlobalValue::WeakLinkage && - Linkage != GlobalValue::InternalLinkage) + Linkage != GlobalValue::InternalLinkage && + Linkage != GlobalValue::PrivateLinkage) return Error(LinkageLoc, "invalid linkage type for alias"); Constant *Aliasee; @@ -738,6 +740,7 @@ bool LLParser::ParseOptionalAttrs(unsigned &Attrs, unsigned AttrKind) { /// ParseOptionalLinkage /// ::= /*empty*/ +/// ::= 'private' /// ::= 'internal' /// ::= 'weak' /// ::= 'linkonce' @@ -751,6 +754,7 @@ bool LLParser::ParseOptionalLinkage(unsigned &Res, bool &HasLinkage) { HasLinkage = false; switch (Lex.getKind()) { default: Res = GlobalValue::ExternalLinkage; return false; + case lltok::kw_private: Res = GlobalValue::PrivateLinkage; break; case lltok::kw_internal: Res = GlobalValue::InternalLinkage; break; case lltok::kw_weak: Res = GlobalValue::WeakLinkage; break; case lltok::kw_linkonce: Res = GlobalValue::LinkOnceLinkage; break; @@ -2065,6 +2069,7 @@ bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) { if (isDefine) return Error(LinkageLoc, "invalid linkage for function definition"); break; + case GlobalValue::PrivateLinkage: case GlobalValue::InternalLinkage: case GlobalValue::LinkOnceLinkage: case GlobalValue::WeakLinkage: diff --git a/lib/AsmParser/LLToken.h b/lib/AsmParser/LLToken.h index 75a483f..e3bc908 100644 --- a/lib/AsmParser/LLToken.h +++ b/lib/AsmParser/LLToken.h @@ -36,7 +36,7 @@ namespace lltok { kw_declare, kw_define, kw_global, kw_constant, - kw_internal, kw_linkonce, kw_weak, kw_appending, kw_dllimport, + kw_private, kw_internal, kw_linkonce, kw_weak, kw_appending, kw_dllimport, kw_dllexport, kw_common, kw_default, kw_hidden, kw_protected, kw_extern_weak, kw_external, kw_thread_local, |