From: Manman Ren Date: Sun, 8 Sep 2013 06:00:42 +0000 (+0000) Subject: Debug Info: use null instead of "i32 0" in DIBuilder. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4fa214b2b9b4db9aaeb82467caddb303725fa91d;p=oota-llvm.git Debug Info: use null instead of "i32 0" in DIBuilder. For context field of subroutine_type and when creating artificial types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190270 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp index 0c91b126936..962b3a96408 100644 --- a/lib/IR/DIBuilder.cpp +++ b/lib/IR/DIBuilder.cpp @@ -714,7 +714,7 @@ DIBuilder::createSubroutineType(DIFile File, DIArray ParameterTypes) { Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_subroutine_type), Constant::getNullValue(Type::getInt32Ty(VMContext)), - Constant::getNullValue(Type::getInt32Ty(VMContext)), + NULL, MDString::get(VMContext, ""), ConstantInt::get(Type::getInt32Ty(VMContext), 0), ConstantInt::get(Type::getInt64Ty(VMContext), 0), @@ -818,12 +818,8 @@ DIType DIBuilder::createArtificialType(DIType Ty) { SmallVector Elts; MDNode *N = Ty; assert (N && "Unexpected input DIType!"); - for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { - if (Value *V = N->getOperand(i)) - Elts.push_back(V); - else - Elts.push_back(Constant::getNullValue(Type::getInt32Ty(VMContext))); - } + for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) + Elts.push_back(N->getOperand(i)); unsigned CurFlags = Ty.getFlags(); CurFlags = CurFlags | DIType::FlagArtificial; @@ -843,12 +839,8 @@ DIType DIBuilder::createObjectPointerType(DIType Ty) { SmallVector Elts; MDNode *N = Ty; assert (N && "Unexpected input DIType!"); - for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { - if (Value *V = N->getOperand(i)) - Elts.push_back(V); - else - Elts.push_back(Constant::getNullValue(Type::getInt32Ty(VMContext))); - } + for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) + Elts.push_back(N->getOperand(i)); unsigned CurFlags = Ty.getFlags(); CurFlags = CurFlags | (DIType::FlagObjectPointer | DIType::FlagArtificial);