]> granicus.if.org Git - clang/commit
Perform dynamic alignment computations so that the data in TypeLocs is
authorEli Friedman <eli.friedman@gmail.com>
Fri, 7 Jun 2013 00:04:31 +0000 (00:04 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Fri, 7 Jun 2013 00:04:31 +0000 (00:04 +0000)
commit86875b11db3536858116effd80cbb06b6810303d
treec31d02504789abbd05874e05304dc7d39e118209
parent585bee48bac063f31696e308798f9432b5ba4116
Perform dynamic alignment computations so that the data in TypeLocs is
correctly aligned.  Not performing such computations led to misaligned loads,
which crash on some platforms and are generally bad on other platforms.

The implementation of TypeLocBuilder::pushImpl is rather messy; code using
TypeLocBuilder accidentally assumes that partial TypeLocs are
laid out like a complete TypeLoc.  As a followup, I intend to work on
fixing the TypeLocBuilder API to avoid exposing partial TypeLocs; this should
substantially simplify the implemementation.

Fixes PR16144.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183466 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/TypeLoc.h
lib/AST/TypeLoc.cpp
lib/Sema/CMakeLists.txt
lib/Sema/SemaLambda.cpp
lib/Sema/SemaTemplateVariadic.cpp
lib/Sema/TreeTransform.h
lib/Sema/TypeLocBuilder.cpp [new file with mode: 0644]
lib/Sema/TypeLocBuilder.h