[cfe-commits] r152365 - in /cfe/trunk: include/clang/AST/NestedNameSpecifier.h lib/AST/NestedNameSpecifier.cpp
Daniel Dunbar
daniel at zuster.org
Thu Mar 8 17:52:00 PST 2012
Author: ddunbar
Date: Thu Mar 8 19:51:59 2012
New Revision: 152365
URL: http://llvm.org/viewvc/llvm-project?rev=152365&view=rev
Log:
[AST] NestedNameSpecifier's ctor/dtor are trivial and should be inlined.
Modified:
cfe/trunk/include/clang/AST/NestedNameSpecifier.h
cfe/trunk/lib/AST/NestedNameSpecifier.cpp
Modified: cfe/trunk/include/clang/AST/NestedNameSpecifier.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/NestedNameSpecifier.h?rev=152365&r1=152364&r2=152365&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/NestedNameSpecifier.h (original)
+++ cfe/trunk/include/clang/AST/NestedNameSpecifier.h Thu Mar 8 19:51:59 2012
@@ -339,14 +339,18 @@
unsigned BufferCapacity;
public:
- NestedNameSpecifierLocBuilder();
+ NestedNameSpecifierLocBuilder()
+ : Representation(0), Buffer(0), BufferSize(0), BufferCapacity(0) { }
NestedNameSpecifierLocBuilder(const NestedNameSpecifierLocBuilder &Other);
NestedNameSpecifierLocBuilder &
operator=(const NestedNameSpecifierLocBuilder &Other);
- ~NestedNameSpecifierLocBuilder();
+ ~NestedNameSpecifierLocBuilder() {
+ if (BufferCapacity)
+ free(Buffer);
+ }
/// \brief Retrieve the representation of the nested-name-specifier.
NestedNameSpecifier *getRepresentation() const { return Representation; }
Modified: cfe/trunk/lib/AST/NestedNameSpecifier.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/NestedNameSpecifier.cpp?rev=152365&r1=152364&r2=152365&view=diff
==============================================================================
--- cfe/trunk/lib/AST/NestedNameSpecifier.cpp (original)
+++ cfe/trunk/lib/AST/NestedNameSpecifier.cpp Thu Mar 8 19:51:59 2012
@@ -434,9 +434,6 @@
}
}
-NestedNameSpecifierLocBuilder::NestedNameSpecifierLocBuilder()
- : Representation(0), Buffer(0), BufferSize(0), BufferCapacity(0) { }
-
NestedNameSpecifierLocBuilder::
NestedNameSpecifierLocBuilder(const NestedNameSpecifierLocBuilder &Other)
: Representation(Other.Representation), Buffer(0),
@@ -499,11 +496,6 @@
return *this;
}
-NestedNameSpecifierLocBuilder::~NestedNameSpecifierLocBuilder() {
- if (BufferCapacity)
- free(Buffer);
-}
-
void NestedNameSpecifierLocBuilder::Extend(ASTContext &Context,
SourceLocation TemplateKWLoc,
TypeLoc TL,
More information about the cfe-commits
mailing list