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. llvm-svn: 66528
Loading
Please register or sign in to comment