[llvm-commits] [llvm] r78067 - in /llvm/trunk: include/llvm/Target/TargetLoweringObjectFile.h lib/Target/TargetLoweringObjectFile.cpp
Chris Lattner
sabre at nondot.org
Tue Aug 4 09:19:51 PDT 2009
Author: lattner
Date: Tue Aug 4 11:19:50 2009
New Revision: 78067
URL: http://llvm.org/viewvc/llvm-project?rev=78067&view=rev
Log:
fix a fixme: don't create an explicit "CStringSection" for ELF,
it is just being used as a prefix, so forward substitute it directly.
Modified:
llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h
llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
Modified: llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h?rev=78067&r1=78066&r2=78067&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h (original)
+++ llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h Tue Aug 4 11:19:50 2009
@@ -187,8 +187,6 @@
///
const MCSection *TLSBSSSection; // Defaults to ".tbss".
- const MCSection *CStringSection;
-
const MCSection *DataRelSection;
const MCSection *DataRelLocalSection;
const MCSection *DataRelROSection;
Modified: llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp?rev=78067&r1=78066&r2=78067&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp (original)
+++ llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp Tue Aug 4 11:19:50 2009
@@ -320,10 +320,6 @@
TLSDataSection =
getOrCreateSection("\t.tdata", false, SectionKind::getThreadData());
- // FIXME: No reason to make this.
- CStringSection = getOrCreateSection("\t.rodata.str", true,
- SectionKind::getMergeable1ByteCString());
-
TLSBSSSection = getOrCreateSection("\t.tbss", false,
SectionKind::getThreadBSS());
@@ -511,7 +507,6 @@
if (Kind.isMergeable1ByteCString() ||
Kind.isMergeable2ByteCString() ||
Kind.isMergeable4ByteCString()) {
- assert(CStringSection && "Should have string section prefix");
// We also need alignment here.
// FIXME: this is getting the alignment of the character, not the
@@ -519,16 +514,16 @@
unsigned Align =
TM.getTargetData()->getPreferredAlignment(cast<GlobalVariable>(GV));
- const char *SizeSpec = "1.";
+ const char *SizeSpec = ".rodata.str1.";
if (Kind.isMergeable2ByteCString())
- SizeSpec = "2.";
+ SizeSpec = ".rodata.str2.";
else if (Kind.isMergeable4ByteCString())
- SizeSpec = "4.";
+ SizeSpec = ".rodata.str4.";
else
assert(Kind.isMergeable1ByteCString() && "unknown string width");
- std::string Name = CStringSection->getName() + SizeSpec + utostr(Align);
+ std::string Name = SizeSpec + utostr(Align);
return getOrCreateSection(Name.c_str(), false, Kind);
}
More information about the llvm-commits
mailing list