<div dir="ltr">Nice cleanup!</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 10:17 AM, Xinliang David Li 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: davidxl<br>
Date: Thu Dec 10 12:17:01 2015<br>
New Revision: 255270<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=255270&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=255270&view=rev</a><br>
Log:<br>
[PGO] Header file cleanup (NFC)<br>
<br>
InstrProfiling.h file declares profile runtime public APIs.<br>
It has become a dumping place for many different things, which<br>
needs cleanups. In this change, core type declarations and<br>
portability macros are moved to a new file InstrProfilingPort.h.<br>
<br>
<br>
<br>
<br>
Added:<br>
    compiler-rt/trunk/lib/profile/InstrProfilingPort.h<br>
Modified:<br>
    compiler-rt/trunk/lib/profile/InstrProfiling.h<br>
<br>
Modified: compiler-rt/trunk/lib/profile/InstrProfiling.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfiling.h?rev=255270&r1=255269&r2=255270&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfiling.h?rev=255270&r1=255269&r2=255270&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/profile/InstrProfiling.h (original)<br>
+++ compiler-rt/trunk/lib/profile/InstrProfiling.h Thu Dec 10 12:17:01 2015<br>
@@ -10,47 +10,7 @@<br>
 #ifndef PROFILE_INSTRPROFILING_H_<br>
 #define PROFILE_INSTRPROFILING_H_<br>
<br>
-#ifdef _MSC_VER<br>
-# define LLVM_ALIGNAS(x) __declspec(align(x))<br>
-#elif __GNUC__<br>
-#define LLVM_ALIGNAS(x) __attribute__((aligned(x)))<br>
-#endif<br>
-<br>
-#define LLVM_LIBRARY_VISIBILITY __attribute__((visibility("hidden")))<br>
-#define LLVM_SECTION(Sect) __attribute__((section(Sect)))<br>
-<br>
-#define PROF_ERR(Format, ...)                                                  \<br>
-  if (GetEnvHook && GetEnvHook("LLVM_PROFILE_VERBOSE_ERRORS"))                 \<br>
-    fprintf(stderr, Format, __VA_ARGS__);<br>
-<br>
-extern char *(*GetEnvHook)(const char *);<br>
-<br>
-#if defined(__FreeBSD__) && defined(__i386__)<br>
-<br>
-/* System headers define 'size_t' incorrectly on x64 FreeBSD (prior to<br>
- * FreeBSD 10, r232261) when compiled in 32-bit mode.<br>
- */<br>
-#define PRIu64 "llu"<br>
-typedef unsigned char uint8_t;<br>
-typedef unsigned short uint16_t;<br>
-typedef unsigned int uint32_t;<br>
-typedef unsigned long long uint64_t;<br>
-typedef uint32_t uintptr_t;<br>
-#elif defined(__FreeBSD__) && defined(__x86_64__)<br>
-#define PRIu64 "lu"<br>
-typedef unsigned char uint8_t;<br>
-typedef unsigned short uint16_t;<br>
-typedef unsigned int uint32_t;<br>
-typedef unsigned long long uint64_t;<br>
-typedef unsigned long int uintptr_t;<br>
-<br>
-#else /* defined(__FreeBSD__) && defined(__i386__) */<br>
-<br>
-#include <inttypes.h><br>
-#include <stdint.h><br>
-<br>
-#endif /* defined(__FreeBSD__) && defined(__i386__) */<br>
-<br>
+#include "InstrProfilingPort.h"<br>
 #include "InstrProfData.inc"<br>
<br>
 enum ValueKind {<br>
<br>
Added: compiler-rt/trunk/lib/profile/InstrProfilingPort.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPort.h?rev=255270&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPort.h?rev=255270&view=auto</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/profile/InstrProfilingPort.h (added)<br>
+++ compiler-rt/trunk/lib/profile/InstrProfilingPort.h Thu Dec 10 12:17:01 2015<br>
@@ -0,0 +1,54 @@<br>
+/*===- InstrProfilingPort.h- Support library for PGO instrumentation ------===*\<br>
+|*<br>
+|*                     The LLVM Compiler Infrastructure<br>
+|*<br>
+|* This file is distributed under the University of Illinois Open Source<br>
+|* License. See LICENSE.TXT for details.<br>
+|*<br>
+\*===----------------------------------------------------------------------===*/<br>
+<br>
+#ifndef PROFILE_INSTRPROFILING_PORT_H_<br>
+#define PROFILE_INSTRPROFILING_PORT_H_<br>
+<br>
+#ifdef _MSC_VER<br>
+# define LLVM_ALIGNAS(x) __declspec(align(x))<br>
+#elif __GNUC__<br>
+#define LLVM_ALIGNAS(x) __attribute__((aligned(x)))<br>
+#endif<br>
+<br>
+#define LLVM_LIBRARY_VISIBILITY __attribute__((visibility("hidden")))<br>
+#define LLVM_SECTION(Sect) __attribute__((section(Sect)))<br>
+<br>
+#define PROF_ERR(Format, ...)                                                  \<br>
+  if (GetEnvHook && GetEnvHook("LLVM_PROFILE_VERBOSE_ERRORS"))                 \<br>
+    fprintf(stderr, Format, __VA_ARGS__);<br>
+<br>
+extern char *(*GetEnvHook)(const char *);<br>
+<br>
+#if defined(__FreeBSD__) && defined(__i386__)<br>
+<br>
+/* System headers define 'size_t' incorrectly on x64 FreeBSD (prior to<br>
+ * FreeBSD 10, r232261) when compiled in 32-bit mode.<br>
+ */<br>
+#define PRIu64 "llu"<br>
+typedef unsigned char uint8_t;<br>
+typedef unsigned short uint16_t;<br>
+typedef unsigned int uint32_t;<br>
+typedef unsigned long long uint64_t;<br>
+typedef uint32_t uintptr_t;<br>
+#elif defined(__FreeBSD__) && defined(__x86_64__)<br>
+#define PRIu64 "lu"<br>
+typedef unsigned char uint8_t;<br>
+typedef unsigned short uint16_t;<br>
+typedef unsigned int uint32_t;<br>
+typedef unsigned long long uint64_t;<br>
+typedef unsigned long int uintptr_t;<br>
+<br>
+#else /* defined(__FreeBSD__) && defined(__i386__) */<br>
+<br>
+#include <inttypes.h><br>
+#include <stdint.h><br>
+<br>
+#endif /* defined(__FreeBSD__) && defined(__i386__) */<br>
+<br>
+#endif /* PROFILE_INSTRPROFILING_PORT_H_ */<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>