mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
AsmParser: restore LLVM IR compatibility for linker_private{,_weak}
This restores the linker_private and linker_private_weak lexemes to permit translation of the deprecated lexmes. The behaviour is identical to the bitcode handling: linker_private and linker_private_weak are handled as if private had been specified. This enables compatibility with IR generated by LLVM 3.4. Reported on IRC by ki9a! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205675 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -247,6 +247,8 @@ bool LLParser::ParseTopLevelEntities() {
|
||||
// ('constant'|'global') ...
|
||||
case lltok::kw_private: // OptionalLinkage
|
||||
case lltok::kw_internal: // OptionalLinkage
|
||||
case lltok::kw_linker_private: // Obsolete OptionalLinkage
|
||||
case lltok::kw_linker_private_weak: // Obsolete OptionalLinkage
|
||||
case lltok::kw_weak: // OptionalLinkage
|
||||
case lltok::kw_weak_odr: // OptionalLinkage
|
||||
case lltok::kw_linkonce: // OptionalLinkage
|
||||
@@ -1286,6 +1288,10 @@ bool LLParser::ParseOptionalReturnAttrs(AttrBuilder &B) {
|
||||
/// ::= 'common'
|
||||
/// ::= 'extern_weak'
|
||||
/// ::= 'external'
|
||||
///
|
||||
/// Deprecated Values:
|
||||
/// ::= 'linker_private'
|
||||
/// ::= 'linker_private_weak'
|
||||
bool LLParser::ParseOptionalLinkage(unsigned &Res, bool &HasLinkage) {
|
||||
HasLinkage = false;
|
||||
switch (Lex.getKind()) {
|
||||
@@ -1303,6 +1309,13 @@ bool LLParser::ParseOptionalLinkage(unsigned &Res, bool &HasLinkage) {
|
||||
case lltok::kw_common: Res = GlobalValue::CommonLinkage; break;
|
||||
case lltok::kw_extern_weak: Res = GlobalValue::ExternalWeakLinkage; break;
|
||||
case lltok::kw_external: Res = GlobalValue::ExternalLinkage; break;
|
||||
|
||||
case lltok::kw_linker_private:
|
||||
case lltok::kw_linker_private_weak:
|
||||
Lex.Lex();
|
||||
// treat linker_private and linker_private_weak as PrivateLinkage
|
||||
Res = GlobalValue::PrivateLinkage;
|
||||
return false;
|
||||
}
|
||||
Lex.Lex();
|
||||
HasLinkage = true;
|
||||
|
||||
Reference in New Issue
Block a user