diff options
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 0bbbddf54c7..c608f6e4447 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -135,12 +135,16 @@ void AsmPrinter::SwitchToSection(const Section* NS) { // If section is named we need to switch into it via special '.section' // directive and also append funky flags. Otherwise - section name is just // some magic assembler directive. - if (NS->hasFlag(SectionFlags::Named)) + if (NS->hasFlag(SectionFlags::Named)) { O << TAI->getSwitchToSectionDirective() - << CurrentSection - << TAI->getSectionFlags(NS->getFlags()); - else + << CurrentSection; + + SmallString<32> FlagsStr; + TAI->getSectionFlags(NS->getFlags(), FlagsStr); + O << FlagsStr.c_str(); + } else { O << CurrentSection; + } O << TAI->getDataSectionStartSuffix() << '\n'; } |