[Kaleidoscope] Remove unused function argument
authorMarc Auberer <marc.auberer@chillibits.com>
Thu, 30 Jun 2022 20:46:25 +0000 (20:46 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 30 Jun 2022 20:47:01 +0000 (20:47 +0000)
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

llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst
llvm/examples/Kaleidoscope/Chapter9/toy.cpp

index 2ddd860..e74bf9b 100644 (file)
@@ -261,7 +261,7 @@ information) and construct our function definition:
   unsigned ScopeLine = 0;
   DISubprogram *SP = DBuilder->createFunction(
       FContext, P.getName(), StringRef(), Unit, LineNo,
-      CreateFunctionType(TheFunction->arg_size(), Unit),
+      CreateFunctionType(TheFunction->arg_size()),
       false /* internal linkage */, true /* definition */, ScopeLine,
       DINode::FlagPrototyped, false);
   TheFunction->setSubprogram(SP);
index 1df947c..17dc233 100644 (file)
@@ -852,7 +852,7 @@ void DebugInfo::emitLocation(ExprAST *AST) {
       Scope->getContext(), AST->getLine(), AST->getCol(), Scope));
 }
 
-static DISubroutineType *CreateFunctionType(unsigned NumArgs, DIFile *Unit) {
+static DISubroutineType *CreateFunctionType(unsigned NumArgs) {
   SmallVector<Metadata *, 8> EltTys;
   DIType *DblTy = KSDbgInfo.getDoubleTy();
 
@@ -1253,7 +1253,7 @@ Function *FunctionAST::codegen() {
   unsigned ScopeLine = LineNo;
   DISubprogram *SP = DBuilder->createFunction(
       FContext, P.getName(), StringRef(), Unit, LineNo,
-      CreateFunctionType(TheFunction->arg_size(), Unit), ScopeLine,
+      CreateFunctionType(TheFunction->arg_size()), ScopeLine,
       DINode::FlagPrototyped, DISubprogram::SPFlagDefinition);
   TheFunction->setSubprogram(SP);