diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-08 23:39:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-08 23:39:42 +0000 |
commit | 93b6db3de934a3cfca5586df25184fef4a54c500 (patch) | |
tree | 3c32466a689b69726787f2b72bcdaf6a3879df50 /lib/MC/MCAsmStreamer.cpp | |
parent | 8e9ece75db5045ec057efbbdba6550fa0d85e695 (diff) | |
download | llvm-93b6db3de934a3cfca5586df25184fef4a54c500.tar.gz llvm-93b6db3de934a3cfca5586df25184fef4a54c500.tar.bz2 llvm-93b6db3de934a3cfca5586df25184fef4a54c500.tar.xz |
sink the 'name' and 'isdirective' state out of MCSection into its derived classes.
This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78517 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCAsmStreamer.cpp')
-rw-r--r-- | lib/MC/MCAsmStreamer.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index a71174a77b..0aed948d30 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -100,13 +100,6 @@ static inline bool NeedsQuoting(const StringRef &Str) { return false; } -/// Allow printing sections directly to a raw_ostream with proper quoting. -static inline raw_ostream &operator<<(raw_ostream &os, const MCSection *S) { - if (NeedsQuoting(S->getName())) - return os << '"' << S->getName() << '"'; - return os << S->getName(); -} - /// Allow printing symbols directly to a raw_ostream with proper quoting. static inline raw_ostream &operator<<(raw_ostream &os, const MCSymbol *S) { if (NeedsQuoting(S->getName())) @@ -144,10 +137,8 @@ void MCAsmStreamer::SwitchSection(MCSection *Section) { if (Section != CurSection) { CurSection = Section; - // FIXME: Really we would like the segment, flags, etc. to be separate - // values instead of embedded in the name. Not all assemblers understand all - // this stuff though. - OS << ".section " << Section << "\n"; + // FIXME: Needs TargetAsmInfo! + Section->PrintSwitchToSection(*(const TargetAsmInfo*)0, OS); } } @@ -228,7 +219,12 @@ void MCAsmStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol, // FIXME: Really we would like the segment and section names as well as the // section type to be separate values instead of embedded in the name. Not // all assemblers understand all this stuff though. - OS << ".zerofill " << Section; + OS << ".zerofill "; + + // This is a mach-o specific directive. + OS << '"' << ((MCSectionMachO*)Section)->getName() << '"'; + + if (Symbol != NULL) { OS << ',' << Symbol << ',' << Size; if (Pow2Alignment != 0) |