<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - 'nodebug' doesn't suppress variable info"
   href="http://llvm.org/bugs/show_bug.cgi?id=21823">21823</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>'nodebug' doesn't suppress variable info
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>paul_robinson@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The 'nodebug' attribute can be attached to a function or static/global
variable.  On a function, it will suppress the debug info for that function.
When attached to a variable, however, debug info for the variable still 
appears.

---- test.cpp ----
int __attribute__((nodebug)) i1 = 2;
---- script ----
clang -c -g test.cpp
llvm-dwarfdump -debug-dump=info test.o
---- output ----
nodebug.o:    file format ELF64-x86-64


.debug_info contents:
0x00000000: Compile Unit: length = 0x00000037 version = 0x0004 abbr_offset =
0x0000 addr_size = 0x08 (next unit at 0x0000003b)

0x0000000b: DW_TAG_compile_unit [1] *
              DW_AT_producer [DW_FORM_strp]    ( .debug_str[0x00000000] =
"clang version 3.6.0 (trunk 223919)")
              DW_AT_language [DW_FORM_data2]    (DW_LANG_C_plus_plus)
              DW_AT_name [DW_FORM_strp]    ( .debug_str[0x00000023] =
"nodebug.cpp")
              DW_AT_stmt_list [DW_FORM_sec_offset]    (0x00000000)
              DW_AT_comp_dir [DW_FORM_strp]    ( .debug_str[0x0000002f] =
"/home/probinson/projects/scratch")

0x0000001e:   DW_TAG_variable [2]  
                DW_AT_name [DW_FORM_strp]    ( .debug_str[0x00000050] = "i1")
                DW_AT_type [DW_FORM_ref4]    (cu + 0x0033 => {0x00000033})
                DW_AT_external [DW_FORM_flag_present]    (true)
                DW_AT_decl_file [DW_FORM_data1]   
("/home/probinson/projects/scratch/nodebug.cpp")
                DW_AT_decl_line [DW_FORM_data1]    (2)
                DW_AT_location [DW_FORM_exprloc]    (<0x9> 03 00 00 00 00 00 00
00 00 )

0x00000033:   DW_TAG_base_type [3]  
                DW_AT_name [DW_FORM_strp]    ( .debug_str[0x00000053] = "int")
                DW_AT_encoding [DW_FORM_data1]    (DW_ATE_signed)
                DW_AT_byte_size [DW_FORM_data1]    (0x04)

0x0000003a:   NULL</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>