[Mlir-commits] [mlir] Include <cstdlib> in Toy Lexer examples. (PR #110449)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Sep 29 22:05:15 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Alexey Samsonov (vonosmas)

<details>
<summary>Changes</summary>

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 1b5f6916199ce09244cdb52c6911f2028e6ca95a which removed inclusion of `<cmath>` and thus broke transitive inclusion of `<stdlib.h>` 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
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>
 

``````````

</details>


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


More information about the Mlir-commits mailing list