remove some completely wrong code. 1 is never < 16. It turns out that GCC appears to put strings of any length into the ELF cstring equivalent, so just rip out the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77429 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-07-29 04:54:38 +00:00
parent 95db93caa1
commit 067fe1ae54

View File

@ -412,28 +412,18 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
if (Kind.isText()) return TextSection;
if (Kind.isMergeableCString()) {
//Constant *C = cast<GlobalVariable>(GV)->getInitializer();
assert(CStringSection_ && "Should have string section prefix");
// FIXME: This is completely wrong. Why is it comparing the size of the
// character type to 1?
/// cast<ArrayType>(C->getType())->getNumElements();
uint64_t Size = 1;
if (Size <= 16) {
assert(CStringSection_ && "Should have string section prefix");
// We also need alignment here.
// FIXME: this is getting the alignment of the character, not the
// alignment of the global!
unsigned Align =
TM.getTargetData()->getPreferredAlignment(cast<GlobalVariable>(GV));
std::string Name = CStringSection_->getName() + utostr(Size) + '.' +
utostr(Align);
return getOrCreateSection(Name.c_str(), false,
SectionKind::MergeableCString);
}
// We also need alignment here.
// FIXME: this is getting the alignment of the character, not the
// alignment of the global!
unsigned Align =
TM.getTargetData()->getPreferredAlignment(cast<GlobalVariable>(GV));
return ReadOnlySection;
std::string Name = CStringSection_->getName() + utostr(Size) + '.' +
utostr(Align);
return getOrCreateSection(Name.c_str(), false,
SectionKind::MergeableCString);
}
if (Kind.isMergeableConst()) {