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
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)))