From ce9b9fe6ebe435d02c4a399dea46d97104213abd Mon Sep 17 00:00:00 2001 From: Jeff Cohen Date: Sat, 6 May 2006 21:27:14 +0000 Subject: Fix some loose ends in MASM support. llvm-svn: 28148 --- llvm/lib/CodeGen/AsmPrinter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index 4f72a750ea1..9aca4e25ac0 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter.cpp @@ -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"); -- cgit v1.2.3