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 ";
Justin Holewinski
2012-Nov-30 02:17 UTC
[LLVMdev] Purpose of -debug-compile in NVPTX backend
Yes, this is a bit redundant. It can be removed for now. On Tue, Nov 27, 2012 at 5:04 PM, Kai <kai at redstar.de> wrote:> 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 > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-- Thanks, Justin Holewinski -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121129/2440e772/attachment.html>
Reasonably Related Threads
- [LLVMdev] Enable debug for MSP430
- Debug symbols are missing in elf
- [LLVMdev] [NVPTX] For linkonce_odr NVPTX generates .weak, but even newest PTXAS can't handle it
- [LLVMdev] How to set constant pool section?
- [LLVMdev] patch for llc/ARM: added mechanism to move switch tables from .text -> .data; also cleanup and documentation