summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/AsmWriter.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/VMCore/AsmWriter.cpp
parente31cd5b564d48240788dcd6b721236b6adc7e0fe (diff)
downloadbcm5719-llvm-71183b6739707a34464187adf1d7df8848415fe5.tar.gz
bcm5719-llvm-71183b6739707a34464187adf1d7df8848415fe5.zip
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/VMCore/AsmWriter.cpp')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index ef8161b0334..008c1daee19 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -1112,6 +1112,8 @@ void AssemblyWriter::printFunction(const Function *F) {
Out << " section \"" << F->getSection() << '"';
if (F->getAlignment())
Out << " align " << F->getAlignment();
+ if (F->hasCollector())
+ Out << " gc \"" << F->getCollector() << '"';
if (F->isDeclaration()) {
Out << "\n";
OpenPOWER on IntegriCloud