Fix some loose ends in MASM support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28148 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jeff Cohen
2006-05-06 21:27:14 +00:00
parent a0aec0a61d
commit d43b18d9e4
3 changed files with 77 additions and 65 deletions
+5 -5
View File
@@ -71,9 +71,9 @@ void AsmPrinter::SwitchSection(const char *NewSection, const GlobalValue *GV) {
if (MLSections) {
if (*NewSection == 0) {
// Simply end the current section, if any.
if (CurrentSection != "") {
O << CurrentSection << "\tends\n";
CurrentSection = "";
if (!CurrentSection.empty()) {
O << CurrentSection << "\tends\n\n";
CurrentSection.clear();
}
return;
}
@@ -88,8 +88,8 @@ void AsmPrinter::SwitchSection(const char *NewSection, const GlobalValue *GV) {
NS = "_text";
if (CurrentSection != NS) {
if (CurrentSection != "")
O << CurrentSection << "\tends\n";
if (!CurrentSection.empty())
O << CurrentSection << "\tends\n\n";
CurrentSection = NS;
O << CurrentSection << (isData ? "\tsegment 'DATA'\n"
: "\tsegment 'CODE'\n");