From 0e0824a9f0fb10192d389599a772dfc60e4c5d26 Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Mon, 6 Jan 2025 20:54:51 +0900 Subject: [PATCH 01/14] Use native `AddIncludeFile` method --- cc/lib/TableGen.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/cc/lib/TableGen.cpp b/cc/lib/TableGen.cpp index b2ba602..f14f8a8 100644 --- a/cc/lib/TableGen.cpp +++ b/cc/lib/TableGen.cpp @@ -12,6 +12,7 @@ #include "TableGen.h" #include "Types.h" #include +#include using ctablegen::RecordMap; using ctablegen::tableGenFromRecType; @@ -43,16 +44,9 @@ bool ctablegen::TableGenParser::addSource(const char *source) { return true; } -bool ctablegen::TableGenParser::addSourceFile(const StringRef source) { - ErrorOr> FileOrErr = - MemoryBuffer::getFile(source); - - if (std::error_code EC = FileOrErr.getError()) { - return false; - } - - sourceMgr.AddNewSourceBuffer(std::move(*FileOrErr), SMLoc()); - return true; +bool ctablegen::TableGenParser::addSourceFile(const StringRef path) { + std::string full_path = ""; + return !sourceMgr.AddIncludeFile(std::string(path), SMLoc(), full_path); } TableGenParserRef tableGenGet() { From d64678bf53a48e26be4d395ae94d677597932a2b Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Mon, 6 Jan 2025 21:13:42 +0900 Subject: [PATCH 02/14] Add test --- src/lib.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index a31aa02..f304347 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -71,6 +71,24 @@ //! # } //! ``` //! +//! You can also pass an included file's path directly. +//! +//! ```rust +//! use tblgen_alt::{TableGenParser, RecordKeeper}; +//! use std::path::Path; +//! +//! # fn main() -> Result<(), Box> { +//! let keeper: RecordKeeper = TableGenParser::new() +//! .add_source_file("mlir/IR/OpBase.td")? +//! .add_include_path(&format!("{}/include", std::env::var("TABLEGEN_190_PREFIX")?)) +//! .parse()?; +//! let i32_def = keeper.def("I32").expect("has I32 def"); +//! assert!(i32_def.subclass_of("I")); +//! assert_eq!(i32_def.int_value("bitwidth"), Ok(32)); +//! # Ok(()) +//! # } +//! ``` +//! //! # API Stability //! //! LLVM does not provide a stable C API for TableGen, and the C API provided by From 2044c7b96b1a7f0c0dd91eb1af889ea06d047655 Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Mon, 6 Jan 2025 22:15:18 +0900 Subject: [PATCH 03/14] Revert "Use native `AddIncludeFile` method" This reverts commit 0e0824a9f0fb10192d389599a772dfc60e4c5d26. --- cc/lib/TableGen.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cc/lib/TableGen.cpp b/cc/lib/TableGen.cpp index f14f8a8..b2ba602 100644 --- a/cc/lib/TableGen.cpp +++ b/cc/lib/TableGen.cpp @@ -12,7 +12,6 @@ #include "TableGen.h" #include "Types.h" #include -#include using ctablegen::RecordMap; using ctablegen::tableGenFromRecType; @@ -44,9 +43,16 @@ bool ctablegen::TableGenParser::addSource(const char *source) { return true; } -bool ctablegen::TableGenParser::addSourceFile(const StringRef path) { - std::string full_path = ""; - return !sourceMgr.AddIncludeFile(std::string(path), SMLoc(), full_path); +bool ctablegen::TableGenParser::addSourceFile(const StringRef source) { + ErrorOr> FileOrErr = + MemoryBuffer::getFile(source); + + if (std::error_code EC = FileOrErr.getError()) { + return false; + } + + sourceMgr.AddNewSourceBuffer(std::move(*FileOrErr), SMLoc()); + return true; } TableGenParserRef tableGenGet() { From 6d005350035140d96f121b41d02500dbb2f226bb Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Mon, 6 Jan 2025 22:24:28 +0900 Subject: [PATCH 04/14] Show error --- cc/lib/TableGen.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cc/lib/TableGen.cpp b/cc/lib/TableGen.cpp index b2ba602..6b6a8e5 100644 --- a/cc/lib/TableGen.cpp +++ b/cc/lib/TableGen.cpp @@ -12,6 +12,7 @@ #include "TableGen.h" #include "Types.h" #include +#include using ctablegen::RecordMap; using ctablegen::tableGenFromRecType; @@ -48,6 +49,7 @@ bool ctablegen::TableGenParser::addSourceFile(const StringRef source) { MemoryBuffer::getFile(source); if (std::error_code EC = FileOrErr.getError()) { + std::cerr << "tablegen error: " << EC << "\n"; return false; } From a3ff5ccab468a95051e2bc42be38354197a7723e Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Mon, 6 Jan 2025 22:37:43 +0900 Subject: [PATCH 05/14] Revert "Show error" This reverts commit 6d005350035140d96f121b41d02500dbb2f226bb. --- cc/lib/TableGen.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/cc/lib/TableGen.cpp b/cc/lib/TableGen.cpp index 6b6a8e5..b2ba602 100644 --- a/cc/lib/TableGen.cpp +++ b/cc/lib/TableGen.cpp @@ -12,7 +12,6 @@ #include "TableGen.h" #include "Types.h" #include -#include using ctablegen::RecordMap; using ctablegen::tableGenFromRecType; @@ -49,7 +48,6 @@ bool ctablegen::TableGenParser::addSourceFile(const StringRef source) { MemoryBuffer::getFile(source); if (std::error_code EC = FileOrErr.getError()) { - std::cerr << "tablegen error: " << EC << "\n"; return false; } From 853e3e7d837a64591d6f5ed4e8a088aa87b31ddc Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Mon, 6 Jan 2025 22:37:48 +0900 Subject: [PATCH 06/14] Reapply "Use native `AddIncludeFile` method" This reverts commit 2044c7b96b1a7f0c0dd91eb1af889ea06d047655. --- cc/lib/TableGen.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/cc/lib/TableGen.cpp b/cc/lib/TableGen.cpp index b2ba602..f14f8a8 100644 --- a/cc/lib/TableGen.cpp +++ b/cc/lib/TableGen.cpp @@ -12,6 +12,7 @@ #include "TableGen.h" #include "Types.h" #include +#include using ctablegen::RecordMap; using ctablegen::tableGenFromRecType; @@ -43,16 +44,9 @@ bool ctablegen::TableGenParser::addSource(const char *source) { return true; } -bool ctablegen::TableGenParser::addSourceFile(const StringRef source) { - ErrorOr> FileOrErr = - MemoryBuffer::getFile(source); - - if (std::error_code EC = FileOrErr.getError()) { - return false; - } - - sourceMgr.AddNewSourceBuffer(std::move(*FileOrErr), SMLoc()); - return true; +bool ctablegen::TableGenParser::addSourceFile(const StringRef path) { + std::string full_path = ""; + return !sourceMgr.AddIncludeFile(std::string(path), SMLoc(), full_path); } TableGenParserRef tableGenGet() { From 1e5d0f367b2142521f1f0537e782a207c14c042f Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Mon, 6 Jan 2025 23:01:51 +0900 Subject: [PATCH 07/14] Fix search and parse order --- cc/include/TableGen.h | 26 ++++++++++++++------------ cc/lib/TableGen.cpp | 23 +++++++++++++++-------- cc/lib/TableGen.hpp | 11 +++++++---- src/lib.rs | 11 ++++------- 4 files changed, 40 insertions(+), 31 deletions(-) diff --git a/cc/include/TableGen.h b/cc/include/TableGen.h index 86d1645..8c29b83 100644 --- a/cc/include/TableGen.h +++ b/cc/include/TableGen.h @@ -26,10 +26,10 @@ extern "C" { #endif typedef enum { - TABLEGEN_DK_ERROR, - TABLEGEN_DK_WARNING, - TABLEGEN_DK_REMARK, - TABLEGEN_DK_NOTE, + TABLEGEN_DK_ERROR, + TABLEGEN_DK_WARNING, + TABLEGEN_DK_REMARK, + TABLEGEN_DK_NOTE, } TableGenDiagKind; typedef enum { @@ -54,8 +54,7 @@ typedef void (*TableGenStringCallback)(TableGenStringRef, void *); TableGenParserRef tableGenGet(); void tableGenFree(TableGenParserRef tg_ref); TableGenBool tableGenAddSource(TableGenParserRef tg_ref, const char *source); -TableGenBool tableGenAddSourceFile(TableGenParserRef tg_ref, - TableGenStringRef source); +void tableGenAddSourceFile(TableGenParserRef tg_ref, TableGenStringRef source); void tableGenAddIncludePath(TableGenParserRef tg_ref, TableGenStringRef include); @@ -162,14 +161,17 @@ TableGenBool tableGenIntInitGetValue(TableGenTypedInitRef ti, int64_t *integer); TableGenStringRef tableGenStringInitGetValue(TableGenTypedInitRef ti); char *tableGenStringInitGetValueNewString(TableGenTypedInitRef ti); TableGenRecordRef tableGenDefInitGetValue(TableGenTypedInitRef ti); -void tableGenInitPrint(TableGenTypedInitRef ti, - TableGenStringCallback callback, void *userData); +void tableGenInitPrint(TableGenTypedInitRef ti, TableGenStringCallback callback, + void *userData); void tableGenInitDump(TableGenTypedInitRef ti); -TableGenBool tableGenPrintError(TableGenParserRef ref, TableGenSourceLocationRef loc_ref, TableGenDiagKind dk, - TableGenStringRef message, - TableGenStringCallback callback, void *userData); +TableGenBool tableGenPrintError(TableGenParserRef ref, + TableGenSourceLocationRef loc_ref, + TableGenDiagKind dk, TableGenStringRef message, + TableGenStringCallback callback, + void *userData); TableGenSourceLocationRef tableGenSourceLocationNull(); -TableGenSourceLocationRef tableGenSourceLocationClone(TableGenSourceLocationRef loc_ref); +TableGenSourceLocationRef +tableGenSourceLocationClone(TableGenSourceLocationRef loc_ref); // Memory void tableGenSourceLocationFree(TableGenSourceLocationRef loc_ref); diff --git a/cc/lib/TableGen.cpp b/cc/lib/TableGen.cpp index f14f8a8..5e8501c 100644 --- a/cc/lib/TableGen.cpp +++ b/cc/lib/TableGen.cpp @@ -12,7 +12,7 @@ #include "TableGen.h" #include "Types.h" #include -#include +#include using ctablegen::RecordMap; using ctablegen::tableGenFromRecType; @@ -20,6 +20,14 @@ using ctablegen::tableGenFromRecType; RecordKeeper *ctablegen::TableGenParser::parse() { auto recordKeeper = new RecordKeeper; sourceMgr.setIncludeDirs(includeDirs); + + for (const auto &file : files) { + std::string full_path; + if (!sourceMgr.AddIncludeFile(std::string(file), SMLoc(), full_path)) { + return nullptr; + } + } + bool result = TableGenParseFile(sourceMgr, *recordKeeper); if (!result) { return recordKeeper; @@ -28,7 +36,7 @@ RecordKeeper *ctablegen::TableGenParser::parse() { return nullptr; } -void ctablegen::TableGenParser::addIncludePath(const StringRef include) { +void ctablegen::TableGenParser::addIncludeDirectory(const StringRef include) { includeDirs.push_back(std::string(include)); } @@ -44,9 +52,8 @@ bool ctablegen::TableGenParser::addSource(const char *source) { return true; } -bool ctablegen::TableGenParser::addSourceFile(const StringRef path) { - std::string full_path = ""; - return !sourceMgr.AddIncludeFile(std::string(path), SMLoc(), full_path); +void ctablegen::TableGenParser::addSourceFile(const StringRef file) { + files.push_back(std::string(file)); } TableGenParserRef tableGenGet() { @@ -55,8 +62,7 @@ TableGenParserRef tableGenGet() { void tableGenFree(TableGenParserRef tg_ref) { delete unwrap(tg_ref); } -TableGenBool tableGenAddSourceFile(TableGenParserRef tg_ref, - TableGenStringRef source) { +void tableGenAddSourceFile(TableGenParserRef tg_ref, TableGenStringRef source) { return unwrap(tg_ref)->addSourceFile(StringRef(source.data, source.len)); } @@ -66,7 +72,8 @@ TableGenBool tableGenAddSource(TableGenParserRef tg_ref, const char *source) { void tableGenAddIncludePath(TableGenParserRef tg_ref, TableGenStringRef include) { - return unwrap(tg_ref)->addIncludePath(StringRef(include.data, include.len)); + return unwrap(tg_ref)->addIncludeDirectory( + StringRef(include.data, include.len)); } TableGenRecordKeeperRef tableGenParse(TableGenParserRef tg_ref) { diff --git a/cc/lib/TableGen.hpp b/cc/lib/TableGen.hpp index c628bc8..02622d8 100644 --- a/cc/lib/TableGen.hpp +++ b/cc/lib/TableGen.hpp @@ -38,13 +38,15 @@ class TableGenParser { public: TableGenParser() {} bool addSource(const char *source); - bool addSourceFile(const StringRef source); - void addIncludePath(const StringRef include); + void addSourceFile(const StringRef source); + void addIncludeDirectory(const StringRef include); RecordKeeper *parse(); SourceMgr sourceMgr; + private: std::vector includeDirs; + std::vector files; }; // Utility @@ -60,7 +62,7 @@ class CallbackOstream : public llvm::raw_ostream { opaqueData(opaqueData), pos(0u) {} void write_impl(const char *ptr, size_t size) override { - TableGenStringRef string = TableGenStringRef { .data = ptr, .len = size }; + TableGenStringRef string = TableGenStringRef{.data = ptr, .len = size}; callback(string, opaqueData); pos += size; } @@ -75,7 +77,8 @@ class CallbackOstream : public llvm::raw_ostream { } // namespace ctablegen -DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ctablegen::TableGenParser, TableGenParserRef); +DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ctablegen::TableGenParser, + TableGenParserRef); DEFINE_SIMPLE_CONVERSION_FUNCTIONS(RecordKeeper, TableGenRecordKeeperRef); DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ctablegen::RecordMap, TableGenRecordMapRef); diff --git a/src/lib.rs b/src/lib.rs index f304347..42475f4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -79,7 +79,7 @@ //! //! # fn main() -> Result<(), Box> { //! let keeper: RecordKeeper = TableGenParser::new() -//! .add_source_file("mlir/IR/OpBase.td")? +//! .add_source_file("mlir/IR/OpBase.td") //! .add_include_path(&format!("{}/include", std::env::var("TABLEGEN_190_PREFIX")?)) //! .parse()?; //! let i32_def = keeper.def("I32").expect("has I32 def"); @@ -168,12 +168,9 @@ impl<'s> TableGenParser<'s> { } /// Reads TableGen source code from the file at the given path. - pub fn add_source_file(self, source: &str) -> Result { - if unsafe { tableGenAddSourceFile(self.raw, StringRef::from(source).to_raw()) > 0 } { - Ok(self) - } else { - Err(TableGenError::InvalidSource.into()) - } + pub fn add_source_file(self, source: &str) -> Self { + unsafe { tableGenAddSourceFile(self.raw, StringRef::from(source).to_raw()) } + self } /// Adds the given TableGen source string. From e2d9e6aaadc33bd2cddadf9be81104f11071639c Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Mon, 6 Jan 2025 23:09:27 +0900 Subject: [PATCH 08/14] Remove unused header --- cc/lib/TableGen.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/cc/lib/TableGen.cpp b/cc/lib/TableGen.cpp index 5e8501c..c85e8fd 100644 --- a/cc/lib/TableGen.cpp +++ b/cc/lib/TableGen.cpp @@ -12,7 +12,6 @@ #include "TableGen.h" #include "Types.h" #include -#include using ctablegen::RecordMap; using ctablegen::tableGenFromRecType; From 5f269c21749b6a85c1ed8caeff2f89fdd35b73bb Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Mon, 6 Jan 2025 23:10:13 +0900 Subject: [PATCH 09/14] Remove unnecessary wrapper --- cc/lib/TableGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cc/lib/TableGen.cpp b/cc/lib/TableGen.cpp index c85e8fd..185c3d2 100644 --- a/cc/lib/TableGen.cpp +++ b/cc/lib/TableGen.cpp @@ -22,7 +22,7 @@ RecordKeeper *ctablegen::TableGenParser::parse() { for (const auto &file : files) { std::string full_path; - if (!sourceMgr.AddIncludeFile(std::string(file), SMLoc(), full_path)) { + if (!sourceMgr.AddIncludeFile(file, SMLoc(), full_path)) { return nullptr; } } From abf836f23d69556387c9fe62964283de3a0dc82a Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Mon, 6 Jan 2025 23:11:09 +0900 Subject: [PATCH 10/14] Remove unnecessary return --- cc/lib/TableGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cc/lib/TableGen.cpp b/cc/lib/TableGen.cpp index 185c3d2..0ac437e 100644 --- a/cc/lib/TableGen.cpp +++ b/cc/lib/TableGen.cpp @@ -62,7 +62,7 @@ TableGenParserRef tableGenGet() { void tableGenFree(TableGenParserRef tg_ref) { delete unwrap(tg_ref); } void tableGenAddSourceFile(TableGenParserRef tg_ref, TableGenStringRef source) { - return unwrap(tg_ref)->addSourceFile(StringRef(source.data, source.len)); + unwrap(tg_ref)->addSourceFile(StringRef(source.data, source.len)); } TableGenBool tableGenAddSource(TableGenParserRef tg_ref, const char *source) { From d1253c46c377bd4759da82582364e02a50a9c82d Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Mon, 6 Jan 2025 23:11:55 +0900 Subject: [PATCH 11/14] Rename function --- cc/include/TableGen.h | 2 +- cc/lib/TableGen.cpp | 2 +- src/lib.rs | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cc/include/TableGen.h b/cc/include/TableGen.h index 8c29b83..d407824 100644 --- a/cc/include/TableGen.h +++ b/cc/include/TableGen.h @@ -55,7 +55,7 @@ TableGenParserRef tableGenGet(); void tableGenFree(TableGenParserRef tg_ref); TableGenBool tableGenAddSource(TableGenParserRef tg_ref, const char *source); void tableGenAddSourceFile(TableGenParserRef tg_ref, TableGenStringRef source); -void tableGenAddIncludePath(TableGenParserRef tg_ref, +void tableGenAddIncludeDirectory(TableGenParserRef tg_ref, TableGenStringRef include); /// NOTE: TableGen currently relies on global state within a given parser diff --git a/cc/lib/TableGen.cpp b/cc/lib/TableGen.cpp index 0ac437e..7d6308d 100644 --- a/cc/lib/TableGen.cpp +++ b/cc/lib/TableGen.cpp @@ -69,7 +69,7 @@ TableGenBool tableGenAddSource(TableGenParserRef tg_ref, const char *source) { return unwrap(tg_ref)->addSource(source); } -void tableGenAddIncludePath(TableGenParserRef tg_ref, +void tableGenAddIncludeDirectory(TableGenParserRef tg_ref, TableGenStringRef include) { return unwrap(tg_ref)->addIncludeDirectory( StringRef(include.data, include.len)); diff --git a/src/lib.rs b/src/lib.rs index 42475f4..1c0279d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -62,7 +62,7 @@ //! # fn main() -> Result<(), Box> { //! let keeper: RecordKeeper = TableGenParser::new() //! .add_source(r#"include "mlir/IR/OpBase.td""#)? -//! .add_include_path(&format!("{}/include", std::env::var("TABLEGEN_190_PREFIX")?)) +//! .add_include_directory(&format!("{}/include", std::env::var("TABLEGEN_190_PREFIX")?)) //! .parse()?; //! let i32_def = keeper.def("I32").expect("has I32 def"); //! assert!(i32_def.subclass_of("I")); @@ -80,7 +80,7 @@ //! # fn main() -> Result<(), Box> { //! let keeper: RecordKeeper = TableGenParser::new() //! .add_source_file("mlir/IR/OpBase.td") -//! .add_include_path(&format!("{}/include", std::env::var("TABLEGEN_190_PREFIX")?)) +//! .add_include_directory(&format!("{}/include", std::env::var("TABLEGEN_190_PREFIX")?)) //! .parse()?; //! let i32_def = keeper.def("I32").expect("has I32 def"); //! assert!(i32_def.subclass_of("I")); @@ -126,7 +126,7 @@ pub use record::RecordValue; pub use record_keeper::RecordKeeper; use raw::{ - tableGenAddIncludePath, tableGenAddSource, tableGenAddSourceFile, tableGenFree, tableGenGet, + tableGenAddIncludeDirectory, tableGenAddSource, tableGenAddSourceFile, tableGenFree, tableGenGet, tableGenParse, TableGenParserRef, }; use string_ref::StringRef; @@ -162,8 +162,8 @@ impl<'s> TableGenParser<'s> { } /// Adds the given path to the list of included directories. - pub fn add_include_path(self, include: &str) -> Self { - unsafe { tableGenAddIncludePath(self.raw, StringRef::from(include).to_raw()) } + pub fn add_include_directory(self, include: &str) -> Self { + unsafe { tableGenAddIncludeDirectory(self.raw, StringRef::from(include).to_raw()) } self } From fa5b3995ef0fe370c245be9e4013a50627ec4db8 Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Mon, 6 Jan 2025 23:13:22 +0900 Subject: [PATCH 12/14] Update documentation --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1c0279d..1eb511e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -71,7 +71,7 @@ //! # } //! ``` //! -//! You can also pass an included file's path directly. +//! You can also pass an included filename directly. //! //! ```rust //! use tblgen_alt::{TableGenParser, RecordKeeper}; @@ -126,8 +126,8 @@ pub use record::RecordValue; pub use record_keeper::RecordKeeper; use raw::{ - tableGenAddIncludeDirectory, tableGenAddSource, tableGenAddSourceFile, tableGenFree, tableGenGet, - tableGenParse, TableGenParserRef, + tableGenAddIncludeDirectory, tableGenAddSource, tableGenAddSourceFile, tableGenFree, + tableGenGet, tableGenParse, TableGenParserRef, }; use string_ref::StringRef; From f5b256035cf5a214edb0d2e2a10cd37c0d6e4ef5 Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Tue, 7 Jan 2025 19:22:07 +0900 Subject: [PATCH 13/14] Fix library paths --- tools/setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/setup.sh b/tools/setup.sh index 3e68f82..db74d0f 100755 --- a/tools/setup.sh +++ b/tools/setup.sh @@ -11,5 +11,5 @@ llvm_prefix=$(brew --prefix llvm@$llvm_version) echo TABLEGEN_190_PREFIX=$llvm_prefix >>$GITHUB_ENV echo PATH=$llvm_prefix/bin:$PATH >>$GITHUB_ENV -echo LIBRARY_PATH=$(brew --prefix)/lib:$LIBRARY_PATH >>$GITHUB_ENV -echo LD_LIBRARY_PATH=$(brew --prefix)/lib:$LD_LIBRARY_PATH >>$GITHUB_ENV +echo LIBRARY_PATH=$llvm_prefix/lib:$LIBRARY_PATH >>$GITHUB_ENV +echo LD_LIBRARY_PATH=$llvm_prefix/lib:$LD_LIBRARY_PATH >>$GITHUB_ENV From 46ac7f03c00d0838b6dad60a1d071846fce7d02f Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Tue, 7 Jan 2025 19:22:44 +0900 Subject: [PATCH 14/14] Revert "Fix library paths" This reverts commit f5b256035cf5a214edb0d2e2a10cd37c0d6e4ef5. --- tools/setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/setup.sh b/tools/setup.sh index db74d0f..3e68f82 100755 --- a/tools/setup.sh +++ b/tools/setup.sh @@ -11,5 +11,5 @@ llvm_prefix=$(brew --prefix llvm@$llvm_version) echo TABLEGEN_190_PREFIX=$llvm_prefix >>$GITHUB_ENV echo PATH=$llvm_prefix/bin:$PATH >>$GITHUB_ENV -echo LIBRARY_PATH=$llvm_prefix/lib:$LIBRARY_PATH >>$GITHUB_ENV -echo LD_LIBRARY_PATH=$llvm_prefix/lib:$LD_LIBRARY_PATH >>$GITHUB_ENV +echo LIBRARY_PATH=$(brew --prefix)/lib:$LIBRARY_PATH >>$GITHUB_ENV +echo LD_LIBRARY_PATH=$(brew --prefix)/lib:$LD_LIBRARY_PATH >>$GITHUB_ENV