From: Argyrios Kyrtzidis Date: Mon, 3 Oct 2011 06:36:55 +0000 (+0000) Subject: Move field in ObjCMessageExpr to avoid padding. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b994e6c7d57b00e3e0f69d152065e2cf85d1de33;p=clang Move field in ObjCMessageExpr to avoid padding. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140988 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/ExprObjC.h b/include/clang/AST/ExprObjC.h index 5e237b91d7..96185aa654 100644 --- a/include/clang/AST/ExprObjC.h +++ b/include/clang/AST/ExprObjC.h @@ -445,6 +445,11 @@ private: /// class, and can be distinguished via \c getReceiverKind(). Example: /// class ObjCMessageExpr : public Expr { + /// \brief Stores either the selector that this message is sending + /// to (when \c HasMethod is zero) or an \c ObjCMethodDecl pointer + /// referring to the method that we type-checked against. + uintptr_t SelectorOrMethod; + enum { NumArgsBitWidth = 16 }; /// \brief The number of arguments in the message send, not @@ -481,18 +486,13 @@ class ObjCMessageExpr : public Expr { /// the location of the 'super' keyword. SourceLocation SuperLoc; - /// \brief Stores either the selector that this message is sending - /// to (when \c HasMethod is zero) or an \c ObjCMethodDecl pointer - /// referring to the method that we type-checked against. - uintptr_t SelectorOrMethod; - /// \brief The source locations of the open and close square /// brackets ('[' and ']', respectively). SourceLocation LBracLoc, RBracLoc; ObjCMessageExpr(EmptyShell Empty, unsigned NumArgs) - : Expr(ObjCMessageExprClass, Empty), Kind(0), - HasMethod(0), IsDelegateInitCall(0), SelectorOrMethod(0) { + : Expr(ObjCMessageExprClass, Empty), SelectorOrMethod(0), Kind(0), + HasMethod(0), IsDelegateInitCall(0) { setNumArgs(NumArgs); } diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index b7276aa82f..48a48d0d4f 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -2725,10 +2725,10 @@ ObjCMessageExpr::ObjCMessageExpr(QualType T, /*TypeDependent=*/false, /*ValueDependent=*/false, /*InstantiationDependent=*/false, /*ContainsUnexpandedParameterPack=*/false), - Kind(IsInstanceSuper? SuperInstance : SuperClass), - HasMethod(Method != 0), IsDelegateInitCall(false), SuperLoc(SuperLoc), SelectorOrMethod(reinterpret_cast(Method? Method : Sel.getAsOpaquePtr())), + Kind(IsInstanceSuper? SuperInstance : SuperClass), + HasMethod(Method != 0), IsDelegateInitCall(false), SuperLoc(SuperLoc), LBracLoc(LBracLoc), RBracLoc(RBracLoc) { initArgsAndSelLocs(Args, SelLocs, SelLocsK); @@ -2748,10 +2748,10 @@ ObjCMessageExpr::ObjCMessageExpr(QualType T, : Expr(ObjCMessageExprClass, T, VK, OK_Ordinary, T->isDependentType(), T->isDependentType(), T->isInstantiationDependentType(), T->containsUnexpandedParameterPack()), - Kind(Class), - HasMethod(Method != 0), IsDelegateInitCall(false), SelectorOrMethod(reinterpret_cast(Method? Method : Sel.getAsOpaquePtr())), + Kind(Class), + HasMethod(Method != 0), IsDelegateInitCall(false), LBracLoc(LBracLoc), RBracLoc(RBracLoc) { initArgsAndSelLocs(Args, SelLocs, SelLocsK); @@ -2772,10 +2772,10 @@ ObjCMessageExpr::ObjCMessageExpr(QualType T, Receiver->isTypeDependent(), Receiver->isInstantiationDependent(), Receiver->containsUnexpandedParameterPack()), - Kind(Instance), - HasMethod(Method != 0), IsDelegateInitCall(false), SelectorOrMethod(reinterpret_cast(Method? Method : Sel.getAsOpaquePtr())), + Kind(Instance), + HasMethod(Method != 0), IsDelegateInitCall(false), LBracLoc(LBracLoc), RBracLoc(RBracLoc) { initArgsAndSelLocs(Args, SelLocs, SelLocsK);