#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Mangler.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Streams.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetMachine.h"
+#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/ADT/SmallPtrSet.h"
#include <cerrno>
using namespace llvm;
-static cl::opt<bool>
-AsmVerbose("asm-verbose", cl::Hidden, cl::desc("Add comments to directives."));
-
char AsmPrinter::ID = 0;
AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm,
const TargetAsmInfo *T)
void AsmPrinter::EOL() const {
O << '\n';
}
+
void AsmPrinter::EOL(const std::string &Comment) const {
- if (AsmVerbose && !Comment.empty()) {
+ if (VerboseAsm && !Comment.empty()) {
+ O << '\t'
+ << TAI->getCommentString()
+ << ' '
+ << Comment;
+ }
+ O << '\n';
+}
+
+void AsmPrinter::EOL(const char* Comment) const {
+ if (VerboseAsm && *Comment) {
O << '\t'
<< TAI->getCommentString()
<< ' '
/// printLabel - This method prints a local label used by debug and
/// exception handling tables.
void AsmPrinter::printLabel(const MachineInstr *MI) const {
- O << TAI->getPrivateGlobalPrefix()
- << "label" << MI->getOperand(0).getImm() << ":\n";
+ printLabel(MI->getOperand(0).getImm());
}
void AsmPrinter::printLabel(unsigned Id) const {
O << ':';
if (printComment && MBB->getBasicBlock())
O << '\t' << TAI->getCommentString() << ' '
- << MBB->getBasicBlock()->getName();
+ << MBB->getBasicBlock()->getNameStart();
}
/// printPICJumpTableSetLabel - This method prints a set label for the
}
}
-void AsmPrinter::printSuffixedName(std::string &Name, const char* Suffix) {
+void AsmPrinter::printSuffixedName(const char *Name, const char* Suffix) {
if (Name[0]=='\"')
O << '\"' << TAI->getPrivateGlobalPrefix() <<
- Name.substr(1, Name.length()-2) << Suffix << '\"';
+ Name[1] << Suffix << '\"';
else
O << TAI->getPrivateGlobalPrefix() << Name << Suffix;
}
+
+void AsmPrinter::printSuffixedName(std::string &Name, const char* Suffix) {
+ printSuffixedName(Name.c_str(), Suffix);
+}