[llvm] [llvm] Fix Typos in Kaleidoscope MCJIT Examples (PR #134394)

Steven Hedges via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 4 07:56:19 PDT 2025


https://github.com/StevenH34 created https://github.com/llvm/llvm-project/pull/134394

Fix a few typos found in llvm/examples/Kaleidoscope/MCJIT/.

>From 1c91b125c33e2057f6bb11a73335bbff441808dc Mon Sep 17 00:00:00 2001
From: Steven Hedges <steven.hedges34 at gmail.com>
Date: Fri, 4 Apr 2025 09:43:14 -0400
Subject: [PATCH] fix typos in comments

---
 llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp | 4 ++--
 llvm/examples/Kaleidoscope/MCJIT/cached/toy.cpp     | 4 ++--
 llvm/examples/Kaleidoscope/MCJIT/complete/toy.cpp   | 4 ++--
 llvm/examples/Kaleidoscope/MCJIT/initial/toy.cpp    | 4 ++--
 llvm/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp   | 2 +-
 llvm/examples/Kaleidoscope/MCJIT/lazy/toy.cpp       | 4 ++--
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp b/llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp
index ed1262b59064b..dd2e8d2ca941d 100644
--- a/llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp
+++ b/llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp
@@ -564,7 +564,7 @@ static PrototypeAST *ParsePrototype() {
     // Read the precedence if present.
     if (CurTok == tok_number) {
       if (NumVal < 1 || NumVal > 100)
-        return ErrorP("Invalid precedecnce: must be 1..100");
+        return ErrorP("Invalid precedence: must be 1..100");
       BinaryPrecedence = (unsigned)NumVal;
       getNextToken();
     }
@@ -670,7 +670,7 @@ Value *BinaryExprAST::Codegen() {
   if (Op == '=') {
     // Assignment requires the LHS to be an identifier.
     // For now, I'm building without RTTI because LLVM builds that way by
-    // default and so we need to build that way to use the command line supprt.
+    // default and so we need to build that way to use the command line support.
     // If you build LLVM with RTTI this can be changed back to a dynamic_cast.
     VariableExprAST *LHSE = static_cast<VariableExprAST*>(LHS);
     if (!LHSE)
diff --git a/llvm/examples/Kaleidoscope/MCJIT/cached/toy.cpp b/llvm/examples/Kaleidoscope/MCJIT/cached/toy.cpp
index b4b7eac8a8831..629756e95deb0 100644
--- a/llvm/examples/Kaleidoscope/MCJIT/cached/toy.cpp
+++ b/llvm/examples/Kaleidoscope/MCJIT/cached/toy.cpp
@@ -571,7 +571,7 @@ static PrototypeAST *ParsePrototype() {
     // Read the precedence if present.
     if (CurTok == tok_number) {
       if (NumVal < 1 || NumVal > 100)
-        return ErrorP("Invalid precedecnce: must be 1..100");
+        return ErrorP("Invalid precedence: must be 1..100");
       BinaryPrecedence = (unsigned)NumVal;
       getNextToken();
     }
@@ -647,7 +647,7 @@ std::string MakeLegalFunctionName(std::string Name)
   // Start with what we have
   NewName = Name;
 
-  // Look for a numberic first character
+  // Look for a numeric first character
   if (NewName.find_first_of("0123456789") == 0) {
     NewName.insert(0, 1, 'n');
   }
diff --git a/llvm/examples/Kaleidoscope/MCJIT/complete/toy.cpp b/llvm/examples/Kaleidoscope/MCJIT/complete/toy.cpp
index bc2267fe18293..8f1fc1c6aaf9a 100644
--- a/llvm/examples/Kaleidoscope/MCJIT/complete/toy.cpp
+++ b/llvm/examples/Kaleidoscope/MCJIT/complete/toy.cpp
@@ -590,7 +590,7 @@ static PrototypeAST *ParsePrototype() {
     // Read the precedence if present.
     if (CurTok == tok_number) {
       if (NumVal < 1 || NumVal > 100)
-        return ErrorP("Invalid precedecnce: must be 1..100");
+        return ErrorP("Invalid precedence: must be 1..100");
       BinaryPrecedence = (unsigned)NumVal;
       getNextToken();
     }
@@ -666,7 +666,7 @@ std::string MakeLegalFunctionName(std::string Name)
   // Start with what we have
   NewName = Name;
 
-  // Look for a numberic first character
+  // Look for a numeric first character
   if (NewName.find_first_of("0123456789") == 0) {
     NewName.insert(0, 1, 'n');
   }
diff --git a/llvm/examples/Kaleidoscope/MCJIT/initial/toy.cpp b/llvm/examples/Kaleidoscope/MCJIT/initial/toy.cpp
index 16535057ed9ec..6e4de6d2cb74e 100644
--- a/llvm/examples/Kaleidoscope/MCJIT/initial/toy.cpp
+++ b/llvm/examples/Kaleidoscope/MCJIT/initial/toy.cpp
@@ -548,7 +548,7 @@ static PrototypeAST *ParsePrototype() {
     // Read the precedence if present.
     if (CurTok == tok_number) {
       if (NumVal < 1 || NumVal > 100)
-        return ErrorP("Invalid precedecnce: must be 1..100");
+        return ErrorP("Invalid precedence: must be 1..100");
       BinaryPrecedence = (unsigned)NumVal;
       getNextToken();
     }
@@ -624,7 +624,7 @@ std::string MakeLegalFunctionName(std::string Name)
   // Start with what we have
   NewName = Name;
 
-  // Look for a numberic first character
+  // Look for a numeric first character
   if (NewName.find_first_of("0123456789") == 0) {
     NewName.insert(0, 1, 'n');
   }
diff --git a/llvm/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp b/llvm/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp
index b9147e933c53a..131801b56f4ab 100644
--- a/llvm/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp
+++ b/llvm/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp
@@ -549,7 +549,7 @@ static PrototypeAST *ParsePrototype() {
     // Read the precedence if present.
     if (CurTok == tok_number) {
       if (NumVal < 1 || NumVal > 100)
-        return ErrorP("Invalid precedecnce: must be 1..100");
+        return ErrorP("Invalid precedence: must be 1..100");
       BinaryPrecedence = (unsigned)NumVal;
       getNextToken();
     }
diff --git a/llvm/examples/Kaleidoscope/MCJIT/lazy/toy.cpp b/llvm/examples/Kaleidoscope/MCJIT/lazy/toy.cpp
index 0a6254da70639..0680be37fe093 100644
--- a/llvm/examples/Kaleidoscope/MCJIT/lazy/toy.cpp
+++ b/llvm/examples/Kaleidoscope/MCJIT/lazy/toy.cpp
@@ -550,7 +550,7 @@ static PrototypeAST *ParsePrototype() {
     // Read the precedence if present.
     if (CurTok == tok_number) {
       if (NumVal < 1 || NumVal > 100)
-        return ErrorP("Invalid precedecnce: must be 1..100");
+        return ErrorP("Invalid precedence: must be 1..100");
       BinaryPrecedence = (unsigned)NumVal;
       getNextToken();
     }
@@ -626,7 +626,7 @@ std::string MakeLegalFunctionName(std::string Name)
   // Start with what we have
   NewName = Name;
 
-  // Look for a numberic first character
+  // Look for a numeric first character
   if (NewName.find_first_of("0123456789") == 0) {
     NewName.insert(0, 1, 'n');
   }



More information about the llvm-commits mailing list