[llvm] r178420 - Put private class into an anonmyous namespace.
Benjamin Kramer
benny.kra at googlemail.com
Sat Mar 30 08:23:08 PDT 2013
Author: d0k
Date: Sat Mar 30 10:23:08 2013
New Revision: 178420
URL: http://llvm.org/viewvc/llvm-project?rev=178420&view=rev
Log:
Put private class into an anonmyous namespace.
Modified:
llvm/trunk/lib/Support/MemoryBuffer.cpp
Modified: llvm/trunk/lib/Support/MemoryBuffer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/MemoryBuffer.cpp?rev=178420&r1=178419&r2=178420&view=diff
==============================================================================
--- llvm/trunk/lib/Support/MemoryBuffer.cpp (original)
+++ llvm/trunk/lib/Support/MemoryBuffer.cpp Sat Mar 30 10:23:08 2013
@@ -72,10 +72,12 @@ static void CopyStringRef(char *Memory,
Memory[Data.size()] = 0; // Null terminate string.
}
+namespace {
struct NamedBufferAlloc {
StringRef Name;
NamedBufferAlloc(StringRef Name) : Name(Name) {}
};
+}
void *operator new(size_t N, const NamedBufferAlloc &Alloc) {
char *Mem = static_cast<char *>(operator new(N + Alloc.Name.size() + 1));
More information about the llvm-commits
mailing list