summaryrefslogtreecommitdiffstats
path: root/clang/include
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-04-02 12:43:31 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-04-02 12:43:31 +0000
commit3ebba5237ee09ae4e5b2e2d39bda87d664a0f3b7 (patch)
treecbf52bcf0df26fea3b1ef8cd2a46bf706eec8fae /clang/include
parent1d4ffd74c167467b7659d560d3f7b150fd931fbb (diff)
downloadbcm5719-llvm-3ebba5237ee09ae4e5b2e2d39bda87d664a0f3b7.tar.gz
bcm5719-llvm-3ebba5237ee09ae4e5b2e2d39bda87d664a0f3b7.zip
Partially revert "Replace custom alignment enforcement with LLVM_ALIGNAS."
MSVC 2013 can't even parse __declspec(align(sizeof(foo))). We'll have to wait until MSVC 2015 for this. This partially reverts commit r233911. llvm-svn: 233912
Diffstat (limited to 'clang/include')
-rw-r--r--clang/include/clang/AST/DeclGroup.h9
-rw-r--r--clang/include/clang/AST/DeclTemplate.h27
-rw-r--r--clang/include/clang/AST/Stmt.h5
3 files changed, 30 insertions, 11 deletions
diff --git a/clang/include/clang/AST/DeclGroup.h b/clang/include/clang/AST/DeclGroup.h
index 04718f4741b..bd3dbd8fa78 100644
--- a/clang/include/clang/AST/DeclGroup.h
+++ b/clang/include/clang/AST/DeclGroup.h
@@ -14,7 +14,6 @@
#ifndef LLVM_CLANG_AST_DECLGROUP_H
#define LLVM_CLANG_AST_DECLGROUP_H
-#include "llvm/Support/Compiler.h"
#include "llvm/Support/DataTypes.h"
#include <cassert>
@@ -25,9 +24,13 @@ class Decl;
class DeclGroup;
class DeclGroupIterator;
-class LLVM_ALIGNAS(sizeof(void *)) DeclGroup {
+class DeclGroup {
// FIXME: Include a TypeSpecifier object.
- unsigned NumDecls;
+ union {
+ unsigned NumDecls;
+
+ Decl *Aligner;
+ };
private:
DeclGroup() : NumDecls(0) {}
diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h
index 60e0481944c..39b5208a662 100644
--- a/clang/include/clang/AST/DeclTemplate.h
+++ b/clang/include/clang/AST/DeclTemplate.h
@@ -460,12 +460,21 @@ public:
/// friend void foo<>(T);
/// };
/// \endcode
-class LLVM_ALIGNAS(sizeof(void *)) DependentFunctionTemplateSpecializationInfo {
- /// The number of potential template candidates.
- unsigned NumTemplates;
+class DependentFunctionTemplateSpecializationInfo {
+ struct CA {
+ /// The number of potential template candidates.
+ unsigned NumTemplates;
- /// The number of template arguments.
- unsigned NumArgs;
+ /// The number of template arguments.
+ unsigned NumArgs;
+ };
+
+ union {
+ // Force sizeof to be a multiple of sizeof(void*) so that the
+ // trailing data is aligned.
+ void *Aligner;
+ struct CA d;
+ };
/// The locations of the left and right angle brackets.
SourceRange AngleLocs;
@@ -481,7 +490,9 @@ public:
/// \brief Returns the number of function templates that this might
/// be a specialization of.
- unsigned getNumTemplates() const { return NumTemplates; }
+ unsigned getNumTemplates() const {
+ return d.NumTemplates;
+ }
/// \brief Returns the i'th template candidate.
FunctionTemplateDecl *getTemplate(unsigned I) const {
@@ -496,7 +507,9 @@ public:
}
/// \brief Returns the number of explicit template arguments that were given.
- unsigned getNumTemplateArgs() const { return NumArgs; }
+ unsigned getNumTemplateArgs() const {
+ return d.NumArgs;
+ }
/// \brief Returns the nth template argument.
const TemplateArgumentLoc &getTemplateArg(unsigned I) const {
diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h
index 6739cb3fb00..a55cba9d1a4 100644
--- a/clang/include/clang/AST/Stmt.h
+++ b/clang/include/clang/AST/Stmt.h
@@ -101,7 +101,7 @@ namespace clang {
/// Stmt - This represents one statement.
///
-class LLVM_ALIGNAS(sizeof(void *)) Stmt {
+class Stmt {
public:
enum StmtClass {
NoStmtClass = 0,
@@ -287,6 +287,9 @@ protected:
};
union {
+ // FIXME: this is wasteful on 64-bit platforms.
+ void *Aligner;
+
StmtBitfields StmtBits;
CompoundStmtBitfields CompoundStmtBits;
ExprBitfields ExprBits;
OpenPOWER on IntegriCloud