llvm-project/flang/lib
Faris Rehman 7809fa2040 [flang][driver] Add support for `-D`, `-U`
Add support for options -D and -U in the new Flang driver.

Summary of changes:
  - Create PreprocessorOptions, to be used by the driver then translated
    into Fortran::parser::Options
  - Create CompilerInvocation::setFortranOpts to pass preprocessor
    options into the parser options
  - Add a dedicated method, Flang::AddPreprocessingOptions, to extract
    preprocessing options from the driver arguments into the preprocessor
    command arguments

Macros specified like -DName will default to definition 1.

When defining macros, the new driver will drop anything after an
end-of-line character. This is consistent with gfortran and clang, but
different to what currently f18 does. However, flang (which is a bash
wrapper for f18), also drops everything after an end-of-line character.
So gfortran-like behaviour felt like the natural choice. Test is added
to demonstrate this behaviour.

Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D93401
2021-01-06 16:17:13 +00:00
..
Common [flang] Use the Flang cmake-functions to add targets. 2020-04-16 15:51:30 +01:00
Decimal [flang] Readability improvement in binary->decimal conversion 2020-10-01 15:49:27 -07:00
Evaluate [flang] Fix crash in folding (#48437) 2020-12-16 07:55:44 -08:00
Frontend [flang][driver] Add support for `-D`, `-U` 2021-01-06 16:17:13 +00:00
FrontendTool [flang][driver] Add support for `-fsyntax-only` 2020-12-18 09:35:02 +00:00
Lower [Flang][openmp][3/5] Make ProcBind clause part of OmpClause 2020-12-22 13:40:38 +05:30
Optimizer [mlir] Remove the MutableDictionaryAttr class 2020-12-17 17:18:42 -08:00
Parser [flang][openmp] Make Reduction clause part of OmpClause 2021-01-04 15:19:00 -05:00
Semantics [flang][openmp] Make Reduction clause part of OmpClause 2021-01-04 15:19:00 -05:00
CMakeLists.txt [flang][driver] Add the new flang compiler and frontend drivers 2020-09-11 10:55:54 +01:00