[llvm-commits] [llvm-gcc-4.2] r77003 - in /llvm-gcc-4.2/trunk/gcc: config/darwin.h llvm-convert.cpp

Chris Lattner sabre at nondot.org
Fri Jul 24 13:39:04 PDT 2009


Author: lattner
Date: Fri Jul 24 15:39:04 2009
New Revision: 77003

URL: http://llvm.org/viewvc/llvm-project?rev=77003&view=rev
Log:
remove some old and obsolete code.  The asmprinter must not have been
handling zero length strings right and this code was added.  The asmprinter
does this right now.

Modified:
    llvm-gcc-4.2/trunk/gcc/config/darwin.h
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.h?rev=77003&r1=77002&r2=77003&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin.h Fri Jul 24 15:39:04 2009
@@ -702,9 +702,6 @@
   } while (0)
 /* LLVM LOCAL - end radar 6389998 */
 
-/* Assign STRING_CSTs to the .cstring section.  */
-#define LLVM_CSTRING_SECTION "__TEXT,__cstring,cstring_literals"
-#define LLVM_CONST_DATA_SECTION "__DATA,__const"
 #endif
 /* LLVM LOCAL end */
 

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=77003&r1=77002&r2=77003&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Jul 24 15:39:04 2009
@@ -35,7 +35,6 @@
 #include "llvm/Analysis/ConstantFolding.h"
 #include "llvm/System/Host.h"
 #include "llvm/Support/MathExtras.h"
-#include "llvm/Target/TargetAsmInfo.h"
 #include "llvm/Target/TargetLowering.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetMachine.h"
@@ -7912,19 +7911,6 @@
   GV->setAlignment(TYPE_ALIGN(TREE_TYPE(exp)) / 8);
 
   if (SlotP) *SlotP = GV;
-#ifdef LLVM_CSTRING_SECTION
-  // For Darwin, try to put it into the .cstring section.
-  const TargetAsmInfo *TAI = TheTarget->getTargetAsmInfo();
-  if (TAI && TAI->SectionKindForGlobal(GV) == SectionKind::RODataMergeStr)
-    // RODataMergeStr implies that StringIsConstant will be true here.
-    // The Darwin linker will coalesce strings in this section.
-    GV->setSection(LLVM_CSTRING_SECTION);
-#ifdef LLVM_CONST_DATA_SECTION
-  else if (!StringIsConstant)
-    // .const_data ("__DATA, __const" on Darwin).
-    GV->setSection(LLVM_CONST_DATA_SECTION);
-#endif	// LLVM_CONST_DATA_SECTION
-#endif	// LLVM_CSTRING_SECTION
   return GV;
 }
 





More information about the llvm-commits mailing list