[llvm-commits] [llvm] r66650 - in /llvm/trunk: docs/LangRef.html include/llvm-c/Core.h include/llvm/GlobalValue.h lib/AsmParser/LLLexer.cpp lib/AsmParser/LLParser.cpp lib/AsmParser/LLToken.h lib/Bitcode/Reader/BitcodeReader.cpp lib/Bitcode/Writer/BitcodeWriter.cpp lib/Target/CppBackend/CPPBackend.cpp lib/Target/XCore/XCoreAsmPrinter.cpp lib/VMCore/AsmWriter.cpp utils/llvm.grm utils/vim/llvm.vim
Duncan Sands
baldrick at free.fr
Wed Mar 11 01:08:08 PDT 2009
Author: baldrick
Date: Wed Mar 11 03:08:06 2009
New Revision: 66650
URL: http://llvm.org/viewvc/llvm-project?rev=66650&view=rev
Log:
Remove the one-definition-rule version of extern_weak
linkage: this linkage type only applies to declarations,
but ODR is only relevant to globals with definitions.
Modified:
llvm/trunk/docs/LangRef.html
llvm/trunk/include/llvm-c/Core.h
llvm/trunk/include/llvm/GlobalValue.h
llvm/trunk/lib/AsmParser/LLLexer.cpp
llvm/trunk/lib/AsmParser/LLParser.cpp
llvm/trunk/lib/AsmParser/LLToken.h
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp
llvm/trunk/lib/VMCore/AsmWriter.cpp
llvm/trunk/utils/llvm.grm
llvm/trunk/utils/vim/llvm.vim
Modified: llvm/trunk/docs/LangRef.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=66650&r1=66649&r2=66650&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.html (original)
+++ llvm/trunk/docs/LangRef.html Wed Mar 11 03:08:06 2009
@@ -554,15 +554,13 @@
<dt><tt><b><a name="linkage_linkonce">linkonce_odr</a></b></tt>: </dt>
<dt><tt><b><a name="linkage_common">common_odr</a></b></tt>: </dt>
<dt><tt><b><a name="linkage_weak">weak_odr</a></b></tt>: </dt>
- <dt><tt><b><a name="linkage_externweak">extern_weak_odr</a></b></tt>: </dt>
<dd>Some languages allow inequivalent globals to be merged, such as two
functions with different semantics. Other languages, such as <tt>C++</tt>,
ensure that only equivalent globals are ever merged (the "one definition
rule" - <tt>odr</tt>). Such languages can use the <tt>linkonce_odr</tt>,
- <tt>common_odr</tt>, <tt>weak_odr</tt> and <tt>extern_weak_odr</tt> linkage
- types to indicate that the global will only be merged with equivalent
- globals. These linkage types are otherwise the same as their
- non-<tt>odr</tt> versions.
+ <tt>common_odr</tt> and <tt>weak_odr</tt> linkage types to indicate that
+ the global will only be merged with equivalent globals. These linkage
+ types are otherwise the same as their non-<tt>odr</tt> versions.
</dd>
<dt><tt><b><a name="linkage_external">externally visible</a></b></tt>:</dt>
@@ -606,8 +604,8 @@
external (i.e., lacking any linkage declarations), they are accessible
outside of the current module.</p>
<p>It is illegal for a function <i>declaration</i>
-to have any linkage type other than "externally visible", <tt>dllimport</tt>,
-<tt>extern_weak</tt> or <tt>extern_weak_odr</tt>.</p>
+to have any linkage type other than "externally visible", <tt>dllimport</tt>
+or <tt>extern_weak</tt>.</p>
<p>Aliases can have only <tt>external</tt>, <tt>internal</tt>, <tt>weak</tt>
or <tt>weak_odr</tt> linkages.</p>
</div>
Modified: llvm/trunk/include/llvm-c/Core.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=66650&r1=66649&r2=66650&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Core.h (original)
+++ llvm/trunk/include/llvm-c/Core.h Wed Mar 11 03:08:06 2009
@@ -127,9 +127,7 @@
LLVMPrivateLinkage, /**< Like Internal, but omit from symbol table */
LLVMDLLImportLinkage, /**< Function to be imported from DLL */
LLVMDLLExportLinkage, /**< Function to be accessible from DLL */
- LLVMExternalWeakAnyLinkage,/**< ExternalWeak linkage description */
- LLVMExternalWeakODRLinkage,/**< Same, but only replaced by something
- equivalent. */
+ LLVMExternalWeakLinkage,/**< ExternalWeak linkage description */
LLVMGhostLinkage, /**< Stand-in functions for streaming fns from
bitcode */
LLVMCommonAnyLinkage, /**< Tentative definitions */
Modified: llvm/trunk/include/llvm/GlobalValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/GlobalValue.h?rev=66650&r1=66649&r2=66650&view=diff
==============================================================================
--- llvm/trunk/include/llvm/GlobalValue.h (original)
+++ llvm/trunk/include/llvm/GlobalValue.h Wed Mar 11 03:08:06 2009
@@ -40,8 +40,7 @@
PrivateLinkage, ///< Like Internal, but omit from symbol table
DLLImportLinkage, ///< Function to be imported from DLL
DLLExportLinkage, ///< Function to be accessible from DLL
- ExternalWeakAnyLinkage,///< ExternalWeak linkage description
- ExternalWeakODRLinkage,///< Same, but only replaced by something equivalent.
+ ExternalWeakLinkage,///< ExternalWeak linkage description
GhostLinkage, ///< Stand-in functions for streaming fns from BC files
CommonAnyLinkage, ///< Tentative definitions
CommonODRLinkage ///< Same, but only replaced by something equivalent.
@@ -112,9 +111,6 @@
static LinkageTypes getCommonLinkage(bool ODR) {
return ODR ? CommonODRLinkage : CommonAnyLinkage;
}
- static LinkageTypes getExternalWeakLinkage(bool ODR) {
- return ODR ? ExternalWeakODRLinkage : ExternalWeakAnyLinkage;
- }
bool hasExternalLinkage() const { return Linkage == ExternalLinkage; }
bool hasLinkOnceLinkage() const {
@@ -131,10 +127,7 @@
}
bool hasDLLImportLinkage() const { return Linkage == DLLImportLinkage; }
bool hasDLLExportLinkage() const { return Linkage == DLLExportLinkage; }
- bool hasExternalWeakLinkage() const {
- return Linkage == ExternalWeakAnyLinkage ||
- Linkage == ExternalWeakODRLinkage;
- }
+ bool hasExternalWeakLinkage() const { return Linkage == ExternalWeakLinkage; }
bool hasGhostLinkage() const { return Linkage == GhostLinkage; }
bool hasCommonLinkage() const {
return Linkage == CommonAnyLinkage || Linkage == CommonODRLinkage;
@@ -150,7 +143,7 @@
return (Linkage == WeakAnyLinkage ||
Linkage == LinkOnceAnyLinkage ||
Linkage == CommonAnyLinkage ||
- Linkage == ExternalWeakAnyLinkage);
+ Linkage == ExternalWeakLinkage);
}
/// isWeakForLinker - Whether the definition of this global may be replaced at
@@ -162,8 +155,7 @@
Linkage == LinkOnceODRLinkage ||
Linkage == CommonAnyLinkage ||
Linkage == CommonODRLinkage ||
- Linkage == ExternalWeakAnyLinkage ||
- Linkage == ExternalWeakODRLinkage);
+ Linkage == ExternalWeakLinkage);
}
/// copyAttributesFrom - copy all additional attributes (those not needed to
Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=66650&r1=66649&r2=66650&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLLexer.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLLexer.cpp Wed Mar 11 03:08:06 2009
@@ -468,7 +468,6 @@
KEYWORD(hidden);
KEYWORD(protected);
KEYWORD(extern_weak);
- KEYWORD(extern_weak_odr);
KEYWORD(external);
KEYWORD(thread_local);
KEYWORD(zeroinitializer);
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=66650&r1=66649&r2=66650&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Wed Mar 11 03:08:06 2009
@@ -125,7 +125,6 @@
case lltok::kw_common_odr: // OptionalLinkage
case lltok::kw_dllimport: // OptionalLinkage
case lltok::kw_extern_weak: // OptionalLinkage
- case lltok::kw_extern_weak_odr: // OptionalLinkage
case lltok::kw_external: { // OptionalLinkage
unsigned Linkage, Visibility;
if (ParseOptionalLinkage(Linkage) ||
@@ -458,8 +457,7 @@
// present.
Constant *Init = 0;
if (!HasLinkage || (Linkage != GlobalValue::DLLImportLinkage &&
- Linkage != GlobalValue::ExternalWeakAnyLinkage &&
- Linkage != GlobalValue::ExternalWeakODRLinkage &&
+ Linkage != GlobalValue::ExternalWeakLinkage &&
Linkage != GlobalValue::ExternalLinkage)) {
if (ParseGlobalValue(Ty, Init))
return true;
@@ -574,10 +572,10 @@
return 0;
}
- FwdVal = Function::Create(FT, GlobalValue::ExternalWeakAnyLinkage, Name, M);
+ FwdVal = Function::Create(FT, GlobalValue::ExternalWeakLinkage, Name, M);
} else {
FwdVal = new GlobalVariable(PTy->getElementType(), false,
- GlobalValue::ExternalWeakAnyLinkage, 0, Name, M);
+ GlobalValue::ExternalWeakLinkage, 0, Name, M);
}
ForwardRefVals[Name] = std::make_pair(FwdVal, Loc);
@@ -618,10 +616,10 @@
Error(Loc, "function may not return opaque type");
return 0;
}
- FwdVal = Function::Create(FT, GlobalValue::ExternalWeakAnyLinkage, "", M);
+ FwdVal = Function::Create(FT, GlobalValue::ExternalWeakLinkage, "", M);
} else {
FwdVal = new GlobalVariable(PTy->getElementType(), false,
- GlobalValue::ExternalWeakAnyLinkage, 0, "", M);
+ GlobalValue::ExternalWeakLinkage, 0, "", M);
}
ForwardRefValIDs[ID] = std::make_pair(FwdVal, Loc);
@@ -753,7 +751,6 @@
/// ::= 'common_odr'
/// ::= 'dllimport'
/// ::= 'extern_weak'
-/// ::= 'extern_weak_odr'
/// ::= 'external'
bool LLParser::ParseOptionalLinkage(unsigned &Res, bool &HasLinkage) {
HasLinkage = false;
@@ -770,9 +767,7 @@
case lltok::kw_common: Res = GlobalValue::CommonAnyLinkage; break;
case lltok::kw_common_odr: Res = GlobalValue::CommonODRLinkage; break;
case lltok::kw_dllimport: Res = GlobalValue::DLLImportLinkage; break;
- case lltok::kw_extern_weak: Res = GlobalValue::ExternalWeakAnyLinkage; break;
- case lltok::kw_extern_weak_odr:
- Res = GlobalValue::ExternalWeakODRLinkage; break;
+ case lltok::kw_extern_weak: Res = GlobalValue::ExternalWeakLinkage; break;
case lltok::kw_external: Res = GlobalValue::ExternalLinkage; break;
}
Lex.Lex();
@@ -2103,8 +2098,7 @@
case GlobalValue::ExternalLinkage:
break; // always ok.
case GlobalValue::DLLImportLinkage:
- case GlobalValue::ExternalWeakAnyLinkage:
- case GlobalValue::ExternalWeakODRLinkage:
+ case GlobalValue::ExternalWeakLinkage:
if (isDefine)
return Error(LinkageLoc, "invalid linkage for function definition");
break;
Modified: llvm/trunk/lib/AsmParser/LLToken.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLToken.h?rev=66650&r1=66649&r2=66650&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLToken.h (original)
+++ llvm/trunk/lib/AsmParser/LLToken.h Wed Mar 11 03:08:06 2009
@@ -39,7 +39,7 @@
kw_private, kw_internal, kw_linkonce, kw_linkonce_odr, kw_weak, kw_weak_odr,
kw_appending, kw_dllimport, kw_dllexport, kw_common, kw_common_odr,
kw_default, kw_hidden, kw_protected,
- kw_extern_weak, kw_extern_weak_odr,
+ kw_extern_weak,
kw_external, kw_thread_local,
kw_zeroinitializer,
kw_undef, kw_null,
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=66650&r1=66649&r2=66650&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Wed Mar 11 03:08:06 2009
@@ -65,12 +65,11 @@
case 4: return GlobalValue::LinkOnceAnyLinkage;
case 5: return GlobalValue::DLLImportLinkage;
case 6: return GlobalValue::DLLExportLinkage;
- case 7: return GlobalValue::ExternalWeakAnyLinkage;
+ case 7: return GlobalValue::ExternalWeakLinkage;
case 8: return GlobalValue::CommonAnyLinkage;
case 9: return GlobalValue::PrivateLinkage;
case 10: return GlobalValue::WeakODRLinkage;
case 11: return GlobalValue::LinkOnceODRLinkage;
- case 12: return GlobalValue::ExternalWeakODRLinkage;
case 13: return GlobalValue::CommonODRLinkage;
}
}
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=66650&r1=66649&r2=66650&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Wed Mar 11 03:08:06 2009
@@ -282,12 +282,11 @@
case GlobalValue::LinkOnceAnyLinkage: return 4;
case GlobalValue::DLLImportLinkage: return 5;
case GlobalValue::DLLExportLinkage: return 6;
- case GlobalValue::ExternalWeakAnyLinkage: return 7;
+ case GlobalValue::ExternalWeakLinkage: return 7;
case GlobalValue::CommonAnyLinkage: return 8;
case GlobalValue::PrivateLinkage: return 9;
case GlobalValue::WeakODRLinkage: return 10;
case GlobalValue::LinkOnceODRLinkage: return 11;
- case GlobalValue::ExternalWeakODRLinkage: return 12;
case GlobalValue::CommonODRLinkage: return 13;
}
}
Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=66650&r1=66649&r2=66650&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original)
+++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Wed Mar 11 03:08:06 2009
@@ -310,10 +310,8 @@
Out << "GlobalValue::DLLImportLinkage"; break;
case GlobalValue::DLLExportLinkage:
Out << "GlobalValue::DLLExportLinkage"; break;
- case GlobalValue::ExternalWeakAnyLinkage:
- Out << "GlobalValue::ExternalWeakAnyLinkage"; break;
- case GlobalValue::ExternalWeakODRLinkage:
- Out << "GlobalValue::ExternalWeakODRLinkage"; break;
+ case GlobalValue::ExternalWeakLinkage:
+ Out << "GlobalValue::ExternalWeakLinkage"; break;
case GlobalValue::GhostLinkage:
Out << "GlobalValue::GhostLinkage"; break;
case GlobalValue::CommonAnyLinkage:
Modified: llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp?rev=66650&r1=66649&r2=66650&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp Wed Mar 11 03:08:06 2009
@@ -438,8 +438,7 @@
switch (I->getLinkage()) {
default:
assert(0 && "Unexpected linkage");
- case Function::ExternalWeakAnyLinkage:
- case Function::ExternalWeakODRLinkage:
+ case Function::ExternalWeakLinkage:
ExtWeakSymbols.insert(I);
// fallthrough
case Function::ExternalLinkage:
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=66650&r1=66649&r2=66650&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed Mar 11 03:08:06 2009
@@ -1194,8 +1194,7 @@
case GlobalValue::AppendingLinkage: Out << "appending "; break;
case GlobalValue::DLLImportLinkage: Out << "dllimport "; break;
case GlobalValue::DLLExportLinkage: Out << "dllexport "; break;
- case GlobalValue::ExternalWeakAnyLinkage: Out << "extern_weak "; break;
- case GlobalValue::ExternalWeakODRLinkage: Out << "extern_weak_odr "; break;
+ case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
case GlobalValue::ExternalLinkage: break;
case GlobalValue::GhostLinkage:
Out << "GhostLinkage not allowed in AsmWriter!\n";
Modified: llvm/trunk/utils/llvm.grm
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm.grm?rev=66650&r1=66649&r2=66650&view=diff
==============================================================================
--- llvm/trunk/utils/llvm.grm (original)
+++ llvm/trunk/utils/llvm.grm Wed Mar 11 03:08:06 2009
@@ -94,7 +94,6 @@
GVExternalLinkage
::= dllimport
| "extern_weak"
- | "extern_weak_odr"
| + external
;
@@ -109,7 +108,6 @@
::= + _
| dllimport
| "extern_weak"
- | "extern_weak_odr"
;
FunctionDefineLinkage
Modified: llvm/trunk/utils/vim/llvm.vim
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/vim/llvm.vim?rev=66650&r1=66649&r2=66650&view=diff
==============================================================================
--- llvm/trunk/utils/vim/llvm.vim (original)
+++ llvm/trunk/utils/vim/llvm.vim Wed Mar 11 03:08:06 2009
@@ -41,7 +41,7 @@
syn keyword llvmKeyword define declare global constant
syn keyword llvmKeyword internal external
syn keyword llvmKeyword linkonce linkonce_odr weak weak_odr appending
-syn keyword llvmKeyword common common_odr extern_weak extern_weak_odr
+syn keyword llvmKeyword common common_odr extern_weak
syn keyword llvmKeyword thread_local dllimport dllexport
syn keyword llvmKeyword hidden protected default
syn keyword llvmKeyword except deplibs
More information about the llvm-commits
mailing list