[all-commits] [llvm/llvm-project] 1cfae7: [Flang] Adjust preprocessing to build modules corr...

Pete Steinfeld via All-commits all-commits at lists.llvm.org
Fri Oct 14 12:28:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1cfae76ed91a91aac9444e5a07d31965aae9a628
      https://github.com/llvm/llvm-project/commit/1cfae76ed91a91aac9444e5a07d31965aae9a628
  Author: Peter Steinfeld <psteinfeld at nvidia.com>
  Date:   2022-10-14 (Fri, 14 Oct 2022)

  Changed paths:
    M flang/lib/Frontend/CompilerInvocation.cpp
    A flang/test/Driver/predefined-macros-x86.f90
    M flang/tools/f18/CMakeLists.txt

  Log Message:
  -----------
  [Flang] Adjust preprocessing to build modules correctly

Several module files in .../llvm-project/flang/module check for the
existence of the macro "__x86_64__" to conditionally compile Fortran
code.  Unfortunately, this macro was not being defined anywhere.  This
patch fixes that for compilations targeting 64 bit x86 machines.

I made the following changes --
  -- Removed the test for 32 bit X86 targets.  The rest of the compiler and
  runtime do not support X86 32 bits.
  -- Added predefined macros to define "__x86_64__"  and "__x86__64" to
  be 1 when the target architecture is 64 bit x86 and the "-cpp" option
  is on the command line.
  -- Changed the cmake file for creating the Fortran module files to use the
  "-cpp" option so that the macro "__x86_64__" will be defined when building
  the module files.
  -- Added a test.

Differential Revision: https://reviews.llvm.org/D135810




More information about the All-commits mailing list