[llvm-commits] [llvm] r86797 - in /llvm/trunk: lib/Support/CommandLine.cpp utils/TableGen/SubtargetEmitter.cpp
Sandeep Patel
deeppatel1987 at gmail.com
Tue Nov 10 19:23:47 PST 2009
Author: sandeep
Date: Tue Nov 10 21:23:46 2009
New Revision: 86797
URL: http://llvm.org/viewvc/llvm-project?rev=86797&view=rev
Log:
Show command-line args and features passed into backend in debug output. Approved by Evan Cheng.
Modified:
llvm/trunk/lib/Support/CommandLine.cpp
llvm/trunk/utils/TableGen/SubtargetEmitter.cpp
Modified: llvm/trunk/lib/Support/CommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=86797&r1=86796&r2=86797&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp (original)
+++ llvm/trunk/lib/Support/CommandLine.cpp Tue Nov 10 21:23:46 2009
@@ -17,6 +17,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/ManagedStatic.h"
@@ -765,6 +766,11 @@
free(*i);
}
+ DEBUG(errs() << "\nArgs: ";
+ for (int i = 0; i < argc; ++i)
+ errs() << argv[i] << ' ';
+ );
+
// If we had an error processing our arguments, don't let the program execute
if (ErrorParsing) exit(1);
}
Modified: llvm/trunk/utils/TableGen/SubtargetEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/SubtargetEmitter.cpp?rev=86797&r1=86796&r2=86797&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/SubtargetEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/SubtargetEmitter.cpp Tue Nov 10 21:23:46 2009
@@ -519,6 +519,8 @@
OS << Target;
OS << "Subtarget::ParseSubtargetFeatures(const std::string &FS,\n"
<< " const std::string &CPU) {\n"
+ << " DEBUG(errs() << \"\\nFeatures:\" << FS);\n"
+ << " DEBUG(errs() << \"\\nCPU:\" << CPU);\n"
<< " SubtargetFeatures Features(FS);\n"
<< " Features.setCPUIfNone(CPU);\n"
<< " uint32_t Bits = Features.getBits(SubTypeKV, SubTypeKVSize,\n"
@@ -558,6 +560,8 @@
EmitSourceFileHeader("Subtarget Enumeration Source Fragment", OS);
+ OS << "#include \"llvm/Support/Debug.h\"\n";
+ OS << "#include \"llvm/Support/raw_ostream.h\"\n";
OS << "#include \"llvm/Target/SubtargetFeature.h\"\n";
OS << "#include \"llvm/Target/TargetInstrItineraries.h\"\n\n";
More information about the llvm-commits
mailing list