]> granicus.if.org Git - clang/commit
Expand %= into ${:uid} so that the code generator emits a unique ID for the
authorChris Lattner <sabre@nondot.org>
Tue, 10 Mar 2009 05:39:21 +0000 (05:39 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 10 Mar 2009 05:39:21 +0000 (05:39 +0000)
commit63c8b14ddc15147f443806408db6459183af26c1
tree72d3394e00acc3d177c723dc6070d1b72369133a
parent0e5c8d4ca6c7e472ddde13495c8d3558983de85a
Expand %= into ${:uid} so that the code generator emits a unique ID for the
asm.  This allows us to properly handle the case when an optimizer duplicates
the asm, such as here:

void bar() {
  int i;
  for (i = 0; i < 3; ++i)
    asm("foo %=" : : "r"(0));
}

we now produce:

_bar:
xorl %eax, %eax
## InlineAsm Start
foo 0
## InlineAsm End
## InlineAsm Start
foo 1
## InlineAsm End
## InlineAsm Start
foo 2
## InlineAsm End
ret

instead of:

_bar:
xorl %eax, %eax
## InlineAsm Start
foo 1
## InlineAsm End
## InlineAsm Start
foo 1
## InlineAsm End
## InlineAsm Start
foo 1
## InlineAsm End
ret

This also fixes a fixme by eliminating a static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66528 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGStmt.cpp