diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-03 18:04:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-03 18:04:42 +0000 |
commit | c85652192c42d8f794788d10f45b04ad03426ca9 (patch) | |
tree | 318985c6543bbc85d4da301c26ddc63f14cb752f | |
parent | 1b7868ec544ad55097d68b31f809e948f6b74ac4 (diff) | |
download | bcm5719-llvm-c85652192c42d8f794788d10f45b04ad03426ca9.tar.gz bcm5719-llvm-c85652192c42d8f794788d10f45b04ad03426ca9.zip |
make SwitchToSection accept null sections for now.
llvm-svn: 77976
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 0a81bd7c2a8..c2a89b2d7e7 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -132,9 +132,14 @@ void AsmPrinter::SwitchToDataSection(const char *NewSection, } /// SwitchToSection - Switch to the specified section of the executable if we -/// are not already in it! +/// are not already in it! If "NS" is null, then this causes us to exit the +/// current section and not reenter another one. This is generally used for +/// asmprinter hacks. +/// +/// FIXME: Remove support for null sections. +/// void AsmPrinter::SwitchToSection(const MCSection *NS) { - const std::string &NewSection = NS->getName(); + const std::string &NewSection = NS ? NS->getName() : ""; // If we're already in this section, we're done. if (CurrentSection == NewSection) return; @@ -165,7 +170,7 @@ void AsmPrinter::SwitchToSection(const MCSection *NS) { O << TAI->getDataSectionStartSuffix() << '\n'; } - IsInTextSection = NS->getKind().isText(); + IsInTextSection = NS ? NS->getKind().isText() : false; } void AsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const { |