If the first argument of __builtin_object_size can be folded to a constant
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 23 May 2012 04:13:20 +0000 (04:13 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 23 May 2012 04:13:20 +0000 (04:13 +0000)
commit01ade177e944ba81794fdcaf01c41bd558a31ede
treec0d9a3aab0747cfa754a5aebe216df47950ac8ed
parent9fc5c814fa5f3804cb8748f355276ac0b1b4e0a4
If the first argument of __builtin_object_size can be folded to a constant
pointer, but such folding encounters side-effects, ignore the side-effects
rather than performing them at runtime: CodeGen generates wrong code for
__builtin_object_size in that case.

llvm-svn: 157310
clang/lib/AST/ExprConstant.cpp
clang/lib/CodeGen/CGBuiltin.cpp
clang/test/CodeGen/object-size.c