<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 --- - Attribute 'nodebug' disables line information when inlined"
   href="http://llvm.org/bugs/show_bug.cgi?id=19001">19001</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Attribute 'nodebug' disables line information when inlined
          </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>Linux
          </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>eugeni.stepanov@gmail.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>$ cat nodebug.cc
__attribute__((__always_inline__, __nodebug__))
static int f(int x) {
        return __builtin_bswap32(x);
}

int main() {
        return f(0);
}

$ ./bin/clang++ nodebug.cc -O0 -g -S -emit-llvm -o -
...
define i32 @main() #0 {
entry:
  %x.addr.i = alloca i32, align 4
  %retval = alloca i32, align 4
  store i32 0, i32* %retval
  store i32 0, i32* %x.addr.i, align 4
  %0 = load i32* %x.addr.i, align 4
  %1 = call i32 @llvm.bswap.i32(i32 %0) #2
  ret i32 %1, !dbg !12
}
...

Instructions that are inlined from f are missing debug annotations.
I expect them to have line/column information from the call site (i.e. main()
function).
The way it is done now, binary code emitted for these instructions is assigned
line numbers from the preceding instructions, which is unstable in respect to
code moving optimizations.</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>