From 80a75bfae980df96f969f1c05b0c4a80ce975240 Mon Sep 17 00:00:00 2001 From: Gordon Henriksen Date: Mon, 10 Dec 2007 03:18:06 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44769 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/CloneModule.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/Transforms/Utils/CloneModule.cpp') diff --git a/lib/Transforms/Utils/CloneModule.cpp b/lib/Transforms/Utils/CloneModule.cpp index 201da5be9a..cc645a9bd8 100644 --- a/lib/Transforms/Utils/CloneModule.cpp +++ b/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; } -- cgit v1.2.3