forked from OSchip/llvm-project
Remove DIFile from createSubroutineType.
Patch by Amaury Sechet with a small modification by me. llvm-svn: 250374
This commit is contained in:
parent
28a6db5929
commit
bdafb3cd1c
|
@ -128,8 +128,7 @@ LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Dref, LLVMMetadataRef File,
|
|||
LLVMMetadataRef ParameterTypes) {
|
||||
DIBuilder *D = unwrap(Dref);
|
||||
return wrap(
|
||||
D->createSubroutineType(File ? unwrap<DIFile>(File) : nullptr,
|
||||
DITypeRefArray(unwrap<MDTuple>(ParameterTypes))));
|
||||
D->createSubroutineType(DITypeRefArray(unwrap<MDTuple>(ParameterTypes))));
|
||||
}
|
||||
|
||||
LLVMMetadataRef LLVMDIBuilderCreateStructType(
|
||||
|
|
|
@ -375,13 +375,11 @@ namespace llvm {
|
|||
DIType *UnderlyingType, StringRef UniqueIdentifier = "");
|
||||
|
||||
/// Create subroutine type.
|
||||
/// \param File File in which this subroutine is defined.
|
||||
/// \param ParameterTypes An array of subroutine parameter types. This
|
||||
/// includes return type at 0th index.
|
||||
/// \param Flags E.g.: LValueReference.
|
||||
/// These flags are used to emit dwarf attributes.
|
||||
DISubroutineType *createSubroutineType(DIFile *File,
|
||||
DITypeRefArray ParameterTypes,
|
||||
DISubroutineType *createSubroutineType(DITypeRefArray ParameterTypes,
|
||||
unsigned Flags = 0);
|
||||
|
||||
/// Create an external type reference.
|
||||
|
@ -702,7 +700,7 @@ namespace llvm {
|
|||
/// has a self-reference -- \a DIBuilder needs to track the array to
|
||||
/// resolve cycles.
|
||||
void replaceArrays(DICompositeType *&T, DINodeArray Elements,
|
||||
DINodeArray TParems = DINodeArray());
|
||||
DINodeArray TParams = DINodeArray());
|
||||
|
||||
/// Replace a temporary node.
|
||||
///
|
||||
|
|
|
@ -429,8 +429,7 @@ DICompositeType *DIBuilder::createUnionType(
|
|||
return R;
|
||||
}
|
||||
|
||||
DISubroutineType *DIBuilder::createSubroutineType(DIFile *File,
|
||||
DITypeRefArray ParameterTypes,
|
||||
DISubroutineType *DIBuilder::createSubroutineType(DITypeRefArray ParameterTypes,
|
||||
unsigned Flags) {
|
||||
return DISubroutineType::get(VMContext, Flags, ParameterTypes);
|
||||
}
|
||||
|
|
|
@ -312,7 +312,7 @@ TEST_F(IRBuilderTest, DIBuilder) {
|
|||
auto File = DIB.createFile("F.CBL", "/");
|
||||
auto CU = DIB.createCompileUnit(dwarf::DW_LANG_Cobol74, "F.CBL", "/",
|
||||
"llvm-cobol74", true, "", 0);
|
||||
auto Type = DIB.createSubroutineType(File, DIB.getOrCreateTypeArray(None));
|
||||
auto Type = DIB.createSubroutineType(DIB.getOrCreateTypeArray(None));
|
||||
DIB.createFunction(CU, "foo", "", File, 1, Type, false, true, 1, 0, true, F);
|
||||
AllocaInst *I = Builder.CreateAlloca(Builder.getInt8Ty());
|
||||
auto BarSP = DIB.createFunction(CU, "bar", "", File, 1, Type, false, true, 1,
|
||||
|
@ -362,7 +362,7 @@ TEST_F(IRBuilderTest, DebugLoc) {
|
|||
auto File = DIB.createFile("tmp.cpp", "/");
|
||||
auto CU = DIB.createCompileUnit(dwarf::DW_LANG_C_plus_plus_11, "tmp.cpp", "/",
|
||||
"", true, "", 0);
|
||||
auto SPType = DIB.createSubroutineType(File, DIB.getOrCreateTypeArray(None));
|
||||
auto SPType = DIB.createSubroutineType(DIB.getOrCreateTypeArray(None));
|
||||
auto SP =
|
||||
DIB.createFunction(CU, "foo", "foo", File, 1, SPType, false, true, 1);
|
||||
DebugLoc DL1 = DILocation::get(Ctx, 2, 0, SP);
|
||||
|
|
|
@ -231,7 +231,7 @@ protected:
|
|||
auto *File = DBuilder.createFile("filename.c", "/file/dir/");
|
||||
DITypeRefArray ParamTypes = DBuilder.getOrCreateTypeArray(None);
|
||||
DISubroutineType *FuncType =
|
||||
DBuilder.createSubroutineType(File, ParamTypes);
|
||||
DBuilder.createSubroutineType(ParamTypes);
|
||||
auto *CU =
|
||||
DBuilder.createCompileUnit(dwarf::DW_LANG_C99, "filename.c",
|
||||
"/file/dir", "CloneFunc", false, "", 0);
|
||||
|
|
Loading…
Reference in New Issue