diff options
author | Manman Ren <manman.ren@gmail.com> | 2013-09-08 06:00:42 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2013-09-08 06:00:42 +0000 |
commit | 4fa214b2b9b4db9aaeb82467caddb303725fa91d (patch) | |
tree | d274a43605006a86c6a65d682adc74f05bf2bb3d /lib/IR | |
parent | d372889eabcd10a9d8ce8fe9a4b2678d3a51d823 (diff) | |
download | external_llvm-4fa214b2b9b4db9aaeb82467caddb303725fa91d.zip external_llvm-4fa214b2b9b4db9aaeb82467caddb303725fa91d.tar.gz external_llvm-4fa214b2b9b4db9aaeb82467caddb303725fa91d.tar.bz2 |
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
Diffstat (limited to 'lib/IR')
-rw-r--r-- | lib/IR/DIBuilder.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp index 0c91b12..962b3a9 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<Value *, 9> 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<Value *, 9> 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); |