aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2012-03-08 18:43:59 +0000
committerDaniel Dunbar <daniel@zuster.org>2012-03-08 18:43:59 +0000
commit54e1c41b31c0bc5acad4473f802215bcd6a3206b (patch)
tree1248d93a87c7933c68d34d25848be93cd0df37a6
parent6daffa5d6031eee8b25fc2c745dd6b58b039a6eb (diff)
[Basic] PartialDiagnostic: Manual split out the cold part of freeStorage(), the
hot path will typically profitably get inlined (based on what I see from the users of PartialDiagnostic). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152322 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/PartialDiagnostic.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/clang/Basic/PartialDiagnostic.h b/include/clang/Basic/PartialDiagnostic.h
index f6092e6858..007e6a4760 100644
--- a/include/clang/Basic/PartialDiagnostic.h
+++ b/include/clang/Basic/PartialDiagnostic.h
@@ -141,6 +141,16 @@ private:
if (!DiagStorage)
return;
+ // The hot path for PartialDiagnostic is when we just used it to wrap an ID
+ // (typically so we have the flexibility of passing a more complex
+ // diagnostic into the callee, but that does not commonly occur).
+ //
+ // Split this out into a slow function for silly compilers (*cough*) which
+ // can't do decent partial inlining.
+ freeStorageSlow();
+ }
+
+ void freeStorageSlow() {
if (Allocator)
Allocator->Deallocate(DiagStorage);
else if (Allocator != reinterpret_cast<StorageAllocator *>(~uintptr_t(0)))