aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/VirtualFileSystem.cpp
diff options
context:
space:
mode:
authorAndrei Golubev <andrey.golubev@intel.com>2025-09-15 16:13:18 +0100
committerGitHub <noreply@github.com>2025-09-15 17:13:18 +0200
commitf5d3cf4a643fc13194e09cb39905f7f3b083f85e (patch)
tree1e7cf4781d983cf74907cf237634c78c1d01f282 /llvm/lib/Support/VirtualFileSystem.cpp
parent5365f8bc91d2d820092e904ecab21b841e3f5abb (diff)
downloadllvm-f5d3cf4a643fc13194e09cb39905f7f3b083f85e.zip
llvm-f5d3cf4a643fc13194e09cb39905f7f3b083f85e.tar.gz
llvm-f5d3cf4a643fc13194e09cb39905f7f3b083f85e.tar.bz2
[mlir][TableGen] Emit interface traits after all interfaces (#147699)
Interface traits may provide default implementation of methods. When this happens, the implementation may rely on another interface that is not yet defined meaning that one gets "incomplete type" error during C++ compilation. In pseudo-code, the problem is the following: ``` InterfaceA has methodB() { return InterfaceB(); } InterfaceB defined later // What's generated is: class InterfaceA { ... } class InterfaceATrait { // error: InterfaceB is an incomplete type InterfaceB methodB() { return InterfaceB(); } } class InterfaceB { ... } // defined here ``` The two more "advanced" cases are: * Cyclic dependency (A requires B and B requires A) * Type-traited usage of an incomplete type (e.g. `FailureOr<InterfaceB>`) It seems reasonable to emit interface traits *after* all of the interfaces have been defined to avoid the problem altogether. As a drive by, make forward declarations of the interfaces early so that user code does not need to forward declare.
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
0 files changed, 0 insertions, 0 deletions