aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDeclCXX.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-06-08 22:47:50 +0000
committerAnders Carlsson <andersca@mac.com>2010-06-08 22:47:50 +0000
commit18af368c080b9d60e34e670cd01f7d2d3ad2ba48 (patch)
treeeb2f0fa0f7d2df1e1dfa06ab83146fcc7fab458c /lib/CodeGen/CGDeclCXX.cpp
parent9dc046e70d189457968e4c3b986da75b5d98ce8e (diff)
On Darwin, initialization and destruction functions should go into the __StaticInit section.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105650 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDeclCXX.cpp')
-rw-r--r--lib/CodeGen/CGDeclCXX.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp
index 4c0de2f75e..b54f5af754 100644
--- a/lib/CodeGen/CGDeclCXX.cpp
+++ b/lib/CodeGen/CGDeclCXX.cpp
@@ -151,6 +151,11 @@ CreateGlobalInitOrDestructFunction(CodeGenModule &CGM,
llvm::Function::Create(FTy, llvm::GlobalValue::InternalLinkage,
Name, &CGM.getModule());
+ // Set the section if needed.
+ if (const char *Section =
+ CGM.getContext().Target.getStaticInitSectionSpecifier())
+ Fn->setSection(Section);
+
return Fn;
}