<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 7, 2016 at 5:44 PM, Vedant Kumar via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: vedantk<br>
Date: Tue Jun  7 19:44:38 2016<br>
New Revision: 272081<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=272081&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=272081&view=rev</a><br>
Log:<br>
[profile] Hide a few external symbols (NFCI)<br>
<br>
There are still a few external symbols visible from InstrProfData.inc.<br>
The plan for dealing with those isn't as straightforward, so I'll try it<br>
in a separate commit.<br>
<br>
Modified:<br>
    compiler-rt/trunk/lib/profile/InstrProfiling.c<br>
    compiler-rt/trunk/lib/profile/InstrProfilingFile.c<br>
    compiler-rt/trunk/lib/profile/InstrProfilingUtil.c<br>
<br>
Modified: compiler-rt/trunk/lib/profile/InstrProfiling.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfiling.c?rev=272081&r1=272080&r2=272081&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfiling.c?rev=272081&r1=272080&r2=272081&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/profile/InstrProfiling.c (original)<br>
+++ compiler-rt/trunk/lib/profile/InstrProfiling.c Tue Jun  7 19:44:38 2016<br>
@@ -18,7 +18,8 @@<br>
<br>
 COMPILER_RT_VISIBILITY char *(*GetEnvHook)(const char *) = 0;<br>
<br>
-COMPILER_RT_WEAK uint64_t __llvm_profile_raw_version = INSTR_PROF_RAW_VERSION;<br>
+COMPILER_RT_VISIBILITY COMPILER_RT_WEAK uint64_t __llvm_profile_raw_version =<br>
+    INSTR_PROF_RAW_VERSION;<br></blockquote><div><br></div><div>There is no need for this one to be hidden (see comments in  InstrProfiling.h). </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
 COMPILER_RT_VISIBILITY uint64_t __llvm_profile_get_magic(void) {<br>
   return sizeof(void *) == sizeof(uint64_t) ? (INSTR_PROF_RAW_MAGIC_64)<br>
<br>
Modified: compiler-rt/trunk/lib/profile/InstrProfilingFile.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingFile.c?rev=272081&r1=272080&r2=272081&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingFile.c?rev=272081&r1=272080&r2=272081&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/profile/InstrProfilingFile.c (original)<br>
+++ compiler-rt/trunk/lib/profile/InstrProfilingFile.c Tue Jun  7 19:44:38 2016<br>
@@ -30,7 +30,7 @@ typedef struct lprofFilename {<br>
   unsigned NumHosts;<br>
 } lprofFilename;<br>
<br>
-lprofFilename lprofCurFilename = {0, {0}, {0}, 0, 0};<br>
+COMPILER_RT_VISIBILITY lprofFilename lprofCurFilename = {0, {0}, {0}, 0, 0};<br></blockquote><div><br></div><div>This changes the behavior -- the original __llvm_profile_CurrentFilename was intended to be non-hidden -- so that share libraries and main program can share the same file name. It is debatable whether this is a good behavior, but it may require a separate discussion.</div><div><br></div><div>David</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
 int getpid(void);<br>
 static int getCurFilenameLength();<br>
<br>
Modified: compiler-rt/trunk/lib/profile/InstrProfilingUtil.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingUtil.c?rev=272081&r1=272080&r2=272081&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingUtil.c?rev=272081&r1=272080&r2=272081&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/profile/InstrProfilingUtil.c (original)<br>
+++ compiler-rt/trunk/lib/profile/InstrProfilingUtil.c Tue Jun  7 19:44:38 2016<br>
@@ -67,7 +67,7 @@ void *lprofPtrFetchAdd(void **Mem, long<br>
 #endif<br>
<br>
 #ifdef COMPILER_RT_HAS_UNAME<br>
-int lprofGetHostName(char *Name, int Len) {<br>
+COMPILER_RT_VISIBILITY int lprofGetHostName(char *Name, int Len) {<br>
   struct utsname N;<br>
   int R;<br>
   if (!(R = uname(&N)))<br>
@@ -76,7 +76,7 @@ int lprofGetHostName(char *Name, int Len<br>
 }<br>
 #endif<br>
<br>
-FILE *lprofOpenFileEx(const char *ProfileName) {<br>
+COMPILER_RT_VISIBILITY FILE *lprofOpenFileEx(const char *ProfileName) {<br>
   FILE *f;<br>
   int fd;<br>
 #ifdef COMPILER_RT_HAS_FCNTL_LCK<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>