diff options
| author | Jyoti Allur <jyoti.allur@samsung.com> | 2014-09-29 06:32:54 +0000 |
|---|---|---|
| committer | Jyoti Allur <jyoti.allur@samsung.com> | 2014-09-29 06:32:54 +0000 |
| commit | b76b57fefd4396c15497219f428a7596bf966558 (patch) | |
| tree | 27cf16aaeeb56b0d135ce726844ba9ddb7766da1 /llvm/lib | |
| parent | 7d9f67f76e9482ffb773542e2075184463af02ea (diff) | |
| download | bcm5719-llvm-b76b57fefd4396c15497219f428a7596bf966558.tar.gz bcm5719-llvm-b76b57fefd4396c15497219f428a7596bf966558.zip | |
Remove dead code from DIBuilder
llvm-svn: 218593
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/IR/DIBuilder.cpp | 50 |
1 files changed, 7 insertions, 43 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index 6c186c1cfeb..a5c09b60c4f 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -948,44 +948,8 @@ DISubrange DIBuilder::getOrCreateSubrange(int64_t Lo, int64_t Count) { return DISubrange(MDNode::get(VMContext, Elts)); } -/// \brief Create a new descriptor for the specified global. -DIGlobalVariable DIBuilder::createGlobalVariable(StringRef Name, - StringRef LinkageName, - DIFile F, unsigned LineNumber, - DITypeRef Ty, bool isLocalToUnit, - Value *Val) { - Value *Elts[] = { - GetTagConstant(VMContext, dwarf::DW_TAG_variable), - Constant::getNullValue(Type::getInt32Ty(VMContext)), - nullptr, // TheCU, - MDString::get(VMContext, Name), - MDString::get(VMContext, Name), - MDString::get(VMContext, LinkageName), - F, - ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), - Ty, - ConstantInt::get(Type::getInt32Ty(VMContext), isLocalToUnit), - ConstantInt::get(Type::getInt32Ty(VMContext), 1), /* isDefinition*/ - Val, - DIDescriptor() - }; - MDNode *Node = MDNode::get(VMContext, Elts); - AllGVs.push_back(Node); - return DIGlobalVariable(Node); -} - -/// \brief Create a new descriptor for the specified global. -DIGlobalVariable DIBuilder::createGlobalVariable(StringRef Name, DIFile F, - unsigned LineNumber, - DITypeRef Ty, - bool isLocalToUnit, - Value *Val) { - return createGlobalVariable(Name, Name, F, LineNumber, Ty, isLocalToUnit, - Val); -} - static DIGlobalVariable -createStaticVariableHelper(LLVMContext &VMContext, DIDescriptor Context, +createGlobalVariableHelper(LLVMContext &VMContext, DIDescriptor Context, StringRef Name, StringRef LinkageName, DIFile F, unsigned LineNumber, DITypeRef Ty, bool isLocalToUnit, Value *Val, MDNode *Decl, bool isDefinition, @@ -1009,16 +973,16 @@ createStaticVariableHelper(LLVMContext &VMContext, DIDescriptor Context, return DIGlobalVariable(CreateFunc(Elts)); } -/// createStaticVariable - Create a new descriptor for the specified +/// createGlobalVariable - Create a new descriptor for the specified /// variable. -DIGlobalVariable DIBuilder::createStaticVariable(DIDescriptor Context, +DIGlobalVariable DIBuilder::createGlobalVariable(DIDescriptor Context, StringRef Name, StringRef LinkageName, DIFile F, unsigned LineNumber, DITypeRef Ty, bool isLocalToUnit, Value *Val, MDNode *Decl) { - return createStaticVariableHelper(VMContext, Context, Name, LinkageName, F, + return createGlobalVariableHelper(VMContext, Context, Name, LinkageName, F, LineNumber, Ty, isLocalToUnit, Val, Decl, true, [&] (ArrayRef<Value *> Elts) -> MDNode * { MDNode *Node = MDNode::get(VMContext, Elts); @@ -1027,17 +991,17 @@ DIGlobalVariable DIBuilder::createStaticVariable(DIDescriptor Context, }); } -/// createTempStaticVariableFwdDecl - Create a new temporary descriptor for the +/// createTempGlobalVariableFwdDecl - Create a new temporary descriptor for the /// specified variable declarartion. DIGlobalVariable -DIBuilder::createTempStaticVariableFwdDecl(DIDescriptor Context, +DIBuilder::createTempGlobalVariableFwdDecl(DIDescriptor Context, StringRef Name, StringRef LinkageName, DIFile F, unsigned LineNumber, DITypeRef Ty, bool isLocalToUnit, Value *Val, MDNode *Decl) { - return createStaticVariableHelper(VMContext, Context, Name, LinkageName, F, + return createGlobalVariableHelper(VMContext, Context, Name, LinkageName, F, LineNumber, Ty, isLocalToUnit, Val, Decl, false, [&] (ArrayRef<Value *> Elts) { return MDNode::getTemporary(VMContext, Elts); |

