]> granicus.if.org Git - clang/commit
implement sizeof/alignof support for structs, unions and complex.
authorChris Lattner <sabre@nondot.org>
Wed, 18 Jul 2007 18:26:58 +0000 (18:26 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 18 Jul 2007 18:26:58 +0000 (18:26 +0000)
commit5d2a6303467184b1f159bb6556efc434e50e3c28
tree16e2d2f5e4e1dac4a6c90c1e4f3eafa7c2649332
parent5e3fbe503a28c790d648091653dc21eeca64ca07
implement sizeof/alignof support for structs, unions and complex.

This allows us to compile this:

struct abc { char A; double D; };

int foo() {
  return sizeof(struct abc);
  return __alignof__(struct abc);
}

Into:

        ret i32 16
        ret i32 8

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40010 91177308-0d34-0410-b5e6-96231b3b80d8
AST/ASTContext.cpp
include/clang/AST/RecordLayout.h
include/clang/AST/Type.h