aboutsummaryrefslogtreecommitdiff
path: root/lib/MC
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2010-01-15 15:37:28 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2010-01-15 15:37:28 +0000
commit829000e035f46f2a227a5466e4e427a2f3cc00a9 (patch)
treebe5a687969f682edded4aa6f13594ffd9aa9030e /lib/MC
parent1e7804dbd25b8dbf534c850355d70ad215206f4b (diff)
downloadsrc-829000e035f46f2a227a5466e4e427a2f3cc00a9.tar.gz
src-829000e035f46f2a227a5466e4e427a2f3cc00a9.zip
Update LLVM to 93512.
Notes
Notes: svn path=/vendor/llvm/dist/; revision=202375
Diffstat (limited to 'lib/MC')
-rw-r--r--lib/MC/MCExpr.cpp5
-rw-r--r--lib/MC/MCInst.cpp9
-rw-r--r--lib/MC/MCSectionELF.cpp7
-rw-r--r--lib/MC/MCSymbol.cpp14
-rw-r--r--lib/MC/MCValue.cpp3
5 files changed, 22 insertions, 16 deletions
diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp
index a5a2256f4c88..a19ec19bca5d 100644
--- a/lib/MC/MCExpr.cpp
+++ b/lib/MC/MCExpr.cpp
@@ -11,6 +11,7 @@
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCValue.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
@@ -108,8 +109,8 @@ void MCExpr::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
}
void MCExpr::dump() const {
- print(errs(), 0);
- errs() << '\n';
+ print(dbgs(), 0);
+ dbgs() << '\n';
}
/* *** */
diff --git a/lib/MC/MCInst.cpp b/lib/MC/MCInst.cpp
index d05031870add..7c7a6447736c 100644
--- a/lib/MC/MCInst.cpp
+++ b/lib/MC/MCInst.cpp
@@ -9,6 +9,7 @@
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCExpr.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
@@ -31,8 +32,8 @@ void MCOperand::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
}
void MCOperand::dump() const {
- print(errs(), 0);
- errs() << "\n";
+ print(dbgs(), 0);
+ dbgs() << "\n";
}
void MCInst::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
@@ -45,6 +46,6 @@ void MCInst::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
}
void MCInst::dump() const {
- print(errs(), 0);
- errs() << "\n";
+ print(dbgs(), 0);
+ dbgs() << "\n";
}
diff --git a/lib/MC/MCSectionELF.cpp b/lib/MC/MCSectionELF.cpp
index c6812ed99c41..4d520ecd20a1 100644
--- a/lib/MC/MCSectionELF.cpp
+++ b/lib/MC/MCSectionELF.cpp
@@ -8,10 +8,10 @@
//===----------------------------------------------------------------------===//
#include "llvm/MC/MCSectionELF.h"
+#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
+#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/MC/MCAsmInfo.h"
-
using namespace llvm;
MCSectionELF *MCSectionELF::
@@ -23,7 +23,7 @@ Create(StringRef Section, unsigned Type, unsigned Flags,
// ShouldOmitSectionDirective - Decides whether a '.section' directive
// should be printed before the section name
bool MCSectionELF::ShouldOmitSectionDirective(const char *Name,
- const MCAsmInfo &MAI) const {
+ const MCAsmInfo &MAI) const {
// FIXME: Does .section .bss/.data/.text work everywhere??
if (strcmp(Name, ".text") == 0 ||
@@ -37,7 +37,6 @@ bool MCSectionELF::ShouldOmitSectionDirective(const char *Name,
// ShouldPrintSectionType - Only prints the section type if supported
bool MCSectionELF::ShouldPrintSectionType(unsigned Ty) const {
-
if (IsExplicit && !(Ty == SHT_NOBITS || Ty == SHT_PROGBITS))
return false;
diff --git a/lib/MC/MCSymbol.cpp b/lib/MC/MCSymbol.cpp
index b145d07f4a68..265d06cceba1 100644
--- a/lib/MC/MCSymbol.cpp
+++ b/lib/MC/MCSymbol.cpp
@@ -9,6 +9,7 @@
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCAsmInfo.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
@@ -51,11 +52,14 @@ static bool NameNeedsEscaping(StringRef Str, const MCAsmInfo &MAI) {
return false;
}
-static void PrintMangledName(raw_ostream &OS, StringRef Str,
- const MCAsmInfo &MAI) {
+/// printMangledName - Print the specified string in mangled form if it uses
+/// any unusual characters.
+void MCSymbol::printMangledName(StringRef Str, raw_ostream &OS,
+ const MCAsmInfo *MAI) {
// The first character is not allowed to be a number unless the target
// explicitly allows it.
- if (!MAI.doesAllowNameToStartWithDigit() && Str[0] >= '0' && Str[0] <= '9') {
+ if ((MAI == 0 || !MAI->doesAllowNameToStartWithDigit()) &&
+ Str[0] >= '0' && Str[0] <= '9') {
MangleLetter(OS, Str[0]);
Str = Str.substr(1);
}
@@ -94,7 +98,7 @@ void MCSymbol::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
// On systems that do not allow quoted names, print with mangling.
if (!MAI->doesAllowQuotesInName())
- return PrintMangledName(OS, getName(), *MAI);
+ return printMangledName(getName(), OS, MAI);
// If the string contains a double quote or newline, we still have to mangle
// it.
@@ -106,5 +110,5 @@ void MCSymbol::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
}
void MCSymbol::dump() const {
- print(errs(), 0);
+ print(dbgs(), 0);
}
diff --git a/lib/MC/MCValue.cpp b/lib/MC/MCValue.cpp
index 69bd10c8e699..c1222ec88721 100644
--- a/lib/MC/MCValue.cpp
+++ b/lib/MC/MCValue.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/MC/MCValue.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
@@ -30,5 +31,5 @@ void MCValue::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
}
void MCValue::dump() const {
- print(errs(), 0);
+ print(dbgs(), 0);
}