phillipstanleymarbell / Noisy-lang-compiler

Noisy language compiler
MIT License
17 stars 1 forks source link

which llvm version do we use? #625

Closed PeiMu closed 2 years ago

PeiMu commented 2 years ago

Hi all,

Currently, passes related to LLVM are tested with LLVM 12 and 13 versions.

From the Readme file, it said we are working on LLVM 12 or LLVM 13.

/usr/lib/llvm-10/include/llvm/Support/Casting.h:141:56: note: candidate: ‘template<class X, class Y> bool llvm::isa(const Y&)’ 141 template <class X, class Y> LLVM_NODISCARD inline bool isa(const Y &Val) { ^~~ /usr/lib/llvm-10/include/llvm/Support/Casting.h:141:56: note: template argument deduction/substitution failed: newton-irPass-LLVMIR-rangeAnalysis.cpp:82:74: error: template argument 1 is invalid 82 } else if (isa(phiValue) isa(phiValue)) {

Bur from CI, an error is reported with LLVM 10.

So which version of LLVM do we use?

blackgeorge-boom commented 2 years ago

Hello @PeiMu. Can you paste the output of llvm-config --libdir?

edit: Ok, now I see you wrote that this is for the CI. Let me have a look.

blackgeorge-boom commented 2 years ago

@KomaGR Should we specify a version (e.g., 12 or 13), as described here?

https://github.com/marketplace/actions/install-clang

KomaGR commented 2 years ago

Thanks for opening the issue.

@blackgeorge-boom We're currently not using a marketplace action for installing LLVM (just a plain bash command). I would think it would be easier if we could just specify the version as part of the command. If not, then we could use that Action (if it installs LLVM and not just clang).

blackgeorge-boom commented 2 years ago

@KomaGR that's a good suggestion.

Combining https://github.com/phillipstanleymarbell/Noisy-lang-compiler/pull/610/commits/77d3c17c9b70e98d6b575a46553c3515834dc43a and https://github.com/phillipstanleymarbell/Noisy-lang-compiler/pull/610/commits/34de0f7e8619ec3b473dd1765540c8f5caf4f7a6 seems to do the trick.

I am not sure if in https://github.com/phillipstanleymarbell/Noisy-lang-compiler/pull/610/commits/34de0f7e8619ec3b473dd1765540c8f5caf4f7a6 this is the best way of setting the LLVM_CONFIG variable, so I'm open to other suggestions.

PeiMu commented 2 years ago

@KomaGR that's a good suggestion.

Combining 77d3c17 and 34de0f7 seems to do the trick.

I am not sure if in 34de0f7 this is the best way of setting the LLVM_CONFIG variable, so I'm open to other suggestions.

Thanks for the commits! It's worked!! :+1: