Add the pass_object_size attribute to clang.

`pass_object_size` is our way of enabling `__builtin_object_size` to
produce high quality results without requiring inlining to happen
everywhere.

A link to the design doc for this attribute is available at the
Differential review link below.

Differential Revision: http://reviews.llvm.org/D13263

llvm-svn: 254554
This commit is contained in:
George Burgess IV
2015-12-02 21:58:08 +00:00
parent ba904d4ecf
commit 3e3bb95b69
33 changed files with 852 additions and 215 deletions

View File

@@ -1830,8 +1830,11 @@ llvm::Constant *CodeGenModule::GetAddrOfFunction(GlobalDecl GD,
bool DontDefer,
bool IsForDefinition) {
// If there was no specific requested type, just convert it now.
if (!Ty)
Ty = getTypes().ConvertType(cast<ValueDecl>(GD.getDecl())->getType());
if (!Ty) {
const auto *FD = cast<FunctionDecl>(GD.getDecl());
auto CanonTy = Context.getCanonicalType(FD->getType());
Ty = getTypes().ConvertFunctionType(CanonTy, FD);
}
StringRef MangledName = getMangledName(GD);
return GetOrCreateLLVMFunction(MangledName, Ty, GD, ForVTable, DontDefer,