[llvm-commits] [llvm-gcc-4.2] r46265 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Dale Johannesen
dalej at apple.com
Tue Jan 22 16:48:04 PST 2008
Author: johannes
Date: Tue Jan 22 18:48:04 2008
New Revision: 46265
URL: http://llvm.org/viewvc/llvm-project?rev=46265&view=rev
Log:
Fix handling of CONST_DECL with section information.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=46265&r1=46264&r2=46265&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Tue Jan 22 18:48:04 2008
@@ -919,15 +919,6 @@
GV->setSection(Section);
#endif
}
-#ifdef LLVM_IMPLICIT_TARGET_GLOBAL_VAR_SECTION
- else if (TREE_CODE(decl) == CONST_DECL) {
- if (const char *Section =
- LLVM_IMPLICIT_TARGET_GLOBAL_VAR_SECTION(decl)) {
- GV->setSection(Section);
- }
- }
-#endif
-
// Set the alignment for the global if one of the following condition is met
// 1) DECL_ALIGN_UNIT does not match alignment as per ABI specification
@@ -947,8 +938,16 @@
// Add annotate attributes for globals
if (DECL_ATTRIBUTES(decl))
AddAnnotateAttrsToGlobal(GV, decl);
- }
+#ifdef LLVM_IMPLICIT_TARGET_GLOBAL_VAR_SECTION
+ } else if (TREE_CODE(decl) == CONST_DECL) {
+ if (const char *Section =
+ LLVM_IMPLICIT_TARGET_GLOBAL_VAR_SECTION(decl)) {
+ GV->setSection(Section);
+ }
+#endif
+ }
+
if (TheDebugInfo) TheDebugInfo->EmitGlobalVariable(GV, decl);
TREE_ASM_WRITTEN(decl) = 1;
More information about the llvm-commits
mailing list