1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

make SwitchToSection accept null sections for now.

llvm-svn: 77976
This commit is contained in:
Chris Lattner 2009-08-03 18:04:42 +00:00
parent 21c4f86d86
commit 10f736e467

View File

@ -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 {