[llvm] r338227 - Try to fix build.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 29 20:25:28 PDT 2018
Author: zturner
Date: Sun Jul 29 20:25:27 2018
New Revision: 338227
URL: http://llvm.org/viewvc/llvm-project?rev=338227&view=rev
Log:
Try to fix build.
Modified:
llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp
Modified: llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp?rev=338227&r1=338226&r2=338227&view=diff
==============================================================================
--- llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp (original)
+++ llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp Sun Jul 29 20:25:27 2018
@@ -29,6 +29,8 @@
// the demangler is 3x faster with this allocator compared to one with
// STL containers.
namespace {
+ constexpr size_t AllocUnit = 4096;
+
class ArenaAllocator {
struct AllocatorNode {
uint8_t *Buf = nullptr;
@@ -47,7 +49,7 @@ class ArenaAllocator {
}
public:
- ArenaAllocator() { addNode(Unit); }
+ ArenaAllocator() { addNode(AllocUnit); }
~ArenaAllocator() {
while (Head) {
@@ -67,7 +69,7 @@ public:
// It's possible we need a buffer which is larger than our default unit
// size, so we need to be careful to add a node with capacity that is at
// least as large as what we need.
- addNode(std::max(Unit, Length));
+ addNode(std::max(AllocUnit, Length));
Head->Used = Length;
Buf = Head->Buf;
}
@@ -90,14 +92,12 @@ public:
if (Head->Used < Head->Capacity)
return new (PP) T(std::forward<Args>(ConstructorArgs)...);
- addNode(ArenaAllocator::Unit);
+ addNode(AllocUnit);
Head->Used = Size;
return new (Head->Buf) T(std::forward<Args>(ConstructorArgs)...);
}
private:
- static constexpr size_t Unit = 4096;
-
AllocatorNode *Head = nullptr;
};
} // namespace
More information about the llvm-commits
mailing list