From d7e69b2a86e34414d3150a16c39013c0b28f3cd0 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Sat, 15 Nov 2014 00:05:04 +0000 Subject: [PATCH] DIBuilder: Change private helper function to static, NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222068 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/DIBuilder.h | 7 ------- lib/IR/DIBuilder.cpp | 25 +++++++++++-------------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/include/llvm/IR/DIBuilder.h b/include/llvm/IR/DIBuilder.h index 59f104d9ccf..411aac96904 100644 --- a/include/llvm/IR/DIBuilder.h +++ b/include/llvm/IR/DIBuilder.h @@ -75,13 +75,6 @@ namespace llvm { /// Each subprogram's preserved local variables. DenseMap>> PreservedVariables; - // Private use for multiple types of template parameters. - DITemplateValueParameter - createTemplateValueParameter(unsigned Tag, DIDescriptor Scope, - StringRef Name, DIType Ty, Value *Val, - MDNode *File = nullptr, unsigned LineNo = 0, - unsigned ColumnNo = 0); - DIBuilder(const DIBuilder &) LLVM_DELETED_FUNCTION; void operator=(const DIBuilder &) LLVM_DELETED_FUNCTION; diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp index 2486ccef951..1df54e55098 100644 --- a/lib/IR/DIBuilder.cpp +++ b/lib/IR/DIBuilder.cpp @@ -476,12 +476,9 @@ DIBuilder::createTemplateTypeParameter(DIDescriptor Context, StringRef Name, return DITemplateTypeParameter(MDNode::get(VMContext, Elts)); } -DITemplateValueParameter -DIBuilder::createTemplateValueParameter(unsigned Tag, DIDescriptor Context, - StringRef Name, DIType Ty, - Value *Val, MDNode *File, - unsigned LineNo, - unsigned ColumnNo) { +static DITemplateValueParameter createTemplateValueParameterHelper( + LLVMContext &VMContext, unsigned Tag, DIDescriptor Context, StringRef Name, + DIType Ty, Value *Val, MDNode *File, unsigned LineNo, unsigned ColumnNo) { Value *Elts[] = { HeaderBuilder::get(Tag).concat(Name).concat(LineNo).concat(ColumnNo).get( VMContext), @@ -495,9 +492,9 @@ DIBuilder::createTemplateValueParameter(DIDescriptor Context, StringRef Name, DIType Ty, Value *Val, MDNode *File, unsigned LineNo, unsigned ColumnNo) { - return createTemplateValueParameter(dwarf::DW_TAG_template_value_parameter, - Context, Name, Ty, Val, File, LineNo, - ColumnNo); + return createTemplateValueParameterHelper( + VMContext, dwarf::DW_TAG_template_value_parameter, Context, Name, Ty, Val, + File, LineNo, ColumnNo); } DITemplateValueParameter @@ -505,8 +502,8 @@ DIBuilder::createTemplateTemplateParameter(DIDescriptor Context, StringRef Name, DIType Ty, StringRef Val, MDNode *File, unsigned LineNo, unsigned ColumnNo) { - return createTemplateValueParameter( - dwarf::DW_TAG_GNU_template_template_param, Context, Name, Ty, + return createTemplateValueParameterHelper( + VMContext, dwarf::DW_TAG_GNU_template_template_param, Context, Name, Ty, MDString::get(VMContext, Val), File, LineNo, ColumnNo); } @@ -515,9 +512,9 @@ DIBuilder::createTemplateParameterPack(DIDescriptor Context, StringRef Name, DIType Ty, DIArray Val, MDNode *File, unsigned LineNo, unsigned ColumnNo) { - return createTemplateValueParameter(dwarf::DW_TAG_GNU_template_parameter_pack, - Context, Name, Ty, Val, File, LineNo, - ColumnNo); + return createTemplateValueParameterHelper( + VMContext, dwarf::DW_TAG_GNU_template_parameter_pack, Context, Name, Ty, + Val, File, LineNo, ColumnNo); } DICompositeType DIBuilder::createClassType(DIDescriptor Context, StringRef Name,