This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add ComplexExpr code for lowering
ClosedPublic

Authored by schweitz on Jun 5 2020, 11:32 AM.

Details

Summary
[flang] Add the complex expression helper class.

The complex expression helper class can be used to generate small,
short-lived instances of a "helper" that can be used to aid the
construction of complex expressions in FIR. The helper class bundles
together these functionally related operations.

Included in this diff is the header for the FIR builder. The
implementation has other dependences and will follow.

Diff Detail

Event Timeline

schweitz created this revision.Jun 5 2020, 11:32 AM
Herald added a project: Restricted Project. · View Herald Transcript
This revision is now accepted and ready to land.Jun 8 2020, 1:44 AM
This revision was automatically updated to reflect the committed changes.
mehdi_amini added inline comments.
flang/lib/Lower/CMakeLists.txt
5

You have missing dependencies in CMake here. You're depending on MLIR generated file but haven't added it here.

Try ninja tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/ComplexExpr.cpp.o from a clean build dir, it'll yield:

[1/1] Building CXX object tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/ComplexExpr.cpp.o
FAILED: tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/ComplexExpr.cpp.o 
/usr/local/google/home/aminim/goma/gomacc /usr/local/google/home/aminim/src/chromeclang/third_party/llvm-build/Release+Asserts/bin/clang++  -DBUILD_EXAMPLES -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/flang/lib/Lower -Iflang/lib/Lower -Iflang/include -Itools/flang/include -Iinclude -Illvm/include -isystem llvm/../mlir/include -isystem tools/mlir/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-string-conversion -Wno-unused-command-line-argument -Wstring-conversion           -Wcovered-switch-default -Wno-nested-anon-types -Wno-error -Wno-unused-parameter -O3     -fno-exceptions -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/ComplexExpr.cpp.o -MF tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/ComplexExpr.cpp.o.d -o tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/ComplexExpr.cpp.o -c flang/lib/Lower/ComplexExpr.cpp
In file included from flang/lib/Lower/ComplexExpr.cpp:9:
In file included from flang/include/flang/Lower/ComplexExpr.h:12:
In file included from flang/include/flang/Lower/FIRBuilder.h:20:
In file included from flang/include/flang/Optimizer/Dialect/FIROps.h:12:
In file included from llvm/../mlir/include/mlir/Dialect/StandardOps/IR/Ops.h:19:
llvm/../mlir/include/mlir/IR/OpImplementation.h:773:10: fatal error: 'mlir/IR/OpAsmInterface.h.inc' file not found
#include "mlir/IR/OpAsmInterface.h.inc"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

The dependences should be in now as part of https://reviews.llvm.org/D81692