[llvm] 972fe43 - [Kaleidoscope] Remove unused function argument
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 30 13:47:09 PDT 2022
Author: Marc Auberer
Date: 2022-06-30T20:47:01Z
New Revision: 972fe431336e57fb8aa57c35f77ecb109415106f
URL: https://github.com/llvm/llvm-project/commit/972fe431336e57fb8aa57c35f77ecb109415106f
DIFF: https://github.com/llvm/llvm-project/commit/972fe431336e57fb8aa57c35f77ecb109415106f.diff
LOG: [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
Added:
Modified:
llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst
llvm/examples/Kaleidoscope/Chapter9/toy.cpp
Removed:
################################################################################
diff --git a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst
index 2ddd860b69d11..e74bf9b950a4f 100644
--- a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst
+++ b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst
@@ -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);
diff --git a/llvm/examples/Kaleidoscope/Chapter9/toy.cpp b/llvm/examples/Kaleidoscope/Chapter9/toy.cpp
index 1df947c875d17..17dc2332d9ccd 100644
--- a/llvm/examples/Kaleidoscope/Chapter9/toy.cpp
+++ b/llvm/examples/Kaleidoscope/Chapter9/toy.cpp
@@ -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);
More information about the llvm-commits
mailing list