PR9214: Convert Metadata API to use ArrayRef.

llvm-svn: 129929
This commit is contained in:
Jay Foad
2011-04-21 19:59:12 +00:00
parent 70597d4e50
commit ea324f154b
5 changed files with 8 additions and 7 deletions

View File

@@ -2160,7 +2160,7 @@ static void EmitGlobalDeclMetadata(CodeGenModule &CGM,
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 @@ void CodeGenFunction::EmitDeclMetadata() {
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);