mirror of https://github.com/llvm/circt.git
[Moore] Handle top-level typedefs by ignoring them
Typedefs are handled by Slang during type checking and don't need to be lowered into anything in the IR. Therefore ignore top-level typedefs.
This commit is contained in:
parent
728a2197b3
commit
dfd4483d01
|
@ -431,6 +431,13 @@ Context::convertCompilation(slang::ast::Compilation &compilation) {
|
|||
// which are listed separately as top instances.
|
||||
for (auto *unit : root.compilationUnits) {
|
||||
for (const auto &member : unit->members()) {
|
||||
// Ignore top-level constructs that are handled by Slang as part of name
|
||||
// resolution and type checking.
|
||||
if (member.as_if<slang::ast::EmptyMemberSymbol>() ||
|
||||
member.as_if<slang::ast::TransparentMemberSymbol>() ||
|
||||
member.as_if<slang::ast::TypeAliasType>())
|
||||
continue;
|
||||
|
||||
// Error out on all top-level declarations.
|
||||
auto loc = convertLocation(member.location);
|
||||
return mlir::emitError(loc, "unsupported construct: ")
|
||||
|
|
|
@ -4,6 +4,16 @@
|
|||
// Internal issue in Slang v3 about jump depending on uninitialised value.
|
||||
// UNSUPPORTED: valgrind
|
||||
|
||||
// Ignore time unit and precision.
|
||||
timeunit 100ps;
|
||||
timeprecision 10fs;
|
||||
timeunit 100ps/10fs;
|
||||
`timescale 100ps/10fs;
|
||||
|
||||
// Ignore type aliases and enum variant names imported into the parent scope.
|
||||
typedef int MyInt;
|
||||
typedef enum { VariantA, VariantB } MyEnum;
|
||||
|
||||
// CHECK-LABEL: moore.module @Empty() {
|
||||
// CHECK: }
|
||||
module Empty;
|
||||
|
|
Loading…
Reference in New Issue