summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-26 18:32:26 +0000
committerChris Lattner <sabre@nondot.org>2010-02-26 18:32:26 +0000
commitbb592eb9d08f497cb444819a6687ceb1a4007d79 (patch)
tree0dfcc1494fc2fa83b4df0078254fb086e24281fe /llvm/lib
parentef686dc38d309e8491c75f6fb32706550100ff59 (diff)
downloadbcm5719-llvm-bb592eb9d08f497cb444819a6687ceb1a4007d79.tar.gz
bcm5719-llvm-bb592eb9d08f497cb444819a6687ceb1a4007d79.zip
pass in more section kinds, enough to get the .align 0x90
stuff to emit optimal nops in the right places. llvm-svn: 97233
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index 1b22166f6a4..6185c30f52e 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -914,8 +914,10 @@ bool AsmParser::ParseDirectiveDarwinSection() {
return Error(Loc, ErrorStr.c_str());
// FIXME: Arch specific.
+ bool isText = Segment == "__TEXT"; // FIXME: Hack.
Out.SwitchSection(getMachOSection(Segment, Section, TAA, StubSize,
- SectionKind()));
+ isText ? SectionKind::getText()
+ : SectionKind::getDataRel()));
return false;
}
@@ -929,8 +931,10 @@ bool AsmParser::ParseDirectiveSectionSwitch(const char *Segment,
Lex();
// FIXME: Arch specific.
+ bool isText = StringRef(Segment) == "__TEXT"; // FIXME: Hack.
Out.SwitchSection(getMachOSection(Segment, Section, TAA, StubSize,
- SectionKind()));
+ isText ? SectionKind::getText()
+ : SectionKind::getDataRel()));
// Set the implicit alignment, if any.
//
@@ -1368,7 +1372,7 @@ bool AsmParser::ParseDirectiveComm(bool IsLocal) {
if (IsLocal) {
Out.EmitZerofill(getMachOSection("__DATA", "__bss",
MCSectionMachO::S_ZEROFILL, 0,
- SectionKind()),
+ SectionKind::getBSS()),
Sym, Size, 1 << Pow2Alignment);
return false;
}
@@ -1404,7 +1408,7 @@ bool AsmParser::ParseDirectiveDarwinZerofill() {
// Create the zerofill section but no symbol
Out.EmitZerofill(getMachOSection(Segment, Section,
MCSectionMachO::S_ZEROFILL, 0,
- SectionKind()));
+ SectionKind::getBSS()));
return false;
}
@@ -1462,7 +1466,7 @@ bool AsmParser::ParseDirectiveDarwinZerofill() {
// FIXME: Arch specific.
Out.EmitZerofill(getMachOSection(Segment, Section,
MCSectionMachO::S_ZEROFILL, 0,
- SectionKind()),
+ SectionKind::getBSS()),
Sym, Size, 1 << Pow2Alignment);
return false;
OpenPOWER on IntegriCloud