Revert "Decouple dllexport/dllimport from linkage"

Revert this for now until I fix an issue in Clang with it.

This reverts commit r199204.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199207 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nico Rieck
2014-01-14 12:38:32 +00:00
parent 62b811443d
commit 55463f4ec1
27 changed files with 157 additions and 547 deletions

View File

@@ -658,7 +658,7 @@ for each library name referenced.
MODULE_CODE_GLOBALVAR Record
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``[GLOBALVAR, pointer type, isconst, initid, linkage, alignment, section, visibility, threadlocal, unnamed_addr, dllstorageclass]``
``[GLOBALVAR, pointer type, isconst, initid, linkage, alignment, section, visibility, threadlocal, unnamed_addr]``
The ``GLOBALVAR`` record (code 7) marks the declaration or definition of a
global variable. The operand fields are:
@@ -713,20 +713,12 @@ global variable. The operand fields are:
* *unnamed_addr*: If present and non-zero, indicates that the variable has
``unnamed_addr``
.. _dllstorageclass:
* *dllstorageclass*: If present, an encoding of the DLL storage class of this variable:
* ``default``: code 0
* ``dllimport``: code 1
* ``dllexport``: code 2
.. _FUNCTION:
MODULE_CODE_FUNCTION Record
^^^^^^^^^^^^^^^^^^^^^^^^^^^
``[FUNCTION, type, callingconv, isproto, linkage, paramattr, alignment, section, visibility, gc, prefix, dllstorageclass]``
``[FUNCTION, type, callingconv, isproto, linkage, paramattr, alignment, section, visibility, gc, prefix]``
The ``FUNCTION`` record (code 8) marks the declaration or definition of a
function. The operand fields are:
@@ -770,12 +762,10 @@ function. The operand fields are:
* *prefix*: If non-zero, the value index of the prefix data for this function,
plus 1.
* *dllstorageclass*: An encoding of the `dllstorageclass`_ of this function
MODULE_CODE_ALIAS Record
^^^^^^^^^^^^^^^^^^^^^^^^
``[ALIAS, alias type, aliasee val#, linkage, visibility, dllstorageclass]``
``[ALIAS, alias type, aliasee val#, linkage, visibility]``
The ``ALIAS`` record (code 9) marks the definition of an alias. The operand
fields are
@@ -788,8 +778,6 @@ fields are
* *visibility*: If present, an encoding of the `visibility`_ of the alias
* *dllstorageclass*: If present, an encoding of the `dllstorageclass`_ of the alias
MODULE_CODE_PURGEVALS Record
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@@ -274,8 +274,27 @@ linkage:
visible, meaning that it participates in linkage and can be used to
resolve external symbol references.
The next two types of linkage are targeted for Microsoft Windows
platform only. They are designed to support importing (exporting)
symbols from (to) DLLs (Dynamic Link Libraries).
``dllimport``
"``dllimport``" linkage causes the compiler to reference a function
or variable via a global pointer to a pointer that is set up by the
DLL exporting the symbol. On Microsoft Windows targets, the pointer
name is formed by combining ``__imp_`` and the function or variable
name.
``dllexport``
"``dllexport``" linkage causes the compiler to provide a global
pointer to a pointer in a DLL, so that it can be referenced with the
``dllimport`` attribute. On Microsoft Windows targets, the pointer
name is formed by combining ``__imp_`` and the function or variable
name. Since this linkage exists for defining a dll interface, the
compiler, assembler and linker know it is externally referenced and
must refrain from deleting the symbol.
It is illegal for a function *declaration* to have any linkage type
other than ``external`` or ``extern_weak``.
other than ``external``, ``dllimport`` or ``extern_weak``.
.. _callingconv:
@@ -397,25 +416,6 @@ styles:
.. _namedtypes:
DLL Storage Classes
-------------------
All Global Variables, Functions and Aliases can have one of the following
DLL storage class:
``dllimport``
"``dllimport``" causes the compiler to reference a function or variable via
a global pointer to a pointer that is set up by the DLL exporting the
symbol. On Microsoft Windows targets, the pointer name is formed by
combining ``__imp_`` and the function or variable name.
``dllexport``
"``dllexport``" causes the compiler to provide a global pointer to a pointer
in a DLL, so that it can be referenced with the ``dllimport`` attribute. On
Microsoft Windows targets, the pointer name is formed by combining
``__imp_`` and the function or variable name. Since this storage class
exists for defining a dll interface, the compiler, assembler and linker know
it is externally referenced and must refrain from deleting the symbol.
Named Types
-----------
@@ -529,15 +529,6 @@ assume that the globals are densely packed in their section and try to
iterate over them as an array, alignment padding would break this
iteration.
Globals can also have a :ref:`DLL storage class <dllstorageclass>`.
Syntax::
[@<GlobalVarName> =] [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]
[AddrSpace] [unnamed_addr] [ExternallyInitialized]
<global | constant> <Type>
[, section "name"] [, align <Alignment>]
For example, the following defines a global in a numbered address space
with an initializer, section, and alignment:
@@ -565,8 +556,7 @@ Functions
LLVM function definitions consist of the "``define``" keyword, an
optional :ref:`linkage type <linkage>`, an optional :ref:`visibility
style <visibility>`, an optional :ref:`DLL storage class <dllstorageclass>`,
an optional :ref:`calling convention <callingconv>`,
style <visibility>`, an optional :ref:`calling convention <callingconv>`,
an optional ``unnamed_addr`` attribute, a return type, an optional
:ref:`parameter attribute <paramattrs>` for the return type, a function
name, a (possibly empty) argument list (each with optional :ref:`parameter
@@ -577,8 +567,7 @@ curly brace, a list of basic blocks, and a closing curly brace.
LLVM function declarations consist of the "``declare``" keyword, an
optional :ref:`linkage type <linkage>`, an optional :ref:`visibility
style <visibility>`, an optional :ref:`DLL storage class <dllstorageclass>`,
an optional :ref:`calling convention <callingconv>`,
style <visibility>`, an optional :ref:`calling convention <callingconv>`,
an optional ``unnamed_addr`` attribute, a return type, an optional
:ref:`parameter attribute <paramattrs>` for the return type, a function
name, a possibly empty list of arguments, an optional alignment, an optional
@@ -614,7 +603,7 @@ be significant and two identical functions can be merged.
Syntax::
define [linkage] [visibility] [DLLStorageClass]
define [linkage] [visibility]
[cconv] [ret attrs]
<ResultType> @<FunctionName> ([argument list])
[fn Attrs] [section "name"] [align N]
@@ -627,13 +616,12 @@ Aliases
Aliases act as "second name" for the aliasee value (which can be either
function, global variable, another alias or bitcast of global value).
Aliases may have an optional :ref:`linkage type <linkage>`, an optional
:ref:`visibility style <visibility>`, and an optional :ref:`DLL storage class
<dllstorageclass>`.
Aliases may have an optional :ref:`linkage type <linkage>`, and an optional
:ref:`visibility style <visibility>`.
Syntax::
@<Name> = [Visibility] [DLLStorageClass] alias [Linkage] <AliaseeTy> @<Aliasee>
@<Name> = alias [Linkage] [Visibility] <AliaseeTy> @<Aliasee>
The linkage must be one of ``private``, ``linker_private``,
``linker_private_weak``, ``internal``, ``linkonce``, ``weak``,