[llvm-commits] [llvm] r56575 - in /llvm/trunk: include/llvm/Target/TargetAsmInfo.h lib/CodeGen/AsmPrinter/DwarfWriter.cpp lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp lib/Target/ARM/ARMTargetAsmInfo.cpp lib/Target/DarwinTargetAsmInfo.cpp lib/Target/ELFTargetAsmInfo.cpp lib/Target/TargetAsmInfo.cpp lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp lib/Target/X86/X86TargetAsmInfo.cpp
Anton Korobeynikov
asl at math.spbu.ru
Wed Sep 24 15:16:16 PDT 2008
Author: asl
Date: Wed Sep 24 17:16:16 2008
New Revision: 56575
URL: http://llvm.org/viewvc/llvm-project?rev=56575&view=rev
Log:
Get rid of duplicate char*/Section* DataSection
Modified:
llvm/trunk/include/llvm/Target/TargetAsmInfo.h
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp
llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
llvm/trunk/lib/Target/TargetAsmInfo.cpp
llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmInfo.h?rev=56575&r1=56574&r2=56575&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Wed Sep 24 17:16:16 2008
@@ -131,12 +131,11 @@
/// TextSection - Section directive for standard text.
///
- const Section *TextSection; // Defaults to ".text".
+ const Section *TextSection; // Defaults to ".text".
/// DataSection - Section directive for standard data.
///
- const char *DataSection; // Defaults to ".data".
- const Section *DataSection_;
+ const Section *DataSection; // Defaults to ".data".
/// BSSSection - Section directive for uninitialized data. Null if this
/// target doesn't support a BSS section.
@@ -601,12 +600,9 @@
const Section *getTextSection() const {
return TextSection;
}
- const char *getDataSection() const {
+ const Section *getDataSection() const {
return DataSection;
}
- const Section *getDataSection_() const {
- return DataSection_;
- }
const char *getBSSSection() const {
return BSSSection;
}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=56575&r1=56574&r2=56575&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Wed Sep 24 17:16:16 2008
@@ -2064,7 +2064,7 @@
Asm->SwitchToSection(TAI->getTextSection());
EmitLabel("text_begin", 0);
- Asm->SwitchToDataSection(TAI->getDataSection());
+ Asm->SwitchToSection(TAI->getDataSection());
EmitLabel("data_begin", 0);
}
@@ -2750,7 +2750,7 @@
// Standard sections final addresses.
Asm->SwitchToSection(TAI->getTextSection());
EmitLabel("text_end", 0);
- Asm->SwitchToDataSection(TAI->getDataSection());
+ Asm->SwitchToSection(TAI->getDataSection());
EmitLabel("data_end", 0);
// End text sections.
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp?rev=56575&r1=56574&r2=56575&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp Wed Sep 24 17:16:16 2008
@@ -65,7 +65,7 @@
AP.SwitchToSection(TAI.getTextSection());
EmitCamlGlobal(getModule(), OS, AP, TAI, "code_begin");
- AP.SwitchToDataSection(TAI.getDataSection());
+ AP.SwitchToSection(TAI.getDataSection());
EmitCamlGlobal(getModule(), OS, AP, TAI, "data_begin");
}
@@ -100,13 +100,13 @@
AP.SwitchToSection(TAI.getTextSection());
EmitCamlGlobal(getModule(), OS, AP, TAI, "code_end");
- AP.SwitchToDataSection(TAI.getDataSection());
+ AP.SwitchToSection(TAI.getDataSection());
EmitCamlGlobal(getModule(), OS, AP, TAI, "data_end");
OS << AddressDirective << 0; // FIXME: Why does ocaml emit this??
AP.EOL();
- AP.SwitchToDataSection(TAI.getDataSection());
+ AP.SwitchToSection(TAI.getDataSection());
EmitCamlGlobal(getModule(), OS, AP, TAI, "frametable");
for (iterator I = begin(), IE = end(); I != IE; ++I) {
Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp?rev=56575&r1=56574&r2=56575&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp Wed Sep 24 17:16:16 2008
@@ -48,7 +48,6 @@
AlignmentIsInBytes = false;
Data64bitsDirective = 0;
CommentString = "@";
- DataSection = "\t.data";
ConstantPoolSection = "\t.text\n";
COMMDirectiveTakesAlignment = false;
InlineAsmStart = "@ InlineAsm Start";
Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=56575&r1=56574&r2=56575&view=diff
==============================================================================
--- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Wed Sep 24 17:16:16 2008
@@ -90,7 +90,7 @@
if (cast<GlobalVariable>(GV)->isConstant())
return (isWeak ? ConstDataCoalSection : ConstDataSection);
else
- return (isWeak ? DataCoalSection : getDataSection_());
+ return (isWeak ? DataCoalSection : getDataSection());
case SectionKind::ROData:
return (isWeak ? ConstDataCoalSection :
(isNonStatic ? ConstDataSection : getReadOnlySection_()));
Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=56575&r1=56574&r2=56575&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Wed Sep 24 17:16:16 2008
@@ -27,7 +27,6 @@
ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM) {
ETM = &TM;
- DataSection_ = getUnnamedSection("\t.data", SectionFlags::Writeable);
BSSSection_ = getUnnamedSection("\t.bss",
SectionFlags::Writeable | SectionFlags::BSS);
ReadOnlySection_ = getNamedSection("\t.rodata", SectionFlags::None);
@@ -64,7 +63,7 @@
switch (Kind) {
case SectionKind::Data:
case SectionKind::SmallData:
- return getDataSection_();
+ return getDataSection();
case SectionKind::BSS:
case SectionKind::SmallBSS:
// ELF targets usually have BSS sections
Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=56575&r1=56574&r2=56575&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Wed Sep 24 17:16:16 2008
@@ -27,8 +27,7 @@
TargetAsmInfo::TargetAsmInfo() :
TextSection(0),
- DataSection("\t.data"),
- DataSection_(0),
+ DataSection(0),
BSSSection("\t.bss"),
BSSSection_(0),
ReadOnlySection(0),
@@ -126,7 +125,7 @@
DwarfExceptionSection(".gcc_except_table"),
AsmTransCBE(0) {
TextSection = getUnnamedSection("\t.text", SectionFlags::Code);
- DataSection_ = getUnnamedSection(DataSection);
+ DataSection = getUnnamedSection("\t.data", SectionFlags::Writeable);
}
TargetAsmInfo::~TargetAsmInfo() {
@@ -306,14 +305,14 @@
return getReadOnlySection_();
}
- return getDataSection_();
+ return getDataSection();
}
// Lame default implementation. Calculate the section name for machine const.
const Section*
TargetAsmInfo::SelectSectionForMachineConst(const Type *Ty) const {
// FIXME: Support data.rel stuff someday
- return getDataSection_();
+ return getDataSection();
}
std::string
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp?rev=56575&r1=56574&r2=56575&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Wed Sep 24 17:16:16 2008
@@ -481,7 +481,7 @@
O << "\tpublic " << name << "\n";
// FALL THROUGH
case GlobalValue::InternalLinkage:
- SwitchToDataSection(TAI->getDataSection(), I);
+ SwitchToSection(TAI->getDataSection());
break;
default:
assert(0 && "Unknown linkage type!");
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=56575&r1=56574&r2=56575&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Wed Sep 24 17:16:16 2008
@@ -434,7 +434,8 @@
HasDotTypeDotSizeDirective = false;
TextSection = getUnnamedSection("_text", SectionFlags::Code);
- DataSection = "_data";
+ DataSection = getUnnamedSection("_data", SectionFlags::Writeable);
+
JumpTableDataSection = NULL;
SwitchToSectionDirective = "";
TextSectionStartSuffix = "\tsegment 'CODE'";
More information about the llvm-commits
mailing list