[llvm-bugs] [Bug 31945] New: [PCH, DebugInfo] Precompiled headers does not support debug info macro directives.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 13 04:47:54 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=31945

            Bug ID: 31945
           Summary: [PCH, DebugInfo] Precompiled headers does not support
                    debug info macro directives.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: amjad.aboud at intel.com
                CC: llvm-bugs at lists.llvm.org

Debug info macro is supported in LLVM when using -fdebug-macro flag.
However, PCH files does not preserve the debug info macro.

header.h:
  #define MyMacro(x) (x + 1)

source.c
  // empty

  $ clang -c -include header.h -emit-llvm -S -g -fdebug-macro -o source.ll
source.c
  $ grep MyMacro  source.ll

 !DIMacro(type: DW_MACINFO_define, line: 1, name: "MyMacro(x)", value: "(x +
1)")


  $ clang -x c-header -g -fdebug-macro -o header.pch header.h
  $ clang -c -include-pch header.pch -emit-llvm -S -g -fdebug-macro -o
source.ll source.c
  $ grep MyMacro  source.ll

Nothing!


Need to support all three directives:
#define, #undef, #include

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170213/ff5afd28/attachment.html>


More information about the llvm-bugs mailing list