This is an archive of the discontinued LLVM Phabricator instance.

[flang] Address more MSVC build issues with reduction & numeric intrinsics
ClosedPublic

Authored by klausler on Apr 2 2021, 11:10 AM.

Details

Summary

Move #include <complex.h> to complex-reduction.h, where
it is needed in MSVC builds.

Exclude code that requires a native 128-bit integer type from
compilation by MSVC.

Diff Detail

Event Timeline

klausler created this revision.Apr 2 2021, 11:10 AM
klausler requested review of this revision.Apr 2 2021, 11:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2021, 11:10 AM

It would be better if you exclude int128 intrinsic functions introduced in D99764

klausler updated this revision to Diff 335004.Apr 2 2021, 12:00 PM
klausler retitled this revision from [flang] Address more MSVC build issues with reductions to [flang] Address more MSVC build issues with reduction & numeric intrinsics.

Exclude more entry points.

I get this error:

D:\dev\llvm-project\flang\runtime\reduction.cpp(95): error C2059: syntax error: 'template'
D:\dev\llvm-project\flang\runtime\reduction.cpp(404): note: see reference to function template instantiation 'signed char Fortran::runtime::GetTotalReduction<Fortran::common::TypeCategory::Integer,1,Fortran::runtime::IntegerSumAccumulator<int>>(const Fortran::runtime::Descriptor &,const char *,int,int,const Fortran::runtime::Descriptor *,ACCUMULATOR &&,const char *)' being compiled
        with
        [
            ACCUMULATOR=Fortran::runtime::IntegerSumAccumulator<int>
        ]

Could you fix it?

klausler updated this revision to Diff 335012.Apr 2 2021, 12:31 PM

Add attempted MSVC work-around to dodge error on "accumulator.template GetResult(...)" in function template.

It works

Remaining (after applying the patch)

D:\dev\llvm-project\flang\runtime\reduction.cpp(161): error C2059: syntax error: 'template'
D:\dev\llvm-project\flang\runtime\reduction.cpp(137): error C2059: syntax error: 'template'
klausler updated this revision to Diff 335022.Apr 2 2021, 1:31 PM

Two more sites for the previous fix for a MSVC spurious error.

Thanks

I don't see any other error for now.

Thanks

I don't see any other error for now.

Thank you for your help. Please approve when convenient.

MehdiChinoune accepted this revision.Apr 2 2021, 2:00 PM
This revision is now accepted and ready to land.Apr 2 2021, 2:00 PM
This revision was automatically updated to reflect the committed changes.