This is an archive of the discontinued LLVM Phabricator instance.

[fir] Clean up InitFIR.h
ClosedPublic

Authored by clementval on Oct 11 2021, 5:39 AM.

Details

Summary

Clean up InitFIR.h file.

This patch is part of the upstreaming effort from fir-dev branch.

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>

Diff Detail

Event Timeline

clementval created this revision.Oct 11 2021, 5:39 AM
Herald added a project: Restricted Project. · View Herald Transcript
clementval requested review of this revision.Oct 11 2021, 5:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 11 2021, 5:39 AM

LGTM.

registerOptCodeGenPasses is autogenerated in ./tools/flang/include/flang/Optimizer/CodeGen/CGPasses.h.inc in build directory.

This revision is now accepted and ready to land.Oct 11 2021, 5:58 AM
This revision was automatically updated to reflect the committed changes.
mehdi_amini added inline comments.Oct 11 2021, 9:31 AM
flang/include/flang/Optimizer/Support/InitFIR.h
30

This macro is unused? If so can you just remove it?

clementval added inline comments.Oct 11 2021, 9:34 AM
flang/include/flang/Optimizer/Support/InitFIR.h
30

It is used on line 34.

mehdi_amini added inline comments.Oct 11 2021, 10:20 AM
flang/include/flang/Optimizer/Support/InitFIR.h
30

Uh, I missed this somehow (I probably fat-fingered when I did cmd+f to search on the page).

How is this macro intended to be used otherwise? (i.e. there must be a reason to split it right?)
Likely worth a comment.

clementval added inline comments.Oct 11 2021, 10:42 AM
flang/include/flang/Optimizer/Support/InitFIR.h
30

It will be used when we can upstream more code here (which we cannot at the moment since it will bring 10'000 lines with it).

The two functions below will be used by the new flang driver

inline void registerNonCodegenDialects(mlir::DialectRegistry &registry) {
  registry.insert<FLANG_NONCODEGEN_DIALECT_LIST>();
}

inline void registerDialects(mlir::DialectRegistry &registry) {
  registry.insert<FLANG_DIALECT_LIST>();
}