[Mlir-commits] [mlir] 8ab50da - Include <cstdlib> in Toy Lexer examples. (#110449)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Sep 30 11:20:35 PDT 2024
Author: Alexey Samsonov
Date: 2024-09-30T13:20:32-05:00
New Revision: 8ab50da589fd2692052dcb85edf06d1d2d8da42c
URL: https://github.com/llvm/llvm-project/commit/8ab50da589fd2692052dcb85edf06d1d2d8da42c
DIFF: https://github.com/llvm/llvm-project/commit/8ab50da589fd2692052dcb85edf06d1d2d8da42c.diff
LOG: Include <cstdlib> in Toy Lexer examples. (#110449)
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.
Added:
Modified:
mlir/examples/toy/Ch1/include/toy/Lexer.h
mlir/examples/toy/Ch2/include/toy/Lexer.h
mlir/examples/toy/Ch3/include/toy/Lexer.h
mlir/examples/toy/Ch4/include/toy/Lexer.h
mlir/examples/toy/Ch5/include/toy/Lexer.h
mlir/examples/toy/Ch6/include/toy/Lexer.h
mlir/examples/toy/Ch7/include/toy/Lexer.h
Removed:
################################################################################
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>
More information about the Mlir-commits
mailing list