[all-commits] [llvm/llvm-project] 850d42: [flang] Handle "defined" in macro expansions (#114...

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue Nov 5 13:18:50 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 850d42fb145c636a3b56a7616c3e3c5c188c1916
      https://github.com/llvm/llvm-project/commit/850d42fb145c636a3b56a7616c3e3c5c188c1916
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2024-11-05 (Tue, 05 Nov 2024)

  Changed paths:
    M flang/include/flang/Parser/preprocessor.h
    M flang/include/flang/Parser/token-sequence.h
    M flang/lib/Parser/preprocessor.cpp
    M flang/lib/Parser/token-sequence.cpp
    A flang/test/Preprocessing/defined-in-macro.F90

  Log Message:
  -----------
  [flang] Handle "defined" in macro expansions (#114844)

The preprocessor implements "defined(X)" and "defined X" in if/elif
directive expressions in such a way that they only work at the top
level, not when they appear in macro expansions. Fix that, which is a
little tricky due to the need to detect the "defined" keyword before
applying any macro expansion to its argument, and add a bunch of tests.

Fixes https://github.com/llvm/llvm-project/issues/114064.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list