aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-06-22 18:01:38 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-06-22 18:01:38 +0000
commit7e0dc76b175414ecdd9a6b26bdb548281da8bffd (patch)
tree6ac1bb88cc1f0a686277b154a3a9959d60fbc1d3 /lib/CodeGen/CGCall.cpp
parent8ac6b135fb51d2d115b372be0e7c32d3d073d912 (diff)
revert CodeGen support for the alloc_size attribute until we finish the design of a more generic metadata node
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159016 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r--lib/CodeGen/CGCall.cpp19
1 files changed, 0 insertions, 19 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index c1106c52d4..cb4ccb22eb 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -2085,25 +2085,6 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
CS.setAttributes(Attrs);
CS.setCallingConv(static_cast<llvm::CallingConv::ID>(CallingConv));
- // add metadata for __attribute__((alloc_size(foo)))
- if (TargetDecl) {
- if (const AllocSizeAttr* Attr = TargetDecl->getAttr<AllocSizeAttr>()) {
- SmallVector<llvm::Value*, 4> Args;
- llvm::IntegerType *Ty = llvm::IntegerType::getInt32Ty(getLLVMContext());
- bool isMethod = false;
- if (const CXXMethodDecl *MDecl = dyn_cast<CXXMethodDecl>(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)