Fix may-be-used-uninitialized warning.
[oota-llvm.git] / lib / Target / TargetAsmInfo.cpp
index 0573a96e538e3bd9e8cf2bf922c2c437ccad52e1..3f5f1bd3eb26d0ef1b53806bf20e4d23a88ed2c3 100644 (file)
 #include "llvm/Support/Dwarf.h"
 #include <cctype>
 #include <cstring>
-
 using namespace llvm;
 
-void TargetAsmInfo::fillDefaultValues() {
+TargetAsmInfo::TargetAsmInfo(const TargetMachine &tm)
+: TM(tm) {
   BSSSection = "\t.bss";
   BSSSection_ = 0;
   ReadOnlySection = 0;
@@ -58,6 +58,7 @@ void TargetAsmInfo::fillDefaultValues() {
   InlineAsmEnd = "#NO_APP";
   AssemblerDialect = 0;
   StringConstantPrefix = ".str";
+  AllowQuotesInName = false;
   ZeroDirective = "\t.zero\t";
   ZeroDirectiveSuffix = 0;
   AsciiDirective = "\t.ascii\t";
@@ -101,7 +102,7 @@ void TargetAsmInfo::fillDefaultValues() {
   SupportsDebugInformation = false;
   SupportsExceptionHandling = false;
   DwarfRequiresFrameSection = true;
-  SupportsMacInfoSection = true;
+  DwarfUsesInlineInfoSection = false;
   NonLocalEHFrameLabel = false;
   GlobalEHDirective = 0;
   SupportsWeakOmittedEHFrame = true;
@@ -112,11 +113,12 @@ void TargetAsmInfo::fillDefaultValues() {
   DwarfFrameSection = ".debug_frame";
   DwarfPubNamesSection = ".debug_pubnames";
   DwarfPubTypesSection = ".debug_pubtypes";
+  DwarfDebugInlineSection = ".debug_inlined";
   DwarfStrSection = ".debug_str";
   DwarfLocSection = ".debug_loc";
   DwarfARangesSection = ".debug_aranges";
   DwarfRangesSection = ".debug_ranges";
-  DwarfMacInfoSection = ".debug_macinfo";
+  DwarfMacroInfoSection = ".debug_macinfo";
   DwarfEHFrameSection = ".eh_frame";
   DwarfExceptionSection = ".gcc_except_table";
   AsmTransCBE = 0;
@@ -124,11 +126,6 @@ void TargetAsmInfo::fillDefaultValues() {
   DataSection = getUnnamedSection("\t.data", SectionFlags::Writeable);
 }
 
-TargetAsmInfo::TargetAsmInfo(const TargetMachine &tm)
-  : TM(tm) {
-  fillDefaultValues();
-}
-
 TargetAsmInfo::~TargetAsmInfo() {
 }
 
@@ -220,18 +217,14 @@ TargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const {
       unsigned Reloc = RelocBehaviour();
 
       // We already did a query for 'all' relocs, thus - early exits.
-      if (Reloc == Reloc::LocalOrGlobal) {
-        return (C->ContainsRelocations(Reloc::Local) ?
-                SectionKind::DataRelROLocal : SectionKind::DataRelRO);
-      } else if (Reloc == Reloc::None)
+      if (Reloc == Reloc::LocalOrGlobal)
+        return SectionKind::Data;
+      else if (Reloc == Reloc::None)
         return SectionKind::ROData;
       else {
         // Ok, target wants something funny. Honour it.
-        if (C->ContainsRelocations(Reloc)) {
-          return (Reloc == Reloc::Local ?
-                  SectionKind::DataRelROLocal : SectionKind::DataRelRO);
-        } else
-          return SectionKind::ROData;
+        return (C->ContainsRelocations(Reloc) ?
+                SectionKind::Data : SectionKind::ROData);
       }
     } else {
       // Check, if initializer is a null-terminated string
@@ -243,18 +236,7 @@ TargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const {
   }
 
   // Variable either is not constant or thread-local - output to data section.
-  if (isThreadLocal)
-    return SectionKind::ThreadData;
-
-  if (GVar->hasInitializer()) {
-    Constant *C = GVar->getInitializer();
-    unsigned Reloc = RelocBehaviour();
-    if (Reloc != Reloc::None && C->ContainsRelocations(Reloc))
-      return (C->ContainsRelocations(Reloc::Local) ?
-              SectionKind::DataRelLocal : SectionKind::DataRel);
-  }
-
-  return SectionKind::Data;
+  return (isThreadLocal ? SectionKind::ThreadData : SectionKind::Data);
 }
 
 unsigned