Introduce a new technique for merging BasicBlock with Instruction sentinel by superpo...
[oota-llvm.git] / lib / Target / DarwinTargetAsmInfo.cpp
index cb73d31d4bd3af5d59fc37d386c471648fa2bd6d..cc05c09c5170a1b401706e4317e49f11410b98de 100644 (file)
@@ -61,7 +61,7 @@ DarwinTargetAsmInfo::emitUsedDirectiveFor(const GlobalValue* GV,
                                           Mangler *Mang) const {
   if (GV==0)
     return false;
-  if (GV->hasInternalLinkage() && !isa<Function>(GV) &&
+  if (GV->hasLocalLinkage() && !isa<Function>(GV) &&
       ((strlen(getPrivateGlobalPrefix()) != 0 &&
         Mang->getValueName(GV).substr(0,strlen(getPrivateGlobalPrefix())) ==
           getPrivateGlobalPrefix()) ||
@@ -108,15 +108,16 @@ DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
   }
 
   // FIXME: Do we have any extra special weird cases?
+  return NULL;
 }
 
 const Section*
 DarwinTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const {
   const TargetData *TD = TM.getTargetData();
   Constant *C = cast<GlobalVariable>(GV)->getInitializer();
-  const Type *Type = cast<ConstantArray>(C)->getType()->getElementType();
+  const Type *Ty = cast<ArrayType>(C->getType())->getElementType();
 
-  unsigned Size = TD->getABITypeSize(Type);
+  unsigned Size = TD->getTypePaddedSize(Ty);
   if (Size) {
     unsigned Align = TD->getPreferredAlignment(GV);
     if (Align <= 32)
@@ -137,7 +138,7 @@ inline const Section*
 DarwinTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
   const TargetData *TD = TM.getTargetData();
 
-  unsigned Size = TD->getABITypeSize(Ty);
+  unsigned Size = TD->getTypePaddedSize(Ty);
   if (Size == 4)
     return FourByteConstantSection;
   else if (Size == 8)