From 17f194f4393a67fd28ad822c06d32b8cb99bad3f Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 12 Feb 2009 17:28:23 +0000 Subject: Support __attribute__(section()) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64380 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 7b939e2970..7192e9db2f 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -259,6 +259,9 @@ static void SetGlobalValueAttributes(const Decl *D, // should not be munged. GV->setName("\01" + ALA->getLabel()); } + + if (const SectionAttr *SA = D->getAttr()) + GV->setSection(SA->getName()); } void CodeGenModule::SetFunctionAttributes(const Decl *D, @@ -653,6 +656,9 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) { } } + if (const SectionAttr *SA = D->getAttr()) + GV->setSection(SA->getName()); + // Emit global variable debug information. CGDebugInfo *DI = getDebugInfo(); if(DI) { -- cgit v1.2.3-18-g5258