[LLVMdev] Purpose of -debug-compile in NVPTX backend
Kai
kai at redstar.de
Tue Nov 27 14:04:27 PST 2012
Hi!
My general understanding of the debug symbol support is that:
- the backend defines in the XXXMCAsmInfo class if debug information is
supported (e.g. SupportsDebugInformation = true / false)
- if I don't want to output debug information then I can use the
(hidden) command line option -disable-debug-info-print (defined in
DwarfDebug.cpp).
However, in NVPTXMCAsmInfo.cpp I found:
- a new command line option:
bool CompileForDebugging;
static cl::opt<bool, true>
Debug("debug-compile", cl::desc("Compile for debugging"), cl::Hidden,
cl::location(CompileForDebugging),
cl::init(false));
- and the assignment
SupportsDebugInformation = CompileForDebugging;
Isn't this redundant code? If yes then the attached patch should be
committed. If not then I like to know whats going on here....
Regards
Kai
-------------- next part --------------
diff --git a/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp b/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp
index 1d41665..5e128fe 100644
--- a/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp
+++ b/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp
@@ -17,15 +17,6 @@
using namespace llvm;
-bool CompileForDebugging;
-
-// -debug-compile - Command line option to inform opt and llc passes to
-// compile for debugging
-static cl::opt<bool, true>
-Debug("debug-compile", cl::desc("Compile for debugging"), cl::Hidden,
- cl::location(CompileForDebugging),
- cl::init(false));
-
void NVPTXMCAsmInfo::anchor() { }
NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Target &T, const StringRef &TT) {
@@ -46,7 +37,7 @@ NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Target &T, const StringRef &TT) {
InlineAsmStart = " inline asm";
InlineAsmEnd = " inline asm";
- SupportsDebugInformation = CompileForDebugging;
+ SupportsDebugInformation = true;
HasDotTypeDotSizeDirective = false;
Data8bitsDirective = " .b8 ";
More information about the llvm-dev
mailing list