diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2008-07-01 23:18:29 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2008-07-01 23:18:29 +0000 |
| commit | c963f6c14bf650bab9424d2b136e204f612ac96f (patch) | |
| tree | 39207ec2bb8dbd1f281b844e5ba7c8947c875c5a /llvm/lib/CodeGen/AsmPrinter.cpp | |
| parent | 3b5ea90dc146cece9201cc926415877f2e78b4c8 (diff) | |
| download | bcm5719-llvm-c963f6c14bf650bab9424d2b136e204f612ac96f.tar.gz bcm5719-llvm-c963f6c14bf650bab9424d2b136e204f612ac96f.zip | |
Avoid creating expensive comment string if it's not going to be printed.
llvm-svn: 52992
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index 13206633972..35c36719807 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter.cpp @@ -21,7 +21,6 @@ #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" @@ -29,14 +28,12 @@ #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) @@ -553,7 +550,7 @@ void AsmPrinter::EOL() const { } void AsmPrinter::EOL(const std::string &Comment) const { - if (AsmVerbose && !Comment.empty()) { + if (VerboseAsm && !Comment.empty()) { O << '\t' << TAI->getCommentString() << ' ' @@ -563,7 +560,7 @@ void AsmPrinter::EOL(const std::string &Comment) const { } void AsmPrinter::EOL(const char* Comment) const { - if (AsmVerbose && *Comment) { + if (VerboseAsm && *Comment) { O << '\t' << TAI->getCommentString() << ' ' |

