summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2015-07-17 18:21:37 +0000
committerJames Y Knight <jyknight@google.com>2015-07-17 18:21:37 +0000
commit53c7616e2e6aa3bcef0123c1890f8fdeb0e760ab (patch)
tree7e9e1de25a2500e592ba668b4405ce2a07ba1378 /clang/lib/AST/Decl.cpp
parent5a6d5bc17b385293e3337b9f2082151594f972f9 (diff)
downloadbcm5719-llvm-53c7616e2e6aa3bcef0123c1890f8fdeb0e760ab.tar.gz
bcm5719-llvm-53c7616e2e6aa3bcef0123c1890f8fdeb0e760ab.zip
Fix alignment issues in Clang.
Some const-correctness changes snuck in here too, since they were in the area of code I was modifying. This seems to make Clang actually work without Bus Error on 32bit-sparc. Follow-up patches will factor out a trailing-object helper class, to make classes using the idiom of appending objects to other objects easier to understand, and to ensure (with static_assert) that required alignment guarantees continue to hold. Differential Revision: http://reviews.llvm.org/D10272 llvm-svn: 242554
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index ea4b2f517cd..946d1bae21e 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -3116,8 +3116,8 @@ FunctionDecl::setDependentTemplateSpecialization(ASTContext &Context,
const TemplateArgumentListInfo &TemplateArgs) {
assert(TemplateOrSpecialization.isNull());
size_t Size = sizeof(DependentFunctionTemplateSpecializationInfo);
- Size += Templates.size() * sizeof(FunctionTemplateDecl*);
Size += TemplateArgs.size() * sizeof(TemplateArgumentLoc);
+ Size += Templates.size() * sizeof(FunctionTemplateDecl *);
void *Buffer = Context.Allocate(Size);
DependentFunctionTemplateSpecializationInfo *Info =
new (Buffer) DependentFunctionTemplateSpecializationInfo(Templates,
@@ -3132,8 +3132,8 @@ DependentFunctionTemplateSpecializationInfo(const UnresolvedSetImpl &Ts,
static_assert(sizeof(*this) % llvm::AlignOf<void *>::Alignment == 0,
"Trailing data is unaligned!");
- d.NumTemplates = Ts.size();
- d.NumArgs = TArgs.size();
+ NumTemplates = Ts.size();
+ NumArgs = TArgs.size();
FunctionTemplateDecl **TsArray =
const_cast<FunctionTemplateDecl**>(getTemplates());
OpenPOWER on IntegriCloud