/// RealignStack - This flag indicates, whether stack should be automatically
/// realigned, if needed.
extern bool RealignStack;
+
+ /// VerboseAsm - When this flag is set, the asm printer prints additional
+ /// comments to asm directives.
+ extern bool VerboseAsm;
} // End llvm namespace
#endif
#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 std::string &Comment) const {
- if (AsmVerbose && !Comment.empty()) {
+ if (VerboseAsm && !Comment.empty()) {
O << '\t'
<< TAI->getCommentString()
<< ' '
}
void AsmPrinter::EOL(const char* Comment) const {
- if (AsmVerbose && *Comment) {
+ if (VerboseAsm && *Comment) {
O << '\t'
<< TAI->getCommentString()
<< ' '
// Emit the code (index) for the abbreviation.
Asm->EmitULEB128Bytes(AbbrevNumber);
- Asm->EOL(std::string("Abbrev [" +
- utostr(AbbrevNumber) +
- "] 0x" + utohexstr(Die->getOffset()) +
- ":0x" + utohexstr(Die->getSize()) + " " +
- TagString(Abbrev->getTag())));
+
+ if (VerboseAsm)
+ Asm->EOL(std::string("Abbrev [" +
+ utostr(AbbrevNumber) +
+ "] 0x" + utohexstr(Die->getOffset()) +
+ ":0x" + utohexstr(Die->getSize()) + " " +
+ TagString(Abbrev->getTag())));
+ else
+ Asm->EOL();
SmallVector<DIEValue*, 32> &Values = Die->getValues();
const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev->getData();
Asm->EmitInt8(1); Asm->EOL("DW_LNS_fixed_advance_pc arg count");
const UniqueVector<std::string> &Directories = MMI->getDirectories();
- const UniqueVector<SourceFileInfo>
- &SourceFiles = MMI->getSourceFiles();
+ const UniqueVector<SourceFileInfo> &SourceFiles = MMI->getSourceFiles();
// Emit directories.
for (unsigned DirectoryID = 1, NDID = Directories.size();
for (unsigned j = 0, M = SectionSourceLines.size(); j < M; ++j) {
// Isolate current sections line info.
const std::vector<SourceLineInfo> &LineInfos = SectionSourceLines[j];
-
- Asm->EOL(std::string("Section ") + SectionMap[j + 1]);
+
+ if (VerboseAsm)
+ Asm->EOL(std::string("Section ") + SectionMap[j + 1]);
+ else
+ Asm->EOL();
// Dwarf assumes we start with first line of first source file.
unsigned Source = 1;
unsigned SourceID = LineInfo.getSourceID();
const SourceFileInfo &SourceFile = SourceFiles[SourceID];
unsigned DirectoryID = SourceFile.getDirectoryID();
- Asm->EOL(Directories[DirectoryID]
- + SourceFile.getName()
- + ":"
- + utostr_32(LineInfo.getLine()));
+ if (VerboseAsm)
+ Asm->EOL(Directories[DirectoryID]
+ + SourceFile.getName()
+ + ":"
+ + utostr_32(LineInfo.getLine()));
+ else
+ Asm->EOL();
// Define the line address.
Asm->EmitInt8(0); Asm->EOL("Extended Op");
CodeModel::Model CMModel;
bool PerformTailCallOpt;
bool OptimizeForSize;
- bool RealignStack;
unsigned StackAlignment;
+ bool RealignStack;
+ bool VerboseAsm;
}
static cl::opt<bool, true> PrintCode("print-machineinstrs",
cl::location(OptimizeForSize),
cl::init(false));
+static cl::opt<unsigned, true>
+OverrideStackAlignment("stack-alignment",
+ cl::desc("Override default stack alignment"),
+ cl::location(StackAlignment),
+ cl::init(0));
+
static cl::opt<bool, true>
EnableRealignStack("realign-stack",
cl::desc("Realign stack if needed"),
cl::location(RealignStack),
cl::init(true));
-static cl::opt<unsigned, true>
-OverrideStackAlignment("stack-alignment",
- cl::desc("Override default stack alignment"),
- cl::location(StackAlignment),
- cl::init(0));
+static cl::opt<bool, true>
+AsmVerbose("asm-verbose", cl::desc("Add comments to directives."),
+ cl::location(VerboseAsm),
+ cl::init(false));
+
//---------------------------------------------------------------------------
// TargetMachine Class