aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/CloneModule.cpp
diff options
context:
space:
mode:
authorGordon Henriksen <gordonhenriksen@mac.com>2007-12-10 03:18:06 +0000
committerGordon Henriksen <gordonhenriksen@mac.com>2007-12-10 03:18:06 +0000
commit71183b6739707a34464187adf1d7df8848415fe5 (patch)
treeb7bd2cf8d1c8bdd828327ce015c3202b572e0de7 /llvm/lib/Transforms/Utils/CloneModule.cpp
parente31cd5b564d48240788dcd6b721236b6adc7e0fe (diff)
downloadllvm-71183b6739707a34464187adf1d7df8848415fe5.zip
llvm-71183b6739707a34464187adf1d7df8848415fe5.tar.gz
llvm-71183b6739707a34464187adf1d7df8848415fe5.tar.bz2
Adding a collector name attribute to Function in the IR. These
methods are new to Function: bool hasCollector() const; const std::string &getCollector() const; void setCollector(const std::string &); void clearCollector(); The assembly representation is as such: define void @f() gc "shadow-stack" { ... The implementation uses an on-the-side table to map Functions to collector names, such that there is no overhead. A StringPool is further used to unique collector names, which are extremely likely to be unique per process. llvm-svn: 44769
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneModule.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CloneModule.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneModule.cpp b/llvm/lib/Transforms/Utils/CloneModule.cpp
index 201da5b..cc645a9 100644
--- a/llvm/lib/Transforms/Utils/CloneModule.cpp
+++ b/llvm/lib/Transforms/Utils/CloneModule.cpp
@@ -67,6 +67,8 @@ Module *llvm::CloneModule(const Module *M,
GlobalValue::ExternalLinkage, I->getName(), New);
NF->setCallingConv(I->getCallingConv());
NF->setParamAttrs(I->getParamAttrs());
+ if (I->hasCollector())
+ NF->setCollector(I->getCollector());
ValueMap[I]= NF;
}