Skip to content

Commit 8ab50da

Browse files
authored
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 1b5f691 which removed inclusion of `<cmath>` and thus broke transitive inclusion of `<stdlib.h>` in these headers.
1 parent 41145fe commit 8ab50da

File tree

7 files changed

+7
-0
lines changed

7 files changed

+7
-0
lines changed

mlir/examples/toy/Ch1/include/toy/Lexer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "llvm/ADT/StringRef.h"
1717

18+
#include <cstdlib>
1819
#include <memory>
1920
#include <string>
2021

mlir/examples/toy/Ch2/include/toy/Lexer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "llvm/ADT/StringRef.h"
1717

18+
#include <cstdlib>
1819
#include <memory>
1920
#include <string>
2021

mlir/examples/toy/Ch3/include/toy/Lexer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "llvm/ADT/StringRef.h"
1717

18+
#include <cstdlib>
1819
#include <memory>
1920
#include <string>
2021

mlir/examples/toy/Ch4/include/toy/Lexer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "llvm/ADT/StringRef.h"
1717

18+
#include <cstdlib>
1819
#include <memory>
1920
#include <string>
2021

mlir/examples/toy/Ch5/include/toy/Lexer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "llvm/ADT/StringRef.h"
1717

18+
#include <cstdlib>
1819
#include <memory>
1920
#include <string>
2021

mlir/examples/toy/Ch6/include/toy/Lexer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "llvm/ADT/StringRef.h"
1717

18+
#include <cstdlib>
1819
#include <memory>
1920
#include <string>
2021

mlir/examples/toy/Ch7/include/toy/Lexer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "llvm/ADT/StringRef.h"
1717

18+
#include <cstdlib>
1819
#include <memory>
1920
#include <string>
2021

0 commit comments

Comments
 (0)