summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2013-03-28 18:52:40 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2013-03-28 18:52:40 +0000
commitabfdbdf5bc7e9d202652fe061acd20c14a4d22f4 (patch)
tree1dc079f3dc0cd83d4cb3fc5de8a6b1e4943c5a68 /lib
parent0fd908cf5a555483633e2d9703932bde18009682 (diff)
downloadcompiler-rt-abfdbdf5bc7e9d202652fe061acd20c14a4d22f4.tar.gz
compiler-rt-abfdbdf5bc7e9d202652fe061acd20c14a4d22f4.tar.bz2
compiler-rt-abfdbdf5bc7e9d202652fe061acd20c14a4d22f4.tar.xz
Make all the ALWAYS_INLINE users Windows-friendly; also, avoid ALWAYS_INLINE INLINE combinations
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@178266 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/asan/asan_globals.cc4
-rw-r--r--lib/asan/asan_poisoning.h4
-rw-r--r--lib/sanitizer_common/sanitizer_internal_defs.h4
-rw-r--r--lib/tsan/rtl/tsan_platform.h4
-rw-r--r--lib/tsan/rtl/tsan_rtl.h14
5 files changed, 15 insertions, 15 deletions
diff --git a/lib/asan/asan_globals.cc b/lib/asan/asan_globals.cc
index c54f0cb1..d459dcd5 100644
--- a/lib/asan/asan_globals.cc
+++ b/lib/asan/asan_globals.cc
@@ -41,11 +41,11 @@ typedef InternalVector<Global> VectorOfGlobals;
// Lazy-initialized and never deleted.
static VectorOfGlobals *dynamic_init_globals;
-ALWAYS_INLINE INLINE void PoisonShadowForGlobal(const Global *g, u8 value) {
+ALWAYS_INLINE void PoisonShadowForGlobal(const Global *g, u8 value) {
FastPoisonShadow(g->beg, g->size_with_redzone, value);
}
-ALWAYS_INLINE INLINE void PoisonRedZones(const Global &g) {
+ALWAYS_INLINE void PoisonRedZones(const Global &g) {
uptr aligned_size = RoundUpTo(g.size, SHADOW_GRANULARITY);
FastPoisonShadow(g.beg + aligned_size, g.size_with_redzone - aligned_size,
kAsanGlobalRedzoneMagic);
diff --git a/lib/asan/asan_poisoning.h b/lib/asan/asan_poisoning.h
index 553f7e7d..86f81e5d 100644
--- a/lib/asan/asan_poisoning.h
+++ b/lib/asan/asan_poisoning.h
@@ -31,7 +31,7 @@ void PoisonShadowPartialRightRedzone(uptr addr,
// Fast versions of PoisonShadow and PoisonShadowPartialRightRedzone that
// assume that memory addresses are properly aligned. Use in
// performance-critical code with care.
-ALWAYS_INLINE INLINE void FastPoisonShadow(uptr aligned_beg, uptr aligned_size,
+ALWAYS_INLINE void FastPoisonShadow(uptr aligned_beg, uptr aligned_size,
u8 value) {
DCHECK(flags()->poison_heap);
uptr shadow_beg = MEM_TO_SHADOW(aligned_beg);
@@ -40,7 +40,7 @@ ALWAYS_INLINE INLINE void FastPoisonShadow(uptr aligned_beg, uptr aligned_size,
REAL(memset)((void*)shadow_beg, value, shadow_end - shadow_beg);
}
-ALWAYS_INLINE INLINE void FastPoisonShadowPartialRightRedzone(
+ALWAYS_INLINE void FastPoisonShadowPartialRightRedzone(
uptr aligned_addr, uptr size, uptr redzone_size, u8 value) {
DCHECK(flags()->poison_heap);
u8 *shadow = (u8*)MEM_TO_SHADOW(aligned_addr);
diff --git a/lib/sanitizer_common/sanitizer_internal_defs.h b/lib/sanitizer_common/sanitizer_internal_defs.h
index d1b819db..5533729a 100644
--- a/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -115,7 +115,7 @@ using namespace __sanitizer; // NOLINT
// Platform-specific defs.
#if defined(_MSC_VER)
-# define ALWAYS_INLINE __declspec(forceinline)
+# define ALWAYS_INLINE __forceinline
// FIXME(timurrrr): do we need this on Windows?
# define ALIAS(x)
# define ALIGNED(x) __declspec(align(x))
@@ -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 __attribute__((always_inline))
+# define ALWAYS_INLINE static 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)))
diff --git a/lib/tsan/rtl/tsan_platform.h b/lib/tsan/rtl/tsan_platform.h
index 15b4d107..5c28cda1 100644
--- a/lib/tsan/rtl/tsan_platform.h
+++ b/lib/tsan/rtl/tsan_platform.h
@@ -137,13 +137,13 @@ void WriteMemoryProfile(char *buf, uptr buf_size);
const char *InitializePlatform();
void FinalizePlatform();
-uptr ALWAYS_INLINE INLINE GetThreadTrace(int tid) {
+uptr ALWAYS_INLINE GetThreadTrace(int tid) {
uptr p = kTraceMemBegin + (uptr)(tid * 2) * kTraceSize * sizeof(Event);
DCHECK_LT(p, kTraceMemBegin + kTraceMemSize);
return p;
}
-uptr ALWAYS_INLINE INLINE GetThreadTraceHeader(int tid) {
+uptr ALWAYS_INLINE GetThreadTraceHeader(int tid) {
uptr p = kTraceMemBegin + (uptr)(tid * 2 + 1) * kTraceSize * sizeof(Event);
DCHECK_LT(p, kTraceMemBegin + kTraceMemSize);
return p;
diff --git a/lib/tsan/rtl/tsan_rtl.h b/lib/tsan/rtl/tsan_rtl.h
index b7ec804d..983be137 100644
--- a/lib/tsan/rtl/tsan_rtl.h
+++ b/lib/tsan/rtl/tsan_rtl.h
@@ -580,11 +580,11 @@ void RestoreStack(int tid, const u64 epoch, StackTrace *stk, MutexSet *mset);
void StatAggregate(u64 *dst, u64 *src);
void StatOutput(u64 *stat);
-void ALWAYS_INLINE INLINE StatInc(ThreadState *thr, StatType typ, u64 n = 1) {
+void ALWAYS_INLINE StatInc(ThreadState *thr, StatType typ, u64 n = 1) {
if (kCollectStats)
thr->stat[typ] += n;
}
-void ALWAYS_INLINE INLINE StatSet(ThreadState *thr, StatType typ, u64 n) {
+void ALWAYS_INLINE StatSet(ThreadState *thr, StatType typ, u64 n) {
if (kCollectStats)
thr->stat[typ] = n;
}
@@ -647,22 +647,22 @@ const int kSizeLog2 = 1;
const int kSizeLog4 = 2;
const int kSizeLog8 = 3;
-void ALWAYS_INLINE INLINE MemoryRead(ThreadState *thr, uptr pc,
+void ALWAYS_INLINE MemoryRead(ThreadState *thr, uptr pc,
uptr addr, int kAccessSizeLog) {
MemoryAccess(thr, pc, addr, kAccessSizeLog, false, false);
}
-void ALWAYS_INLINE INLINE MemoryWrite(ThreadState *thr, uptr pc,
+void ALWAYS_INLINE MemoryWrite(ThreadState *thr, uptr pc,
uptr addr, int kAccessSizeLog) {
MemoryAccess(thr, pc, addr, kAccessSizeLog, true, false);
}
-void ALWAYS_INLINE INLINE MemoryReadAtomic(ThreadState *thr, uptr pc,
+void ALWAYS_INLINE MemoryReadAtomic(ThreadState *thr, uptr pc,
uptr addr, int kAccessSizeLog) {
MemoryAccess(thr, pc, addr, kAccessSizeLog, false, true);
}
-void ALWAYS_INLINE INLINE MemoryWriteAtomic(ThreadState *thr, uptr pc,
+void ALWAYS_INLINE MemoryWriteAtomic(ThreadState *thr, uptr pc,
uptr addr, int kAccessSizeLog) {
MemoryAccess(thr, pc, addr, kAccessSizeLog, true, true);
}
@@ -729,7 +729,7 @@ uptr TraceParts();
Trace *ThreadTrace(int tid);
extern "C" void __tsan_trace_switch();
-void ALWAYS_INLINE INLINE TraceAddEvent(ThreadState *thr, FastState fs,
+void ALWAYS_INLINE TraceAddEvent(ThreadState *thr, FastState fs,
EventType typ, u64 addr) {
DCHECK_GE((int)typ, 0);
DCHECK_LE((int)typ, 7);