<div dir="ltr"><div class="gmail_extra">On 27 February 2013 00:09, Alexey Samsonov <span dir="ltr"><<a href="mailto:samsonov@google.com" target="_blank">samsonov@google.com</a>></span> wrote:<br><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi!<div><br></div><div>I see the following error on our Windows buildbot, can it be caused by your change?</div>

</div></blockquote><div><br></div>Yep, that's my fault. Should be fixed in r176176!<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir="ltr">3> GCDAProfiling.c 3>..\..\..\llvm\runtime\libprofile\GCDAProfiling.c(172): error C2275: 'uint32_t' : illegal use of this type as an expression 3> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h(23) : see declaration of 'uint32_t' 3>..\..\..\llvm\runtime\libprofile\GCDAProfiling.c(172): error C2146: syntax error : missing ';' before identifier 'len' 3>..\..\..\llvm\runtime\libprofile\GCDAProfiling.c(172): error C2065: 'len' : undeclared identifier 3>..\..\..\llvm\runtime\libprofile\GCDAProfiling.c(174): error C2065: 'len' : undeclared identifier 3>..\..\..\llvm\runtime\libprofile\GCDAProfiling.c(175): error C2065: 'len' : undeclared identifier 4> GCDAProfiling.c 4>..\..\..\llvm\runtime\libprofile\GCDAProfiling.c(172): error C2275: 'uint32_t' : illegal use of this type as an expression 4> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h(23) : see declaration of 'uint32_t' 4>..\..\..\llvm\runtime\libprofile\GCDAProfiling.c(172): error C2146: syntax error : missing ';' before identifier 'len' 4>..\..\..\llvm\runtime\libprofile\GCDAProfiling.c(172): error C2065: 'len' : undeclared identifier 4>..\..\..\llvm\runtime\libprofile\GCDAProfiling.c(174): error C2065: 'len' : undeclared identifier 4>..\..\..\llvm\runtime\libprofile\GCDAProfiling.c(175): error C2065: 'len' : undeclared identifier</div>


<div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Wed, Feb 27, 2013 at 10:22 AM, Nick Lewycky <span dir="ltr"><<a href="mailto:nicholas@mxc.ca" target="_blank">nicholas@mxc.ca</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Author: nicholas<br>
Date: Wed Feb 27 00:22:56 2013<br>
New Revision: 176173<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=176173&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=176173&view=rev</a><br>
Log:<br>
In GCC 4.7, function names are now forbidden from .gcda files. Support this by<br>
passing a null pointer to the function name in to GCDAProfiling, and add another<br>
switch onto GCOVProfiling.<br>
<br>
Modified:<br>
    llvm/trunk/include/llvm/Transforms/Instrumentation.h<br>
    llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp<br>
    llvm/trunk/runtime/libprofile/GCDAProfiling.c<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/Instrumentation.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Instrumentation.h?rev=176173&r1=176172&r2=176173&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Instrumentation.h?rev=176173&r1=176172&r2=176173&view=diff</a><br>



==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/Instrumentation.h (original)<br>
+++ llvm/trunk/include/llvm/Transforms/Instrumentation.h Wed Feb 27 00:22:56 2013<br>
@@ -34,7 +34,8 @@ ModulePass *createPathProfilerPass();<br>
 ModulePass *createGCOVProfilerPass(bool EmitNotes = true, bool EmitData = true,<br>
                                    bool Use402Format = false,<br>
                                    bool UseExtraChecksum = false,<br>
-                                   bool NoRedZone = false);<br>
+                                   bool NoRedZone = false,<br>
+                                   bool NoFunctionNamesInData = false);<br>
<br>
 // Insert AddressSanitizer (address sanity checking) instrumentation<br>
 FunctionPass *createAddressSanitizerFunctionPass(<br>
<br>
Modified: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=176173&r1=176172&r2=176173&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=176173&r1=176172&r2=176173&view=diff</a><br>



==============================================================================<br>
--- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Wed Feb 27 00:22:56 2013<br>
@@ -45,14 +45,16 @@ namespace {<br>
     static char ID;<br>
     GCOVProfiler()<br>
         : ModulePass(ID), EmitNotes(true), EmitData(true), Use402Format(false),<br>
-          UseExtraChecksum(false), NoRedZone(false) {<br>
+          UseExtraChecksum(false), NoRedZone(false),<br>
+          NoFunctionNamesInData(false) {<br>
       initializeGCOVProfilerPass(*PassRegistry::getPassRegistry());<br>
     }<br>
-    GCOVProfiler(bool EmitNotes, bool EmitData, bool use402Format,<br>
-                 bool useExtraChecksum, bool NoRedZone_)<br>
+    GCOVProfiler(bool EmitNotes, bool EmitData, bool Use402Format,<br>
+                 bool UseExtraChecksum, bool NoRedZone,<br>
+                 bool NoFunctionNamesInData)<br>
         : ModulePass(ID), EmitNotes(EmitNotes), EmitData(EmitData),<br>
-          Use402Format(use402Format), UseExtraChecksum(useExtraChecksum),<br>
-          NoRedZone(NoRedZone_) {<br>
+          Use402Format(Use402Format), UseExtraChecksum(UseExtraChecksum),<br>
+          NoRedZone(NoRedZone), NoFunctionNamesInData(NoFunctionNamesInData) {<br>
       assert((EmitNotes || EmitData) && "GCOVProfiler asked to do nothing?");<br>
       initializeGCOVProfilerPass(*PassRegistry::getPassRegistry());<br>
     }<br>
@@ -100,6 +102,7 @@ namespace {<br>
     bool Use402Format;<br>
     bool UseExtraChecksum;<br>
     bool NoRedZone;<br>
+    bool NoFunctionNamesInData;<br>
<br>
     Module *M;<br>
     LLVMContext *Ctx;<br>
@@ -113,9 +116,10 @@ INITIALIZE_PASS(GCOVProfiler, "insert-gc<br>
 ModulePass *llvm::createGCOVProfilerPass(bool EmitNotes, bool EmitData,<br>
                                          bool Use402Format,<br>
                                          bool UseExtraChecksum,<br>
-                                         bool NoRedZone) {<br>
+                                         bool NoRedZone,<br>
+                                         bool NoFunctionNamesInData) {<br>
   return new GCOVProfiler(EmitNotes, EmitData, Use402Format, UseExtraChecksum,<br>
-                          NoRedZone);<br>
+                          NoRedZone, NoFunctionNamesInData);<br>
 }<br>
<br>
 namespace {<br>
@@ -664,7 +668,9 @@ void GCOVProfiler::insertCounterWriteout<br>
         intptr_t ident = reinterpret_cast<intptr_t>(I->second);<br>
         Builder.CreateCall2(EmitFunction,<br>
                             Builder.getInt32(ident),<br>
-                            Builder.CreateGlobalStringPtr(SP.getName()));<br>
+                            NoFunctionNamesInData ?<br>
+                              Constant::getNullValue(Builder.getInt8PtrTy()) :<br>
+                              Builder.CreateGlobalStringPtr(SP.getName()));<br>
<br>
         GlobalVariable *GV = I->first;<br>
         unsigned Arcs =<br>
<br>
Modified: llvm/trunk/runtime/libprofile/GCDAProfiling.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/runtime/libprofile/GCDAProfiling.c?rev=176173&r1=176172&r2=176173&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/runtime/libprofile/GCDAProfiling.c?rev=176173&r1=176172&r2=176173&view=diff</a><br>



==============================================================================<br>
--- llvm/trunk/runtime/libprofile/GCDAProfiling.c (original)<br>
+++ llvm/trunk/runtime/libprofile/GCDAProfiling.c Wed Feb 27 00:22:56 2013<br>
@@ -162,17 +162,22 @@ void llvm_gcda_increment_indirect_counte<br>
<br>
 void llvm_gcda_emit_function(uint32_t ident, const char *function_name) {<br>
 #ifdef DEBUG_GCDAPROFILING<br>
-  printf("llvmgcda: function id=%x\n", ident);<br>
+  printf("llvmgcda: function id=%x name=%s\n", ident,<br>
+         function_name ? function_name : "NULL");<br>
 #endif<br>
   if (!output_file) return;<br>
<br>
   /* function tag */<br>
   fwrite("\0\0\0\1", 4, 1, output_file);<br>
-  write_int32(3 + 1 + length_of_string(function_name));<br>
+  uint32_t len = 3;<br>
+  if (function_name)<br>
+    len += 1 + length_of_string(function_name);<br>
+  write_int32(len);<br>
   write_int32(ident);<br>
   write_int32(0);<br>
   write_int32(0);<br>
-  write_string(function_name);<br>
+  if (function_name)<br>
+    write_string(function_name);<br>
 }<br>
<br>
 void llvm_gcda_emit_arcs(uint32_t num_counters, uint64_t *counters) {<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class=""><font color="#888888">-- <br><div>Alexey Samsonov, MSK</div>
</font></span></div>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div></div>