Skip to content

Include <cstdlib> in Toy Lexer examples. #110449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2024
Merged

Include <cstdlib> in Toy Lexer examples. #110449

merged 1 commit into from
Sep 30, 2024

Conversation

vonosmas
Copy link
Contributor

These files all use strtod - make sure to include a proper header for this function. Otherwise, building MLIR fails on some systems after the recent commit 1b5f691 which removed inclusion of <cmath> and thus broke transitive inclusion of <stdlib.h> in these headers.

These files all use strtod() - make sure to include a proper
header for this function. Otherwise, building MLIR fails on
some systems after the recent commit 1b5f691
which removed <cmath> and thus broke transitive inclusion
of <stdlib.h> in these headers.
@llvmbot llvmbot added the mlir label Sep 30, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 30, 2024

@llvm/pr-subscribers-mlir

Author: Alexey Samsonov (vonosmas)

Changes

These files all use strtod - make sure to include a proper header for this function. Otherwise, building MLIR fails on some systems after the recent commit 1b5f691 which removed inclusion of &lt;cmath&gt; and thus broke transitive inclusion of &lt;stdlib.h&gt; in these headers.


Full diff: https://github.com/llvm/llvm-project/pull/110449.diff

7 Files Affected:

  • (modified) mlir/examples/toy/Ch1/include/toy/Lexer.h (+1)
  • (modified) mlir/examples/toy/Ch2/include/toy/Lexer.h (+1)
  • (modified) mlir/examples/toy/Ch3/include/toy/Lexer.h (+1)
  • (modified) mlir/examples/toy/Ch4/include/toy/Lexer.h (+1)
  • (modified) mlir/examples/toy/Ch5/include/toy/Lexer.h (+1)
  • (modified) mlir/examples/toy/Ch6/include/toy/Lexer.h (+1)
  • (modified) mlir/examples/toy/Ch7/include/toy/Lexer.h (+1)
diff --git a/mlir/examples/toy/Ch1/include/toy/Lexer.h b/mlir/examples/toy/Ch1/include/toy/Lexer.h
index ecbb3b4e0e5835..d420a7ebbf3b68 100644
--- a/mlir/examples/toy/Ch1/include/toy/Lexer.h
+++ b/mlir/examples/toy/Ch1/include/toy/Lexer.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringRef.h"
 
+#include <cstdlib>
 #include <memory>
 #include <string>
 
diff --git a/mlir/examples/toy/Ch2/include/toy/Lexer.h b/mlir/examples/toy/Ch2/include/toy/Lexer.h
index 3c59cd9805fef6..22822cc1059578 100644
--- a/mlir/examples/toy/Ch2/include/toy/Lexer.h
+++ b/mlir/examples/toy/Ch2/include/toy/Lexer.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringRef.h"
 
+#include <cstdlib>
 #include <memory>
 #include <string>
 
diff --git a/mlir/examples/toy/Ch3/include/toy/Lexer.h b/mlir/examples/toy/Ch3/include/toy/Lexer.h
index 3c59cd9805fef6..22822cc1059578 100644
--- a/mlir/examples/toy/Ch3/include/toy/Lexer.h
+++ b/mlir/examples/toy/Ch3/include/toy/Lexer.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringRef.h"
 
+#include <cstdlib>
 #include <memory>
 #include <string>
 
diff --git a/mlir/examples/toy/Ch4/include/toy/Lexer.h b/mlir/examples/toy/Ch4/include/toy/Lexer.h
index 3c59cd9805fef6..22822cc1059578 100644
--- a/mlir/examples/toy/Ch4/include/toy/Lexer.h
+++ b/mlir/examples/toy/Ch4/include/toy/Lexer.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringRef.h"
 
+#include <cstdlib>
 #include <memory>
 #include <string>
 
diff --git a/mlir/examples/toy/Ch5/include/toy/Lexer.h b/mlir/examples/toy/Ch5/include/toy/Lexer.h
index 3c59cd9805fef6..22822cc1059578 100644
--- a/mlir/examples/toy/Ch5/include/toy/Lexer.h
+++ b/mlir/examples/toy/Ch5/include/toy/Lexer.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringRef.h"
 
+#include <cstdlib>
 #include <memory>
 #include <string>
 
diff --git a/mlir/examples/toy/Ch6/include/toy/Lexer.h b/mlir/examples/toy/Ch6/include/toy/Lexer.h
index 3c59cd9805fef6..22822cc1059578 100644
--- a/mlir/examples/toy/Ch6/include/toy/Lexer.h
+++ b/mlir/examples/toy/Ch6/include/toy/Lexer.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringRef.h"
 
+#include <cstdlib>
 #include <memory>
 #include <string>
 
diff --git a/mlir/examples/toy/Ch7/include/toy/Lexer.h b/mlir/examples/toy/Ch7/include/toy/Lexer.h
index a3fde91a357a3f..f022c2f48ac8e8 100644
--- a/mlir/examples/toy/Ch7/include/toy/Lexer.h
+++ b/mlir/examples/toy/Ch7/include/toy/Lexer.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringRef.h"
 
+#include <cstdlib>
 #include <memory>
 #include <string>
 

@rupprecht rupprecht self-assigned this Sep 30, 2024
@rupprecht rupprecht merged commit 8ab50da into llvm:main Sep 30, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants