aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/GlobalValue.h
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-05-26 19:58:59 +0000
committerDuncan Sands <baldrick@free.fr>2008-05-26 19:58:59 +0000
commit28c3cff8250b3fe2adc6479306fe7dbdb48a1bdb (patch)
tree7228a30f4d1d804257ae14016a3b4c254de30c06 /include/llvm/GlobalValue.h
parent78ecf0d7b1ee7b1c44825d746b2f64e3a14aeb9b (diff)
downloadexternal_llvm-28c3cff8250b3fe2adc6479306fe7dbdb48a1bdb.tar.gz
external_llvm-28c3cff8250b3fe2adc6479306fe7dbdb48a1bdb.tar.bz2
external_llvm-28c3cff8250b3fe2adc6479306fe7dbdb48a1bdb.zip
Factor code to copy global value attributes like
the section or the visibility from one global value to another: copyAttributesFrom. This is particularly useful for duplicating functions: previously this was done by explicitly copying each attribute in turn at each place where a new function was created out of an old one, with the result that obscure attributes were regularly forgotten (like the collector or the section). Hopefully now everything is uniform and nothing is forgotten. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/GlobalValue.h')
-rw-r--r--include/llvm/GlobalValue.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h
index b13a122e1a..bc0c0a7937 100644
--- a/include/llvm/GlobalValue.h
+++ b/include/llvm/GlobalValue.h
@@ -110,6 +110,10 @@ public:
void setLinkage(LinkageTypes LT) { Linkage = LT; }
LinkageTypes getLinkage() const { return Linkage; }
+ /// copyAttributesFrom - copy all additional attributes (those not needed to
+ /// create a GlobalValue) from the GlobalValue Src to this one.
+ virtual void copyAttributesFrom(const GlobalValue *Src);
+
/// hasNotBeenReadFromBitcode - If a module provider is being used to lazily
/// stream in functions from disk, this method can be used to check to see if
/// the function has been read in yet or not. Unless you are working on the