Skip to content

Commit 972fe43

Browse files
marcaubererdwblaikie
authored andcommitted
[Kaleidoscope] Remove unused function argument
Removes an unused function argument from a code listing in the Kaleidoscope turorial in step 9. Reviewed By: dblaikie, MaskRay Differential Revision: https://reviews.llvm.org/D128628
1 parent 92fb310 commit 972fe43

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ information) and construct our function definition:
261261
unsigned ScopeLine = 0;
262262
DISubprogram *SP = DBuilder->createFunction(
263263
FContext, P.getName(), StringRef(), Unit, LineNo,
264-
CreateFunctionType(TheFunction->arg_size(), Unit),
264+
CreateFunctionType(TheFunction->arg_size()),
265265
false /* internal linkage */, true /* definition */, ScopeLine,
266266
DINode::FlagPrototyped, false);
267267
TheFunction->setSubprogram(SP);

llvm/examples/Kaleidoscope/Chapter9/toy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ void DebugInfo::emitLocation(ExprAST *AST) {
852852
Scope->getContext(), AST->getLine(), AST->getCol(), Scope));
853853
}
854854

855-
static DISubroutineType *CreateFunctionType(unsigned NumArgs, DIFile *Unit) {
855+
static DISubroutineType *CreateFunctionType(unsigned NumArgs) {
856856
SmallVector<Metadata *, 8> EltTys;
857857
DIType *DblTy = KSDbgInfo.getDoubleTy();
858858

@@ -1253,7 +1253,7 @@ Function *FunctionAST::codegen() {
12531253
unsigned ScopeLine = LineNo;
12541254
DISubprogram *SP = DBuilder->createFunction(
12551255
FContext, P.getName(), StringRef(), Unit, LineNo,
1256-
CreateFunctionType(TheFunction->arg_size(), Unit), ScopeLine,
1256+
CreateFunctionType(TheFunction->arg_size()), ScopeLine,
12571257
DINode::FlagPrototyped, DISubprogram::SPFlagDefinition);
12581258
TheFunction->setSubprogram(SP);
12591259

0 commit comments

Comments
 (0)