mirror of https://github.com/llvm/circt.git
[ImportVerilog] Ignore forward typedefs
Ignore `ForwardingTypedefSymbol` AST nodes, since Slang already deals with these when it does type checking. We don't need them to show up in the final IR.
This commit is contained in:
parent
c190ff421b
commit
bd5553bc78
|
@ -55,6 +55,9 @@ struct BaseVisitor {
|
|||
|
||||
// Skip typedefs.
|
||||
LogicalResult visit(const slang::ast::TypeAliasType &) { return success(); }
|
||||
LogicalResult visit(const slang::ast::ForwardingTypedefSymbol &) {
|
||||
return success();
|
||||
}
|
||||
|
||||
// Skip imports. The AST already has its names resolved.
|
||||
LogicalResult visit(const slang::ast::ExplicitImportSymbol &) {
|
||||
|
|
|
@ -11,10 +11,30 @@ timeprecision 10fs;
|
|||
timeunit 100ps/10fs;
|
||||
`timescale 100ps/10fs;
|
||||
|
||||
// Ignore type aliases and enum variant names imported into the parent scope.
|
||||
// Ignore type aliases, forward declarations of type aliases, and enum variant
|
||||
// names imported into the parent scope. These are resolved by Slang.
|
||||
typedef MyInt;
|
||||
typedef int MyInt;
|
||||
typedef MyInt;
|
||||
typedef MyInt;
|
||||
typedef enum { VariantA, VariantB } MyEnum;
|
||||
|
||||
module Typedefs1;
|
||||
typedef MyInt2;
|
||||
typedef int MyInt2;
|
||||
typedef MyInt2;
|
||||
typedef MyInt2;
|
||||
typedef enum { VariantC, VariantD } MyEnum2;
|
||||
endmodule
|
||||
|
||||
function void Typedefs2();
|
||||
typedef MyInt2;
|
||||
typedef int MyInt2;
|
||||
typedef MyInt2;
|
||||
typedef MyInt2;
|
||||
typedef enum { VariantC, VariantD } MyEnum2;
|
||||
endfunction
|
||||
|
||||
// Ignore imports.
|
||||
import Package::*;
|
||||
|
||||
|
|
Loading…
Reference in New Issue