diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-04-02 16:19:54 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-04-02 16:19:54 +0000 |
commit | 8adeef963217b0a614cdf93b95b44c58cfc5f2e0 (patch) | |
tree | 8535c61d80439e3bf785774489c8042e401733e3 /clang/lib/AST/ASTContext.cpp | |
parent | 475386d688796883cf52cd9a84a81a5ecda19247 (diff) | |
download | bcm5719-llvm-8adeef963217b0a614cdf93b95b44c58cfc5f2e0.tar.gz bcm5719-llvm-8adeef963217b0a614cdf93b95b44c58cfc5f2e0.zip |
Lower the default alignment on ASTContext's operator new.
It was documented as 8 and operator new[] defaults to 8, but the normal
operator new was never updated and happily wasted bytes on every other
allocation.
We still have to allocate all Types with 16 byte alignment, update the
allocation calls for Types that were missing explicit alignment.
llvm-svn: 233922
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 57621a7b1f6..899f8c5ff52 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -3358,7 +3358,7 @@ ASTContext::getElaboratedType(ElaboratedTypeKeyword Keyword, (void)CheckT; } - T = new (*this) ElaboratedType(Keyword, NNS, NamedType, Canon); + T = new (*this, TypeAlignment) ElaboratedType(Keyword, NNS, NamedType, Canon); Types.push_back(T); ElaboratedTypes.InsertNode(T, InsertPos); return QualType(T, 0); @@ -3382,7 +3382,7 @@ ASTContext::getParenType(QualType InnerType) const { (void)CheckT; } - T = new (*this) ParenType(InnerType, Canon); + T = new (*this, TypeAlignment) ParenType(InnerType, Canon); Types.push_back(T); ParenTypes.InsertNode(T, InsertPos); return QualType(T, 0); @@ -3411,7 +3411,7 @@ QualType ASTContext::getDependentNameType(ElaboratedTypeKeyword Keyword, if (T) return QualType(T, 0); - T = new (*this) DependentNameType(Keyword, NNS, Name, Canon); + T = new (*this, TypeAlignment) DependentNameType(Keyword, NNS, Name, Canon); Types.push_back(T); DependentNameTypes.InsertNode(T, InsertPos); return QualType(T, 0); @@ -3513,7 +3513,8 @@ QualType ASTContext::getPackExpansionType(QualType Pattern, } } - T = new (*this) PackExpansionType(Pattern, Canon, NumExpansions); + T = new (*this, TypeAlignment) + PackExpansionType(Pattern, Canon, NumExpansions); Types.push_back(T); PackExpansionTypes.InsertNode(T, InsertPos); return QualType(T, 0); |