llvm.org GIT mirror llvm / 6f565c0
Remove DIFile from createSubroutineType. Patch by Amaury Sechet with a small modification by me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250374 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 5 years ago
5 changed file(s) with 7 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
127127 LLVMMetadataRef ParameterTypes) {
128128 DIBuilder *D = unwrap(Dref);
129129 return wrap(
130 D->createSubroutineType(File ? unwrap(File) : nullptr,
131 DITypeRefArray(unwrap(ParameterTypes))));
130 D->createSubroutineType(DITypeRefArray(unwrap(ParameterTypes))));
132131 }
133132
134133 LLVMMetadataRef LLVMDIBuilderCreateStructType(
374374 DIType *UnderlyingType, StringRef UniqueIdentifier = "");
375375
376376 /// Create subroutine type.
377 /// \param File File in which this subroutine is defined.
378377 /// \param ParameterTypes An array of subroutine parameter types. This
379378 /// includes return type at 0th index.
380379 /// \param Flags E.g.: LValueReference.
381380 /// These flags are used to emit dwarf attributes.
382 DISubroutineType *createSubroutineType(DIFile *File,
383 DITypeRefArray ParameterTypes,
381 DISubroutineType *createSubroutineType(DITypeRefArray ParameterTypes,
384382 unsigned Flags = 0);
385383
386384 /// Create an external type reference.
701699 /// has a self-reference -- \a DIBuilder needs to track the array to
702700 /// resolve cycles.
703701 void replaceArrays(DICompositeType *&T, DINodeArray Elements,
704 DINodeArray TParems = DINodeArray());
702 DINodeArray TParams = DINodeArray());
705703
706704 /// Replace a temporary node.
707705 ///
428428 return R;
429429 }
430430
431 DISubroutineType *DIBuilder::createSubroutineType(DIFile *File,
432 DITypeRefArray ParameterTypes,
431 DISubroutineType *DIBuilder::createSubroutineType(DITypeRefArray ParameterTypes,
433432 unsigned Flags) {
434433 return DISubroutineType::get(VMContext, Flags, ParameterTypes);
435434 }
311311 auto File = DIB.createFile("F.CBL", "/");
312312 auto CU = DIB.createCompileUnit(dwarf::DW_LANG_Cobol74, "F.CBL", "/",
313313 "llvm-cobol74", true, "", 0);
314 auto Type = DIB.createSubroutineType(File, DIB.getOrCreateTypeArray(None));
314 auto Type = DIB.createSubroutineType(DIB.getOrCreateTypeArray(None));
315315 DIB.createFunction(CU, "foo", "", File, 1, Type, false, true, 1, 0, true, F);
316316 AllocaInst *I = Builder.CreateAlloca(Builder.getInt8Ty());
317317 auto BarSP = DIB.createFunction(CU, "bar", "", File, 1, Type, false, true, 1,
361361 auto File = DIB.createFile("tmp.cpp", "/");
362362 auto CU = DIB.createCompileUnit(dwarf::DW_LANG_C_plus_plus_11, "tmp.cpp", "/",
363363 "", true, "", 0);
364 auto SPType = DIB.createSubroutineType(File, DIB.getOrCreateTypeArray(None));
364 auto SPType = DIB.createSubroutineType(DIB.getOrCreateTypeArray(None));
365365 auto SP =
366366 DIB.createFunction(CU, "foo", "foo", File, 1, SPType, false, true, 1);
367367 DebugLoc DL1 = DILocation::get(Ctx, 2, 0, SP);
230230 auto *File = DBuilder.createFile("filename.c", "/file/dir/");
231231 DITypeRefArray ParamTypes = DBuilder.getOrCreateTypeArray(None);
232232 DISubroutineType *FuncType =
233 DBuilder.createSubroutineType(File, ParamTypes);
233 DBuilder.createSubroutineType(ParamTypes);
234234 auto *CU =
235235 DBuilder.createCompileUnit(dwarf::DW_LANG_C99, "filename.c",
236236 "/file/dir", "CloneFunc", false, "", 0);