[cfe-commits] r129929 - in /cfe/trunk/lib/CodeGen: CGObjCGNU.cpp CGStmt.cpp CodeGenFunction.cpp CodeGenModule.cpp CodeGenTBAA.cpp
Jay Foad
jay.foad at gmail.com
Thu Apr 21 12:59:12 PDT 2011
Author: foad
Date: Thu Apr 21 14:59:12 2011
New Revision: 129929
URL: http://llvm.org/viewvc/llvm-project?rev=129929&view=rev
Log:
PR9214: Convert Metadata API to use ArrayRef.
Modified:
cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
cfe/trunk/lib/CodeGen/CGStmt.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp
Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=129929&r1=129928&r2=129929&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Thu Apr 21 14:59:12 2011
@@ -1035,7 +1035,7 @@
llvm::MDString::get(VMContext, Class->getSuperClass()->getNameAsString()),
llvm::ConstantInt::get(llvm::Type::getInt1Ty(VMContext), IsClassMessage)
};
- llvm::MDNode *node = llvm::MDNode::get(VMContext, impMD, 3);
+ llvm::MDNode *node = llvm::MDNode::get(VMContext, impMD);
llvm::Instruction *call;
RValue msgRet = CGF.EmitCall(FnInfo, imp, Return, ActualArgs,
@@ -1109,7 +1109,7 @@
llvm::MDString::get(VMContext, Class ? Class->getNameAsString() :""),
llvm::ConstantInt::get(llvm::Type::getInt1Ty(VMContext), Class!=0)
};
- llvm::MDNode *node = llvm::MDNode::get(VMContext, impMD, 3);
+ llvm::MDNode *node = llvm::MDNode::get(VMContext, impMD);
// Get the IMP to call
llvm::Value *imp = LookupIMP(CGF, Receiver, cmd, node);
Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=129929&r1=129928&r2=129929&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Thu Apr 21 14:59:12 2011
@@ -1351,7 +1351,7 @@
}
}
- return llvm::MDNode::get(CGF.getLLVMContext(), Locs.data(), Locs.size());
+ return llvm::MDNode::get(CGF.getLLVMContext(), Locs);
}
void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=129929&r1=129928&r2=129929&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Thu Apr 21 14:59:12 2011
@@ -241,7 +241,7 @@
CGM.getModule().getOrInsertNamedMetadata("opencl.kernels");
llvm::Value *Op = Fn;
- OpenCLMetadata->addOperand(llvm::MDNode::get(Context, &Op, 1));
+ OpenCLMetadata->addOperand(llvm::MDNode::get(Context, Op));
}
}
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=129929&r1=129928&r2=129929&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Thu Apr 21 14:59:12 2011
@@ -2160,7 +2160,7 @@
Addr,
GetPointerConstant(CGM.getLLVMContext(), D.getDecl())
};
- GlobalMetadata->addOperand(llvm::MDNode::get(CGM.getLLVMContext(), Ops, 2));
+ GlobalMetadata->addOperand(llvm::MDNode::get(CGM.getLLVMContext(), Ops));
}
/// Emits metadata nodes associating all the global values in the
@@ -2201,7 +2201,7 @@
if (llvm::AllocaInst *Alloca = dyn_cast<llvm::AllocaInst>(Addr)) {
llvm::Value *DAddr = GetPointerConstant(getLLVMContext(), D);
- Alloca->setMetadata(DeclPtrKind, llvm::MDNode::get(Context, &DAddr, 1));
+ Alloca->setMetadata(DeclPtrKind, llvm::MDNode::get(Context, DAddr));
} else if (llvm::GlobalValue *GV = dyn_cast<llvm::GlobalValue>(Addr)) {
GlobalDecl GD = GlobalDecl(cast<VarDecl>(D));
EmitGlobalDeclMetadata(CGM, GlobalMetadata, GD, GV);
Modified: cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp?rev=129929&r1=129928&r2=129929&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp Thu Apr 21 14:59:12 2011
@@ -74,7 +74,8 @@
};
// Create the mdnode.
- return llvm::MDNode::get(VMContext, Ops, llvm::array_lengthof(Ops) - !Flags);
+ unsigned Len = llvm::array_lengthof(Ops) - !Flags;
+ return llvm::MDNode::get(VMContext, llvm::ArrayRef<llvm::Value*>(Ops, Len));
}
static bool TypeHasMayAlias(QualType QTy) {
More information about the cfe-commits
mailing list