From c65221decfde0f3ce0f7eabd2d83cf91c4c1d887 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Fri, 22 Jun 2012 18:01:38 +0000 Subject: revert CodeGen support for the alloc_size attribute until we finish the design of a more generic metadata node llvm-svn: 159016 --- clang/lib/CodeGen/CGCall.cpp | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'clang/lib/CodeGen/CGCall.cpp') diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index c1106c52d4b..cb4ccb22ebd 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -2085,25 +2085,6 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, CS.setAttributes(Attrs); CS.setCallingConv(static_cast(CallingConv)); - // add metadata for __attribute__((alloc_size(foo))) - if (TargetDecl) { - if (const AllocSizeAttr* Attr = TargetDecl->getAttr()) { - SmallVector Args; - llvm::IntegerType *Ty = llvm::IntegerType::getInt32Ty(getLLVMContext()); - bool isMethod = false; - if (const CXXMethodDecl *MDecl = dyn_cast(TargetDecl)) - isMethod = MDecl->isInstance(); - - for (AllocSizeAttr::args_iterator I = Attr->args_begin(), - E = Attr->args_end(); I != E; ++I) { - Args.push_back(llvm::ConstantInt::get(Ty, *I + isMethod)); - } - - llvm::MDNode *MD = llvm::MDNode::get(getLLVMContext(), Args); - CS.getInstruction()->setMetadata("alloc_size", MD); - } - } - // In ObjC ARC mode with no ObjC ARC exception safety, tell the ARC // optimizer it can aggressively ignore unwind edges. if (CGM.getLangOpts().ObjCAutoRefCount) -- cgit v1.2.3