[tsan] restore performance critical inlining in tsan: remove static from ALWAYS_INLIN...
authorKostya Serebryany <kcc@google.com>
Fri, 29 Mar 2013 09:44:16 +0000 (09:44 +0000)
committerKostya Serebryany <kcc@google.com>
Fri, 29 Mar 2013 09:44:16 +0000 (09:44 +0000)
llvm-svn: 178341

compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
compiler-rt/lib/tsan/rtl/tsan_rtl.cc

index e5a7fb7..8c0e601 100644 (file)
@@ -130,7 +130,7 @@ using namespace __sanitizer;  // NOLINT
 # define USED
 # define PREFETCH(x) /* _mm_prefetch(x, _MM_HINT_NTA) */
 #else  // _MSC_VER
-# define ALWAYS_INLINE static inline __attribute__((always_inline))
+# define ALWAYS_INLINE inline __attribute__((always_inline))
 # define ALIAS(x) __attribute__((alias(x)))
 # define ALIGNED(x) __attribute__((aligned(x)))
 # define FORMAT(f, a)  __attribute__((format(printf, f, a)))
index 3686874..9209cd7 100644 (file)
@@ -385,7 +385,7 @@ static inline bool HappensBefore(Shadow old, ThreadState *thr) {
   return thr->clock.get(old.TidWithIgnore()) >= old.epoch();
 }
 
-// FIXME: should be ALWAYS_INLINE for performance reasons?
+ALWAYS_INLINE USED
 void MemoryAccessImpl(ThreadState *thr, uptr addr,
     int kAccessSizeLog, bool kAccessIsWrite, bool kIsAtomic,
     u64 *shadow_mem, Shadow cur) {
@@ -459,7 +459,7 @@ void MemoryAccessImpl(ThreadState *thr, uptr addr,
   return;
 }
 
-// FIXME: should be ALWAYS_INLINE for performance reasons?
+ALWAYS_INLINE USED
 void MemoryAccess(ThreadState *thr, uptr pc, uptr addr,
     int kAccessSizeLog, bool kAccessIsWrite, bool kIsAtomic) {
   u64 *shadow_mem = (u64*)MemToShadow(addr);
@@ -597,7 +597,7 @@ void MemoryRangeImitateWrite(ThreadState *thr, uptr pc, uptr addr, uptr size) {
   MemoryRangeSet(thr, pc, addr, size, s.raw());
 }
 
-// FIXME: should be ALWAYS_INLINE for performance reasons?
+ALWAYS_INLINE USED
 void FuncEntry(ThreadState *thr, uptr pc) {
   DCHECK_EQ(thr->in_rtl, 0);
   StatInc(thr, StatFuncEnter);
@@ -627,7 +627,7 @@ void FuncEntry(ThreadState *thr, uptr pc) {
   thr->shadow_stack_pos++;
 }
 
-// FIXME: should be ALWAYS_INLINE for performance reasons?
+ALWAYS_INLINE USED
 void FuncExit(ThreadState *thr) {
   DCHECK_EQ(thr->in_rtl, 0);
   StatInc(thr, StatFuncExit);