mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
Require members of llvm.used to be named.
The effect of llvm.used is to introduce an invisible reference, so this seems a reasonable restriction. It will be used to provide an easy ordering of the entries in llvm.used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183743 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2932,8 +2932,8 @@ The '``llvm.used``' Global Variable
|
|||||||
|
|
||||||
The ``@llvm.used`` global is an array which has
|
The ``@llvm.used`` global is an array which has
|
||||||
:ref:`appending linkage <linkage_appending>`. This array contains a list of
|
:ref:`appending linkage <linkage_appending>`. This array contains a list of
|
||||||
pointers to global variables, functions and aliases which may optionally have a
|
pointers to named global variables, functions and aliases which may optionally
|
||||||
pointer cast formed of bitcast or getelementptr. For example, a legal
|
have a pointer cast formed of bitcast or getelementptr. For example, a legal
|
||||||
use of it is:
|
use of it is:
|
||||||
|
|
||||||
.. code-block:: llvm
|
.. code-block:: llvm
|
||||||
@@ -2948,11 +2948,11 @@ use of it is:
|
|||||||
|
|
||||||
If a symbol appears in the ``@llvm.used`` list, then the compiler, assembler,
|
If a symbol appears in the ``@llvm.used`` list, then the compiler, assembler,
|
||||||
and linker are required to treat the symbol as if there is a reference to the
|
and linker are required to treat the symbol as if there is a reference to the
|
||||||
symbol that it cannot see. For example, if a variable has internal linkage and
|
symbol that it cannot see (which is why they have to be named). For example, if
|
||||||
no references other than that from the ``@llvm.used`` list, it cannot be
|
a variable has internal linkage and no references other than that from the
|
||||||
deleted. This is commonly used to represent references from inline asms and
|
``@llvm.used`` list, it cannot be deleted. This is commonly used to represent
|
||||||
other things the compiler cannot "see", and corresponds to
|
references from inline asms and other things the compiler cannot "see", and
|
||||||
"``attribute((used))``" in GNU C.
|
corresponds to "``attribute((used))``" in GNU C.
|
||||||
|
|
||||||
On some targets, the code generator must emit a directive to the
|
On some targets, the code generator must emit a directive to the
|
||||||
assembler or object file to prevent the assembler and linker from
|
assembler or object file to prevent the assembler and linker from
|
||||||
|
@@ -467,6 +467,7 @@ void Verifier::visitGlobalVariable(GlobalVariable &GV) {
|
|||||||
Assert1(
|
Assert1(
|
||||||
isa<GlobalVariable>(V) || isa<Function>(V) || isa<GlobalAlias>(V),
|
isa<GlobalVariable>(V) || isa<Function>(V) || isa<GlobalAlias>(V),
|
||||||
"invalid llvm.used member", V);
|
"invalid llvm.used member", V);
|
||||||
|
Assert1(V->hasName(), "members of llvm.used must be named", V);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user