<div dir="ltr"><div class="gmail_extra">Alright. I've tested "check-asan" with your patch appiled and it works fine.<br><br><div class="gmail_quote">On Tue, May 6, 2014 at 4:14 PM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Tue, May 6, 2014 at 4:11 PM, Alexey Samsonov <<a href="mailto:samsonov@google.com">samsonov@google.com</a>> wrote:<br>

> Hm, would it be better to use include/llvm/Support/Regex.h in function name<br>
> lookup?<br>
<br>
</div>I don't know. A single optional substring seems simple enough that I<br>
personally wouldn't use a regex library for it (in c++), but if you<br>
prefer I can switch it over. (I think the best fix is likely to look<br>
at llvm.global_ctors anyways, so this is probably temporary code…)<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
><br>
> On Tue, May 6, 2014 at 4:03 PM, Nico Weber <<a href="mailto:thakis@chromium.org">thakis@chromium.org</a>> wrote:<br>
>><br>
>> Ok, here's a patch that does this (tests pass over here, but I don't<br>
>> have a Linux machine at hand, and these two tests seem to be<br>
>> linux-only). Does this look ok to you?<br>
>><br>
>> On Tue, May 6, 2014 at 3:51 PM, Alexey Samsonov <<a href="mailto:samsonov@google.com">samsonov@google.com</a>><br>
>> wrote:<br>
>> ><br>
>> ><br>
>> > On Tue, May 6, 2014 at 3:43 PM, Nico Weber <<a href="mailto:thakis@chromium.org">thakis@chromium.org</a>> wrote:<br>
>> >><br>
>> >> On Tue, May 6, 2014 at 3:39 PM, Alexey Samsonov <<a href="mailto:samsonov@google.com">samsonov@google.com</a>><br>
>> >> wrote:<br>
>> >> > Correct, _GLOBAL__I_a is hardcoded in ASan instrumentation pass. I'm<br>
>> >> > not<br>
>> >> > opposed to the change, just curious - what<br>
>> >> > parts of ASan reports would you like to improve?<br>
>> >><br>
>> >> My motivation is unrelated to Asan – I'd like to know which files add<br>
>> >> static initializers, because that makes it easier to remove static<br>
>> >> initializers. Reid mentioned that he heard people mentioning that<br>
>> >> people using Asan's init order feature complaining about the current<br>
>> >> system not being obvious.<br>
>> >><br>
>> >> I can see two ways of fixing this:<br>
>> >><br>
>> >> 1. Change createInitializerPoisonCalls to instead call<br>
>> >> M.getGlobalVariable("llvm.global_ctors") and then add all the<br>
>> >> functions in that array.<br>
>> >> 2. Change createInitializerPoisonCalls to walk all functions and look<br>
>> >> for those that start with /_GLOBAL__(sub_)?I_/ and use the first of<br>
>> >> them.<br>
>> >><br>
>> >> 2 would be roughly what the code currently does, but 1 seems nicer.<br>
>> >> What's better?<br>
>> ><br>
>> ><br>
>> > I'd go with option (2), at least in the context of this change. For now<br>
>> > it's<br>
>> > ok<br>
>> > to just match the new behavior of Clang, we can improve/rewrite the code<br>
>> > later.<br>
>> ><br>
>> >><br>
>> >><br>
>> >> > Generally, there's at least<br>
>> >> > __cxx_global_var_initN function in the report, which<br>
>> >> > has the correct file name in the debug info.<br>
>> >> ><br>
>> >> ><br>
>> >> > On Tue, May 6, 2014 at 3:35 PM, Nico Weber <<a href="mailto:thakis@chromium.org">thakis@chromium.org</a>><br>
>> >> > wrote:<br>
>> >> >><br>
>> >> >> Aha, lib/Transforms/Instrumentation/AddressSanitizer.cpp mentions<br>
>> >> >> _GLOBAL__I_a (I only looked in compiler-rt so far, not llvm).<br>
>> >> >> Probably<br>
>> >> >> easy to fix, giving it a shot…<br>
>> >> >><br>
>> >> >> On Tue, May 6, 2014 at 3:21 PM, Nico Weber <<a href="mailto:thakis@chromium.org">thakis@chromium.org</a>><br>
>> >> >> wrote:<br>
>> >> >> > Apparently this makes<br>
>> >> >> > TestCases/Linux/initialization-bug-any-order.cc<br>
>> >> >> > and TestCases/initialization-bug.cc unhappy. I looked at the asan<br>
>> >> >> > code<br>
>> >> >> > for this for a bit (and I'll continue looking). I don't understand<br>
>> >> >> > yet<br>
>> >> >> > why this is causing that failure. (+samsonov in case it's obvious<br>
>> >> >> > to<br>
>> >> >> > him.)<br>
>> >> >> ><br>
>> >> >> > On Tue, May 6, 2014 at 1:32 PM, Nico Weber <<a href="mailto:nicolasweber@gmx.de">nicolasweber@gmx.de</a>><br>
>> >> >> > wrote:<br>
>> >> >> >> Author: nico<br>
>> >> >> >> Date: Tue May  6 15:32:45 2014<br>
>> >> >> >> New Revision: 208128<br>
>> >> >> >><br>
>> >> >> >> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=208128&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=208128&view=rev</a><br>
>> >> >> >> Log:<br>
>> >> >> >> Include translation unit filename in global ctor symbol names.<br>
>> >> >> >><br>
>> >> >> >> This makes it easier to see where a global ctor comes from, and<br>
>> >> >> >> it<br>
>> >> >> >> also<br>
>> >> >> >> makes<br>
>> >> >> >> ASan's init order analyzer output easier to understand.  gcc does<br>
>> >> >> >> this<br>
>> >> >> >> too,<br>
>> >> >> >> but only in -fPIC mode for some reason.  Don't do this for<br>
>> >> >> >> constructors<br>
>> >> >> >> with<br>
>> >> >> >> explicit init priority.<br>
>> >> >> >><br>
>> >> >> >> Also prepend "sub_" before the 'I', that way regular constructors<br>
>> >> >> >> stay<br>
>> >> >> >> lexicographically after symbols with init priority (because<br>
>> >> >> >> ord('s') > ord('I')).  gold seems to ignore the name of<br>
>> >> >> >> constructor<br>
>> >> >> >> symbols,<br>
>> >> >> >> and ld only looks at the symbol if it includes an init priority,<br>
>> >> >> >> which<br>
>> >> >> >> this<br>
>> >> >> >> patch doesn't change.<br>
>> >> >> >><br>
>> >> >> >> Before: __GLOBAL_I_a<br>
>> >> >> >> Now: __GLOBAL_sub_I_myfile.cc<br>
>> >> >> >><br>
>> >> >> >> Modified:<br>
>> >> >> >>     cfe/trunk/lib/CodeGen/CGDeclCXX.cpp<br>
>> >> >> >>     cfe/trunk/test/CodeGenCXX/deferred-global-init.cpp<br>
>> >> >> >>     cfe/trunk/test/CodeGenCXX/global-init.cpp<br>
>> >> >> >>     cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp<br>
>> >> >> >>     cfe/trunk/test/CodeGenCXX/init-priority-attr.cpp<br>
>> >> >> >><br>
>> >> >> >> cfe/trunk/test/CodeGenCXX/microsoft-abi-static-initializers.cpp<br>
>> >> >> >>     cfe/trunk/test/CodeGenCXX/runtimecc.cpp<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> cfe/trunk/test/CodeGenCXX/static-member-variable-explicit-specialization.cpp<br>
>> >> >> >>     cfe/trunk/test/CodeGenObjCXX/<a href="http://arc-globals.mm" target="_blank">arc-globals.mm</a><br>
>> >> >> >><br>
>> >> >> >> Modified: cfe/trunk/lib/CodeGen/CGDeclCXX.cpp<br>
>> >> >> >> URL:<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDeclCXX.cpp?rev=208128&r1=208127&r2=208128&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDeclCXX.cpp?rev=208128&r1=208127&r2=208128&view=diff</a><br>

>> >> >> >><br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> ==============================================================================<br>
>> >> >> >> --- cfe/trunk/lib/CodeGen/CGDeclCXX.cpp (original)<br>
>> >> >> >> +++ cfe/trunk/lib/CodeGen/CGDeclCXX.cpp Tue May  6 15:32:45 2014<br>
>> >> >> >> @@ -17,6 +17,7 @@<br>
>> >> >> >>  #include "clang/Frontend/CodeGenOptions.h"<br>
>> >> >> >>  #include "llvm/ADT/StringExtras.h"<br>
>> >> >> >>  #include "llvm/IR/Intrinsics.h"<br>
>> >> >> >> +#include "llvm/Support/Path.h"<br>
>> >> >> >><br>
>> >> >> >>  using namespace clang;<br>
>> >> >> >>  using namespace CodeGen;<br>
>> >> >> >> @@ -362,7 +363,7 @@ CodeGenModule::EmitCXXGlobalInitFunc() {<br>
>> >> >> >>        // Compute the function suffix from priority. Prepend with<br>
>> >> >> >> zeroes to make<br>
>> >> >> >>        // sure the function names are also ordered as priorities.<br>
>> >> >> >>        std::string PrioritySuffix = llvm::utostr(Priority);<br>
>> >> >> >> -      // Priority is always <= 65535 (enforced by sema)..<br>
>> >> >> >> +      // Priority is always <= 65535 (enforced by sema).<br>
>> >> >> >>        PrioritySuffix = std::string(6-PrioritySuffix.size(),<br>
>> >> >> >> '0')+PrioritySuffix;<br>
>> >> >> >>        llvm::Function *Fn =<br>
>> >> >> >>          CreateGlobalInitOrDestructFunction(*this, FTy,<br>
>> >> >> >> @@ -376,8 +377,20 @@ CodeGenModule::EmitCXXGlobalInitFunc() {<br>
>> >> >> >>      }<br>
>> >> >> >>    }<br>
>> >> >> >><br>
>> >> >> >> -  llvm::Function *Fn =<br>
>> >> >> >> -    CreateGlobalInitOrDestructFunction(*this, FTy,<br>
>> >> >> >> "_GLOBAL__I_a");<br>
>> >> >> >> +  // Include the filename in the symbol name. Including "sub_"<br>
>> >> >> >> matches<br>
>> >> >> >> gcc and<br>
>> >> >> >> +  // makes sure these symbols appear lexicographically behind<br>
>> >> >> >> the<br>
>> >> >> >> symbols with<br>
>> >> >> >> +  // priority emitted above.<br>
>> >> >> >> +  SourceManager &SM = Context.getSourceManager();<br>
>> >> >> >> +  SmallString<128> FileName(llvm::sys::path::filename(<br>
>> >> >> >> +      SM.getFileEntryForID(SM.getMainFileID())->getName()));<br>
>> >> >> >> +  for (size_t i = 0; i < FileName.size(); ++i) {<br>
>> >> >> >> +    // Replace everything that's not [a-zA-Z0-9._] with a _.<br>
>> >> >> >> This<br>
>> >> >> >> set<br>
>> >> >> >> happens<br>
>> >> >> >> +    // to be the set of C preprocessing numbers.<br>
>> >> >> >> +    if (!isPreprocessingNumberBody(FileName[i]))<br>
>> >> >> >> +      FileName[i] = '_';<br>
>> >> >> >> +  }<br>
>> >> >> >> +  llvm::Function *Fn = CreateGlobalInitOrDestructFunction(<br>
>> >> >> >> +      *this, FTy, llvm::Twine("_GLOBAL__sub_I_", FileName));<br>
>> >> >> >><br>
>> >> >> >>    CodeGenFunction(*this).GenerateCXXGlobalInitFunc(Fn,<br>
>> >> >> >> CXXGlobalInits);<br>
>> >> >> >>    AddGlobalCtor(Fn);<br>
>> >> >> >><br>
>> >> >> >> Modified: cfe/trunk/test/CodeGenCXX/deferred-global-init.cpp<br>
>> >> >> >> URL:<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/deferred-global-init.cpp?rev=208128&r1=208127&r2=208128&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/deferred-global-init.cpp?rev=208128&r1=208127&r2=208128&view=diff</a><br>

>> >> >> >><br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> ==============================================================================<br>
>> >> >> >> --- cfe/trunk/test/CodeGenCXX/deferred-global-init.cpp (original)<br>
>> >> >> >> +++ cfe/trunk/test/CodeGenCXX/deferred-global-init.cpp Tue May  6<br>
>> >> >> >> 15:32:45 2014<br>
>> >> >> >> @@ -11,6 +11,6 @@ void* bar() { return a; }<br>
>> >> >> >>  // CHECK: load i8** @foo<br>
>> >> >> >>  // CHECK: ret void<br>
>> >> >> >><br>
>> >> >> >> -// CHECK-LABEL: define internal void @_GLOBAL__I_a<br>
>> >> >> >> +// CHECK-LABEL: define internal void<br>
>> >> >> >> @_GLOBAL__sub_I_deferred_global_init.cpp<br>
>> >> >> >>  // CHECK: call void @__cxx_global_var_init()<br>
>> >> >> >>  // CHECK: ret void<br>
>> >> >> >><br>
>> >> >> >> Modified: cfe/trunk/test/CodeGenCXX/global-init.cpp<br>
>> >> >> >> URL:<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/global-init.cpp?rev=208128&r1=208127&r2=208128&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/global-init.cpp?rev=208128&r1=208127&r2=208128&view=diff</a><br>

>> >> >> >><br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> ==============================================================================<br>
>> >> >> >> --- cfe/trunk/test/CodeGenCXX/global-init.cpp (original)<br>
>> >> >> >> +++ cfe/trunk/test/CodeGenCXX/global-init.cpp Tue May  6 15:32:45<br>
>> >> >> >> 2014<br>
>> >> >> >> @@ -195,11 +195,11 @@ namespace test7 {<br>
>> >> >> >>  // CHECK-NEXT:   sub<br>
>> >> >> >>  // CHECK-NEXT:   store i32 {{.*}}, i32* @_ZN5test1L1yE<br>
>> >> >> >><br>
>> >> >> >> -// CHECK: define internal void @_GLOBAL__I_a() section<br>
>> >> >> >> "__TEXT,__StaticInit,regular,pure_instructions" {<br>
>> >> >> >> +// CHECK: define internal void @_GLOBAL__sub_I_global_init.cpp()<br>
>> >> >> >> section "__TEXT,__StaticInit,regular,pure_instructions" {<br>
>> >> >> >>  // CHECK:   call void [[TEST1_Y_INIT]]<br>
>> >> >> >>  // CHECK:   call void [[TEST1_Z_INIT]]<br>
>> >> >> >><br>
>> >> >> >>  // rdar://problem/8090834: this should be nounwind<br>
>> >> >> >> -// CHECK-NOEXC: define internal void @_GLOBAL__I_a()<br>
>> >> >> >> [[NUW:#[0-9]+]]<br>
>> >> >> >> section "__TEXT,__StaticInit,regular,pure_instructions" {<br>
>> >> >> >> +// CHECK-NOEXC: define internal void<br>
>> >> >> >> @_GLOBAL__sub_I_global_init.cpp()<br>
>> >> >> >> [[NUW:#[0-9]+]] section<br>
>> >> >> >> "__TEXT,__StaticInit,regular,pure_instructions" {<br>
>> >> >> >><br>
>> >> >> >>  // CHECK-NOEXC: attributes [[NUW]] = { nounwind }<br>
>> >> >> >><br>
>> >> >> >> Modified: cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp<br>
>> >> >> >> URL:<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp?rev=208128&r1=208127&r2=208128&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp?rev=208128&r1=208127&r2=208128&view=diff</a><br>

>> >> >> >><br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> ==============================================================================<br>
>> >> >> >> --- cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp (original)<br>
>> >> >> >> +++ cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp Tue May  6<br>
>> >> >> >> 15:32:45<br>
>> >> >> >> 2014<br>
>> >> >> >> @@ -4,9 +4,9 @@<br>
>> >> >> >>  // Verify that the global init helper function does not get<br>
>> >> >> >> associated<br>
>> >> >> >>  // with any source location.<br>
>> >> >> >>  //<br>
>> >> >> >> -// CHECK: define internal void @_GLOBAL__I_a<br>
>> >> >> >> +// CHECK: define internal void<br>
>> >> >> >> @_GLOBAL__sub_I_globalinit_loc.cpp<br>
>> >> >> >>  // CHECK: !dbg ![[DBG:.*]]<br>
>> >> >> >> -// CHECK: "_GLOBAL__I_a", i32 0, {{.*}}, i32 0} ; [<br>
>> >> >> >> DW_TAG_subprogram<br>
>> >> >> >> ] [line 0] [local] [def]<br>
>> >> >> >> +// CHECK: "_GLOBAL__sub_I_globalinit_loc.cpp", i32 0, {{.*}},<br>
>> >> >> >> i32<br>
>> >> >> >> 0} ;<br>
>> >> >> >> [ DW_TAG_subprogram ] [line 0] [local] [def]<br>
>> >> >> >>  // CHECK: ![[DBG]] = metadata !{i32 0, i32 0,<br>
>> >> >> >>  # 99 "someheader.h"<br>
>> >> >> >>  class A {<br>
>> >> >> >><br>
>> >> >> >> Modified: cfe/trunk/test/CodeGenCXX/init-priority-attr.cpp<br>
>> >> >> >> URL:<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/init-priority-attr.cpp?rev=208128&r1=208127&r2=208128&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/init-priority-attr.cpp?rev=208128&r1=208127&r2=208128&view=diff</a><br>

>> >> >> >><br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> ==============================================================================<br>
>> >> >> >> --- cfe/trunk/test/CodeGenCXX/init-priority-attr.cpp (original)<br>
>> >> >> >> +++ cfe/trunk/test/CodeGenCXX/init-priority-attr.cpp Tue May  6<br>
>> >> >> >> 15:32:45 2014<br>
>> >> >> >> @@ -27,7 +27,7 @@ public:<br>
>> >> >> >><br>
>> >> >> >>  A C::a = A();<br>
>> >> >> >><br>
>> >> >> >> -// CHECK: @llvm.global_ctors = appending global [3 x { i32, void<br>
>> >> >> >> ()*<br>
>> >> >> >> }] [{ i32, void ()* } { i32 200, void ()* @_GLOBAL__I_000200 }, {<br>
>> >> >> >> i32, void<br>
>> >> >> >> ()* } { i32 300, void ()* @_GLOBAL__I_000300 }, { i32, void ()* }<br>
>> >> >> >> {<br>
>> >> >> >> i32<br>
>> >> >> >> 65535, void ()* @_GLOBAL__I_a }]<br>
>> >> >> >> +// CHECK: @llvm.global_ctors = appending global [3 x { i32, void<br>
>> >> >> >> ()*<br>
>> >> >> >> }] [{ i32, void ()* } { i32 200, void ()* @_GLOBAL__I_000200 }, {<br>
>> >> >> >> i32, void<br>
>> >> >> >> ()* } { i32 300, void ()* @_GLOBAL__I_000300 }, { i32, void ()* }<br>
>> >> >> >> {<br>
>> >> >> >> i32<br>
>> >> >> >> 65535, void ()* @_GLOBAL__sub_I_init_priority_attr.cpp }]<br>
>> >> >> >><br>
>> >> >> >>  // CHECK: _GLOBAL__I_000200()<br>
>> >> >> >>  // CHECK: _Z3fooi(i32 3)<br>
>> >> >> >> @@ -38,7 +38,7 @@ A C::a = A();<br>
>> >> >> >>  // CHECK-NEXT: _Z3fooi(i32 1)<br>
>> >> >> >>  // CHECK-NEXT: ret void<br>
>> >> >> >><br>
>> >> >> >> -// CHECK: _GLOBAL__I_a()<br>
>> >> >> >> +// CHECK: _GLOBAL__sub_I_init_priority_attr.cpp()<br>
>> >> >> >>  // CHECK: _Z3fooi(i32 1)<br>
>> >> >> >>  // CHECK-NEXT: _Z3fooi(i32 4)<br>
>> >> >> >>  // CHECK-NEXT: ret void<br>
>> >> >> >><br>
>> >> >> >> Modified:<br>
>> >> >> >> cfe/trunk/test/CodeGenCXX/microsoft-abi-static-initializers.cpp<br>
>> >> >> >> URL:<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-static-initializers.cpp?rev=208128&r1=208127&r2=208128&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-static-initializers.cpp?rev=208128&r1=208127&r2=208128&view=diff</a><br>

>> >> >> >><br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> ==============================================================================<br>
>> >> >> >> ---<br>
>> >> >> >> cfe/trunk/test/CodeGenCXX/microsoft-abi-static-initializers.cpp<br>
>> >> >> >> (original)<br>
>> >> >> >> +++<br>
>> >> >> >> cfe/trunk/test/CodeGenCXX/microsoft-abi-static-initializers.cpp<br>
>> >> >> >> Tue<br>
>> >> >> >> May  6 15:32:45 2014<br>
>> >> >> >> @@ -2,7 +2,7 @@<br>
>> >> >> >><br>
>> >> >> >>  // CHECK: @llvm.global_ctors = appending global [2 x { i32, void<br>
>> >> >> >> ()*<br>
>> >> >> >> }]<br>
>> >> >> >>  // CHECK: [{ i32, void ()* } { i32 65535, void ()*<br>
>> >> >> >> @"\01??__Efoo@?$B@H@@2VA@@A@YAXXZ"<br>
>> >> >> >> -// CHECK:  { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a<br>
>> >> >> >> }]<br>
>> >> >> >> +// CHECK:  { i32, void ()* } { i32 65535, void ()*<br>
>> >> >> >> @_GLOBAL__sub_I_microsoft_abi_static_initializers.cpp }]<br>
>> >> >> >><br>
>> >> >> >>  struct S {<br>
>> >> >> >>    S();<br>
>> >> >> >> @@ -160,7 +160,7 @@ void force_usage() {<br>
>> >> >> >>  // CHECK: call x86_thiscallcc void @"\01??1A@@QAE@XZ"{{.*}}foo<br>
>> >> >> >>  // CHECK: ret void<br>
>> >> >> >><br>
>> >> >> >> -// CHECK: define internal void @_GLOBAL__I_a() [[NUW]] {<br>
>> >> >> >> +// CHECK: define internal void<br>
>> >> >> >> @_GLOBAL__sub_I_microsoft_abi_static_initializers.cpp() [[NUW]] {<br>
>> >> >> >>  // CHECK: call void @"\01??__Es@@YAXXZ"()<br>
>> >> >> >>  // CHECK: ret void<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> Modified: cfe/trunk/test/CodeGenCXX/runtimecc.cpp<br>
>> >> >> >> URL:<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/runtimecc.cpp?rev=208128&r1=208127&r2=208128&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/runtimecc.cpp?rev=208128&r1=208127&r2=208128&view=diff</a><br>

>> >> >> >><br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> ==============================================================================<br>
>> >> >> >> --- cfe/trunk/test/CodeGenCXX/runtimecc.cpp (original)<br>
>> >> >> >> +++ cfe/trunk/test/CodeGenCXX/runtimecc.cpp Tue May  6 15:32:45<br>
>> >> >> >> 2014<br>
>> >> >> >> @@ -45,7 +45,7 @@ namespace test1 {<br>
>> >> >> >><br>
>> >> >> >>  // CHECK: declare arm_aapcscc void @__cxa_throw(i8*, i8*, i8*)<br>
>> >> >> >><br>
>> >> >> >> -// CHECK-LABEL: define internal arm_aapcscc void @_GLOBAL__I_a()<br>
>> >> >> >> +// CHECK-LABEL: define internal arm_aapcscc void<br>
>> >> >> >> @_GLOBAL__sub_I_runtimecc.cpp()<br>
>> >> >> >>  // CHECK:   call arm_aapcscc void @__cxx_global_var_init()<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> Modified:<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> cfe/trunk/test/CodeGenCXX/static-member-variable-explicit-specialization.cpp<br>
>> >> >> >> URL:<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/static-member-variable-explicit-specialization.cpp?rev=208128&r1=208127&r2=208128&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/static-member-variable-explicit-specialization.cpp?rev=208128&r1=208127&r2=208128&view=diff</a><br>

>> >> >> >><br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> ==============================================================================<br>
>> >> >> >> ---<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> cfe/trunk/test/CodeGenCXX/static-member-variable-explicit-specialization.cpp<br>
>> >> >> >> (original)<br>
>> >> >> >> +++<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> cfe/trunk/test/CodeGenCXX/static-member-variable-explicit-specialization.cpp<br>
>> >> >> >> Tue May  6 15:32:45 2014<br>
>> >> >> >> @@ -19,14 +19,14 @@ template<> int A<bool>::a = 10;<br>
>> >> >> >>  // CHECK:  { i32, void ()* } { i32 65535, void ()*<br>
>> >> >> >> @[[unordered4:[^<br>
>> >> >> >> ]*]] },<br>
>> >> >> >>  // CHECK:  { i32, void ()* } { i32 65535, void ()*<br>
>> >> >> >> @[[unordered5:[^<br>
>> >> >> >> ]*]] },<br>
>> >> >> >>  // CHECK:  { i32, void ()* } { i32 65535, void ()*<br>
>> >> >> >> @[[unordered6:[^<br>
>> >> >> >> ]*]] },<br>
>> >> >> >> -// CHECK:  { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a<br>
>> >> >> >> }]<br>
>> >> >> >> +// CHECK:  { i32, void ()* } { i32 65535, void ()*<br>
>> >> >> >><br>
>> >> >> >> @_GLOBAL__sub_I_static_member_variable_explicit_specialization.cpp<br>
>> >> >> >> }]<br>
>> >> >> >><br>
>> >> >> >>  template int A<short>::a;  // Unordered<br>
>> >> >> >>  int b = foo();<br>
>> >> >> >>  int c = foo();<br>
>> >> >> >>  int d = A<void>::a; // Unordered<br>
>> >> >> >><br>
>> >> >> >> -// An explicit specialization is ordered, and goes in<br>
>> >> >> >> __GLOBAL_I_a.<br>
>> >> >> >> +// An explicit specialization is ordered, and goes in<br>
>> >> >> >><br>
>> >> >> >> __GLOBAL_sub_I_static_member_variable_explicit_specialization.cpp.<br>
>> >> >> >>  template<> struct A<int> { static int a; };<br>
>> >> >> >>  int A<int>::a = foo();<br>
>> >> >> >><br>
>> >> >> >> @@ -82,7 +82,7 @@ template int b::i<int>;<br>
>> >> >> >>  // CHECK: store {{.*}} @_Z1xIcE<br>
>> >> >> >>  // CHECK: ret<br>
>> >> >> >><br>
>> >> >> >> -// CHECK: define internal void @_GLOBAL__I_a()<br>
>> >> >> >> +// CHECK: define internal void<br>
>> >> >> >><br>
>> >> >> >> @_GLOBAL__sub_I_static_member_variable_explicit_specialization.cpp()<br>
>> >> >> >>  //   We call unique stubs for every ordered dynamic initializer<br>
>> >> >> >> in<br>
>> >> >> >> the<br>
>> >> >> >> TU.<br>
>> >> >> >>  // CHECK: call<br>
>> >> >> >>  // CHECK: call<br>
>> >> >> >><br>
>> >> >> >> Modified: cfe/trunk/test/CodeGenObjCXX/<a href="http://arc-globals.mm" target="_blank">arc-globals.mm</a><br>
>> >> >> >> URL:<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/arc-globals.mm?rev=208128&r1=208127&r2=208128&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/arc-globals.mm?rev=208128&r1=208127&r2=208128&view=diff</a><br>

>> >> >> >><br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> ==============================================================================<br>
>> >> >> >> --- cfe/trunk/test/CodeGenObjCXX/<a href="http://arc-globals.mm" target="_blank">arc-globals.mm</a> (original)<br>
>> >> >> >> +++ cfe/trunk/test/CodeGenObjCXX/<a href="http://arc-globals.mm" target="_blank">arc-globals.mm</a> Tue May  6<br>
>> >> >> >> 15:32:45<br>
>> >> >> >> 2014<br>
>> >> >> >> @@ -19,7 +19,7 @@ id global_obj = getObject();<br>
>> >> >> >>  // CHECK-NEXT: ret void<br>
>> >> >> >>  id global_obj2 = getObject();<br>
>> >> >> >><br>
>> >> >> >> -// CHECK-LABEL: define internal void @_GLOBAL__I_a<br>
>> >> >> >> +// CHECK-LABEL: define internal void<br>
>> >> >> >> @_GLOBAL__sub_I_arc_globals.mm<br>
>> >> >> >>  // CHECK: call i8* @objc_autoreleasePoolPush()<br>
>> >> >> >>  // CHECK-NEXT: call void @__cxx_global_var_init<br>
>> >> >> >>  // CHECK-NEXT: call void @__cxx_global_var_init1<br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> _______________________________________________<br>
>> >> >> >> cfe-commits mailing list<br>
>> >> >> >> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
>> >> >> >> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> > --<br>
>> >> > Alexey Samsonov, Mountain View, CA<br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Alexey Samsonov, Mountain View, CA<br>
><br>
><br>
><br>
><br>
> --<br>
> Alexey Samsonov, Mountain View, CA<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Alexey Samsonov, Mountain View, CA</div></div>
</div></div>