<div dir="ltr">Reverted in r201916, since __func__ isn't available in versions of MSVC that we support.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 21, 2014 at 3:55 PM, Joerg Sonnenberger <span dir="ltr"><<a href="mailto:joerg@bec.de" target="_blank">joerg@bec.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: joerg<br>
Date: Fri Feb 21 17:55:15 2014<br>
New Revision: 201910<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=201910&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=201910&view=rev</a><br>
Log:<br>
Replace __FUNCTION__ with __func__, the latter being standard C99/C++11.<br>
<br>
Modified:<br>
compiler-rt/trunk/lib/asan/asan_report.cc<br>
compiler-rt/trunk/lib/asan/asan_thread.cc<br>
compiler-rt/trunk/lib/asan/tests/asan_racy_double_free_test.cc<br>
compiler-rt/trunk/lib/builtins/int_util.h<br>
compiler-rt/trunk/lib/msan/msan_interceptors.cc<br>
compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.cc<br>
compiler-rt/trunk/lib/sanitizer_common/sanitizer_bitvector.h<br>
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc<br>
compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc<br>
compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_interface_ann.cc<br>
compiler-rt/trunk/lib/tsan/rtl/tsan_interface_atomic.cc<br>
<br>
Modified: compiler-rt/trunk/lib/asan/asan_report.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=201910&r1=201909&r2=201910&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=201910&r1=201909&r2=201910&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/asan/asan_report.cc (original)<br>
+++ compiler-rt/trunk/lib/asan/asan_report.cc Fri Feb 21 17:55:15 2014<br>
@@ -835,7 +835,7 @@ void NOINLINE __asan_set_error_report_ca<br>
if (callback) {<br>
error_message_buffer_size = 1 << 16;<br>
error_message_buffer =<br>
- (char*)MmapOrDie(error_message_buffer_size, __FUNCTION__);<br>
+ (char*)MmapOrDie(error_message_buffer_size, __func__);<br>
error_message_buffer_pos = 0;<br>
}<br>
}<br>
<br>
Modified: compiler-rt/trunk/lib/asan/asan_thread.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_thread.cc?rev=201910&r1=201909&r2=201910&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_thread.cc?rev=201910&r1=201909&r2=201910&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/asan/asan_thread.cc (original)<br>
+++ compiler-rt/trunk/lib/asan/asan_thread.cc Fri Feb 21 17:55:15 2014<br>
@@ -79,7 +79,7 @@ AsanThread *AsanThread::Create(thread_ca<br>
void *arg) {<br>
uptr PageSize = GetPageSizeCached();<br>
uptr size = RoundUpTo(sizeof(AsanThread), PageSize);<br>
- AsanThread *thread = (AsanThread*)MmapOrDie(size, __FUNCTION__);<br>
+ AsanThread *thread = (AsanThread*)MmapOrDie(size, __func__);<br>
thread->start_routine_ = start_routine;<br>
thread->arg_ = arg;<br>
<br>
<br>
Modified: compiler-rt/trunk/lib/asan/tests/asan_racy_double_free_test.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_racy_double_free_test.cc?rev=201910&r1=201909&r2=201910&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_racy_double_free_test.cc?rev=201910&r1=201909&r2=201910&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/asan/tests/asan_racy_double_free_test.cc (original)<br>
+++ compiler-rt/trunk/lib/asan/tests/asan_racy_double_free_test.cc Fri Feb 21 17:55:15 2014<br>
@@ -7,7 +7,7 @@ void *x[N];<br>
<br>
void *Thread1(void *unused) {<br>
for (int i = 0; i < N; i++) {<br>
- fprintf(stderr, "%s %d\n", __FUNCTION__, i);<br>
+ fprintf(stderr, "%s %d\n", __func__, i);<br>
free(x[i]);<br>
}<br>
return NULL;<br>
@@ -15,7 +15,7 @@ void *Thread1(void *unused) {<br>
<br>
void *Thread2(void *unused) {<br>
for (int i = 0; i < N; i++) {<br>
- fprintf(stderr, "%s %d\n", __FUNCTION__, i);<br>
+ fprintf(stderr, "%s %d\n", __func__, i);<br>
free(x[i]);<br>
}<br>
return NULL;<br>
<br>
Modified: compiler-rt/trunk/lib/builtins/int_util.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/int_util.h?rev=201910&r1=201909&r2=201910&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/int_util.h?rev=201910&r1=201909&r2=201910&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/builtins/int_util.h (original)<br>
+++ compiler-rt/trunk/lib/builtins/int_util.h Fri Feb 21 17:55:15 2014<br>
@@ -21,7 +21,7 @@<br>
<br>
/** \brief Trigger a program abort (or panic for kernel code). */<br>
#define compilerrt_abort() compilerrt_abort_impl(__FILE__, __LINE__, \<br>
- __FUNCTION__)<br>
+ __func__)<br>
<br>
void compilerrt_abort_impl(const char *file, int line,<br>
const char *function) __attribute__((noreturn));<br>
<br>
Modified: compiler-rt/trunk/lib/msan/msan_interceptors.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interceptors.cc?rev=201910&r1=201909&r2=201910&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interceptors.cc?rev=201910&r1=201909&r2=201910&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/msan/msan_interceptors.cc (original)<br>
+++ compiler-rt/trunk/lib/msan/msan_interceptors.cc Fri Feb 21 17:55:15 2014<br>
@@ -68,7 +68,7 @@ bool IsInInterceptorScope() {<br>
if (offset >= 0 && __msan::flags()->report_umrs) { \<br>
GET_CALLER_PC_BP_SP; \<br>
(void) sp; \<br>
- Printf("UMR in %s at offset %d inside [%p, +%d) \n", __FUNCTION__, \<br>
+ Printf("UMR in %s at offset %d inside [%p, +%d) \n", __func__, \<br>
offset, x, n); \<br>
__msan::PrintWarningWithOrigin(pc, bp, \<br>
__msan_get_origin((char *)x + offset)); \<br>
<br>
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.cc?rev=201910&r1=201909&r2=201910&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.cc?rev=201910&r1=201909&r2=201910&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.cc (original)<br>
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.cc Fri Feb 21 17:55:15 2014<br>
@@ -117,7 +117,7 @@ void *LowLevelAllocator::Allocate(uptr s<br>
if (allocated_end_ - allocated_current_ < (sptr)size) {<br>
uptr size_to_allocate = Max(size, GetPageSizeCached());<br>
allocated_current_ =<br>
- (char*)MmapOrDie(size_to_allocate, __FUNCTION__);<br>
+ (char*)MmapOrDie(size_to_allocate, __func__);<br>
allocated_end_ = allocated_current_ + size_to_allocate;<br>
if (low_level_alloc_callback) {<br>
low_level_alloc_callback((uptr)allocated_current_,<br>
<br>
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_bitvector.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_bitvector.h?rev=201910&r1=201909&r2=201910&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_bitvector.h?rev=201910&r1=201909&r2=201910&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_bitvector.h (original)<br>
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_bitvector.h Fri Feb 21 17:55:15 2014<br>
@@ -149,7 +149,7 @@ class TwoLevelBitVector {<br>
l2_[i0][i1].clear();<br>
}<br>
bool res = l2_[i0][i1].setBit(i2);<br>
- // Printf("%s: %zd => %zd %zd %zd; %d\n", __FUNCTION__,<br>
+ // Printf("%s: %zd => %zd %zd %zd; %d\n", __func__,<br>
// idx, i0, i1, i2, res);<br>
return res;<br>
}<br>
@@ -173,7 +173,7 @@ class TwoLevelBitVector {<br>
uptr i0 = idx0(idx);<br>
uptr i1 = idx1(idx);<br>
uptr i2 = idx2(idx);<br>
- // Printf("%s: %zd => %zd %zd %zd\n", __FUNCTION__, idx, i0, i1, i2);<br>
+ // Printf("%s: %zd => %zd %zd %zd\n", __func__, idx, i0, i1, i2);<br>
return l1_[i0].getBit(i1) && l2_[i0][i1].getBit(i2);<br>
}<br>
<br>
<br>
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc?rev=201910&r1=201909&r2=201910&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc?rev=201910&r1=201909&r2=201910&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc (original)<br>
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc Fri Feb 21 17:55:15 2014<br>
@@ -93,7 +93,7 @@ uptr ReadFileToBuffer(const char *file_n<br>
if (internal_iserror(openrv)) return 0;<br>
fd_t fd = openrv;<br>
UnmapOrDie(*buff, *buff_size);<br>
- *buff = (char*)MmapOrDie(size, __FUNCTION__);<br>
+ *buff = (char*)MmapOrDie(size, __func__);<br>
*buff_size = size;<br>
// Read up to one page at a time.<br>
read_len = 0;<br>
<br>
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc?rev=201910&r1=201909&r2=201910&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc?rev=201910&r1=201909&r2=201910&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc (original)<br>
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc Fri Feb 21 17:55:15 2014<br>
@@ -178,7 +178,7 @@ void DumpProcessMap() {<br>
MemoryMappingLayout proc_maps(/*cache_enabled*/true);<br>
uptr start, end;<br>
const sptr kBufSize = 4095;<br>
- char *filename = (char*)MmapOrDie(kBufSize, __FUNCTION__);<br>
+ char *filename = (char*)MmapOrDie(kBufSize, __func__);<br>
Report("Process memory map follows:\n");<br>
while (proc_maps.Next(&start, &end, /* file_offset */0,<br>
filename, kBufSize, /* protection */0)) {<br>
<br>
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc?rev=201910&r1=201909&r2=201910&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc?rev=201910&r1=201909&r2=201910&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc (original)<br>
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc Fri Feb 21 17:55:15 2014<br>
@@ -105,7 +105,7 @@ void SetAlternateSignalStack() {<br>
// TODO(glider): the mapped stack should have the MAP_STACK flag in the<br>
// future. It is not required by man 2 sigaltstack now (they're using<br>
// malloc()).<br>
- void* base = MmapOrDie(kAltStackSize, __FUNCTION__);<br>
+ void* base = MmapOrDie(kAltStackSize, __func__);<br>
altstack.ss_sp = base;<br>
altstack.ss_flags = 0;<br>
altstack.ss_size = kAltStackSize;<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interface_ann.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interface_ann.cc?rev=201910&r1=201909&r2=201910&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interface_ann.cc?rev=201910&r1=201909&r2=201910&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interface_ann.cc (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interface_ann.cc Fri Feb 21 17:55:15 2014<br>
@@ -52,7 +52,7 @@ class ScopedAnnotation {<br>
const uptr caller_pc = (uptr)__builtin_return_address(0); \<br>
StatInc(thr, StatAnnotation); \<br>
StatInc(thr, Stat##typ); \<br>
- ScopedAnnotation sa(thr, __FUNCTION__, f, l, caller_pc); \<br>
+ ScopedAnnotation sa(thr, __func__, f, l, caller_pc); \<br>
const uptr pc = __sanitizer::StackTrace::GetCurrentPc(); \<br>
(void)pc; \<br>
/**/<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interface_atomic.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interface_atomic.cc?rev=201910&r1=201909&r2=201910&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interface_atomic.cc?rev=201910&r1=201909&r2=201910&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interface_atomic.cc (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interface_atomic.cc Fri Feb 21 17:55:15 2014<br>
@@ -35,7 +35,7 @@ using namespace __tsan; // NOLINT<br>
if (thr->ignore_interceptors) \<br>
return NoTsanAtomic##func(__VA_ARGS__); \<br>
AtomicStatInc(thr, sizeof(*a), mo, StatAtomic##func); \<br>
- ScopedAtomic sa(thr, callpc, a, mo, __FUNCTION__); \<br>
+ ScopedAtomic sa(thr, callpc, a, mo, __func__); \<br>
return Atomic##func(thr, pc, __VA_ARGS__); \<br>
/**/<br>
<br>
<br>
<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>
</blockquote></div><br></div>