This is an archive of the discontinued LLVM Phabricator instance.

Remove circular dependency between libFIRSupport and libFIRDialect
ClosedPublic

Authored by Renaud-K on Mar 8 2023, 11:17 AM.

Details

Summary

Fix for shared library build. Moved the buildDispatchTable function from the .cpp the header file. Remove .cpp file since no longer needed

Diff Detail

Event Timeline

Renaud-K created this revision.Mar 8 2023, 11:17 AM
Herald added a project: Restricted Project. · View Herald Transcript
Renaud-K requested review of this revision.Mar 8 2023, 11:17 AM
tschuett added inline comments.
flang/include/flang/Optimizer/Support/Utils.h
18

You seem to have a dependency from support on the dialect? Shouldn't it be the other way around?

vzakhari accepted this revision.Mar 8 2023, 11:55 AM
vzakhari added inline comments.
flang/include/flang/Optimizer/Support/Utils.h
18

You seem to have a dependency from support on the dialect? Shouldn't it be the other way around?

Yes, this looks worrisome. I guess it should be okay while there is no link dependency on libFIRDialect. I am approving this for the sake of resolving the buildbot issue.

This revision is now accepted and ready to land.Mar 8 2023, 11:55 AM
Renaud-K added inline comments.Mar 8 2023, 12:05 PM
flang/include/flang/Optimizer/Support/Utils.h
18

We already have InternalNames.cpp dependending on FIRType.h, InitFIR.cpp dependending on FIRDialect.h and as you point out Utils.h depending on FIRType.h. FIROps.h depends on the same code generation step as FIRType.h. So this is not really adding anything new.
It is captured in the cmake files with

DEPENDS
  FIROpsIncGen

There is also a dependency of FIRDialect to FIRSupport at link time. That's unfortunate but it cannot be addressed by this patch.

flang/include/flang/Optimizer/Support/Utils.h