-
Notifications
You must be signed in to change notification settings - Fork 368
[ImportVerilog] Bump slang to version 8 #7792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# slang uses exceptions | ||
set(LLVM_REQUIRES_EH ON) | ||
set(LLVM_REQUIRES_RTTI ON) | ||
# The Slang headers contain C++20 code. So anything that interfaces directly | ||
# with Slang must be built accordingly. | ||
set(CMAKE_CXX_STANDARD 20) | ||
|
||
# For ABI compatibility, define the DEBUG macro in debug builds. Slang sets this | ||
# internally. If we don't set this here as well, header-defined things like the | ||
|
@@ -9,22 +9,23 @@ set(LLVM_REQUIRES_RTTI ON) | |
# or modified by code compiled in the Slang compilation unit. | ||
add_compile_definitions($<$<CONFIG:Debug>:DEBUG>) | ||
|
||
# HACK: When the `OBJECT` argument is passed to `llvm_add_library()`, | ||
# `COMPILE_DEFINITIONS` are not correctly inherited. For that reason, we | ||
# manually set it here. | ||
if(TARGET Boost::headers) | ||
add_compile_definitions( | ||
$<TARGET_PROPERTY:Boost::headers,INTERFACE_COMPILE_DEFINITIONS>) | ||
endif() | ||
|
||
# Disable some compiler warnings caused by slang headers such that the | ||
# `ImportVerilog` build doesn't spew out a ton of warnings that are not related | ||
# to CIRCT. | ||
if (MSVC) | ||
# No idea what to put here | ||
else () | ||
# slang uses exceptions; we intercept these in ImportVerilog | ||
add_compile_options(-fexceptions) | ||
add_compile_options(-frtti) | ||
if (NOT MSVC) | ||
# slang has some classes with virtual funcs but non-virtual destructor. | ||
add_compile_options(-Wno-non-virtual-dtor) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW these should all be fixed now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And by that I mean all of the various warnings being suppressed here should no longer be needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was only able to remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yes, that is possible There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 I'm going to give v9 a try again once this has landed. |
||
# some other warnings we've seen | ||
add_compile_options(-Wno-c++98-compat-extra-semi) | ||
add_compile_options(-Wno-ctad-maybe-unsupported) | ||
add_compile_options(-Wno-cast-qual) | ||
# visitor switch statements cover all cases but have default | ||
add_compile_options(-Wno-covered-switch-default) | ||
endif () | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -647,8 +647,8 @@ inline FVInt operator-(uint64_t a, const FVInt &b) { | |
|
||
inline FVInt operator-(const APInt &a, const FVInt &b) { return FVInt(a) - b; } | ||
|
||
inline bool operator==(uint64_t a, const FVInt &b) { return b == a; } | ||
inline bool operator!=(uint64_t a, const FVInt &b) { return b != a; } | ||
inline bool operator==(uint64_t a, const FVInt &b) { return b.operator==(a); } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How is this related to the slang version? Is it picking up some overzealous global operator in slang somewhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a consequence of building There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, just an artifact of C++20 and not anything slang is doing. Maybe you can just ifdef out these overloads when compiling in C++20 mode. |
||
inline bool operator!=(uint64_t a, const FVInt &b) { return b.operator!=(a); } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any tips on how to best deal with https://timsong-cpp.github.io/cppwp/n4868/over.match#oper-3.4.4 in a codebase that still needs to support older standards? |
||
|
||
inline raw_ostream &operator<<(raw_ostream &os, const FVInt &value) { | ||
value.print(os); | ||
|
Uh oh!
There was an error while loading. Please reload this page.