Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2017)

Unified Diff: Source/wtf/InstanceCounter.cpp

Issue 304033004: InstanceCounter/Oilpan GC tracing: Add clang support (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: objectGraphMutex Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« Source/platform/heap/Heap.cpp ('K') | « Source/platform/heap/Heap.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/InstanceCounter.cpp
diff --git a/Source/wtf/InstanceCounter.cpp b/Source/wtf/InstanceCounter.cpp
index 7f29bb07e7ca6db9e8c2a05fdd3d7c45fed6a9db..a34822eb3ac5eefcdc62d256977d704364ad470c 100644
--- a/Source/wtf/InstanceCounter.cpp
+++ b/Source/wtf/InstanceCounter.cpp
@@ -37,7 +37,10 @@ namespace WTF {
#if ENABLE(INSTANCE_COUNTER) || ENABLE(GC_TRACING)
-#if COMPILER(GCC)
+#if COMPILER(CLANG)
+const size_t extractNameFunctionPrefixLength = sizeof("const char *WTF::extractNameFunction() [T = ") - 1;
+const size_t extractNameFunctionPostfixLength = 1;
+#elif COMPILER(GCC)
const size_t extractNameFunctionPrefixLength = sizeof("const char* WTF::extractNameFunction() [with T = ") - 1;
const size_t extractNameFunctionPostfixLength = 1;
#else
@@ -48,7 +51,7 @@ const size_t extractNameFunctionPostfixLength = 1;
// The result of extractNameFunction<T>() is given as |funcName|. |extractTypeNameFromFunctionName| then extracts a typename string from |funcName|.
String extractTypeNameFromFunctionName(const char* funcName)
{
-#if COMPILER(GCC)
+#if COMPILER(CLANG) || COMPILER(GCC)
size_t funcNameLength = strlen(funcName);
ASSERT(funcNameLength > extractNameFunctionPrefixLength + 1);
« Source/platform/heap/Heap.cpp ('K') | « Source/platform/heap/Heap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698