Drop -Xcpp, adopt DMD's -P instead

This commit is contained in:
Martin Kinkelin 2023-06-07 20:31:32 +02:00
parent da225c51bc
commit da050e5d9e
3 changed files with 4 additions and 7 deletions

View file

@ -3,7 +3,7 @@
#### Big news #### Big news
- Frontend, druntime and Phobos are at version [2.103.1](https://dlang.org/changelog/2.103.0.html), incl. new command-line option `-verror-supplements`. (#4345) - Frontend, druntime and Phobos are at version [2.103.1](https://dlang.org/changelog/2.103.0.html), incl. new command-line option `-verror-supplements`. (#4345)
- New commandline option `-femit-local-var-lifetime` that enables variable lifetime (scope) annotation to LLVM IR codegen. Lifetime annotation enables stack memory reuse for local variables with non-overlapping scope. (#4395) - New commandline option `-femit-local-var-lifetime` that enables variable lifetime (scope) annotation to LLVM IR codegen. Lifetime annotation enables stack memory reuse for local variables with non-overlapping scope. (#4395)
- C files are now automatically preprocessed using the external C compiler (configurable via `-gcc` or the `CC` environment variable, and `-Xcc` for extra flags). Extra preprocessor flags (e.g., include dirs and manual defines) can be added via new command-line option `-Xcpp`. (#4417) - C files are now automatically preprocessed using the external C compiler (configurable via `-gcc` or the `CC` environment variable, and `-Xcc` for extra flags). Extra preprocessor flags (e.g., include dirs and manual defines) can be added via new command-line option `-P`. (#4417)
- Windows: Requires an MSVC environment set up for the target (`cl.exe` on `PATH`, `INCLUDE` environment variable). If `clang-cl.exe` is on `PATH`, it is preferred over Microsoft's `cl.exe` by default (e.g., to avoid printing the C source file path to stderr during preprocessing). - Windows: Requires an MSVC environment set up for the target (`cl.exe` on `PATH`, `INCLUDE` environment variable). If `clang-cl.exe` is on `PATH`, it is preferred over Microsoft's `cl.exe` by default (e.g., to avoid printing the C source file path to stderr during preprocessing).
#### Platform support #### Platform support

View file

@ -404,7 +404,7 @@ cl::list<std::string> ccSwitches(
"Xcc", cl::value_desc("ccflag"), cl::cat(linkingCategory), "Xcc", cl::value_desc("ccflag"), cl::cat(linkingCategory),
cl::desc("Pass <ccflag> to GCC/Clang for linking/preprocessing")); cl::desc("Pass <ccflag> to GCC/Clang for linking/preprocessing"));
cl::list<std::string> cppSwitches("Xcpp", cl::value_desc("cppflag"), cl::list<std::string> cppSwitches("P", cl::value_desc("cppflag"), cl::Prefix,
cl::desc("Pass <cppflag> to C preprocessor")); cl::desc("Pass <cppflag> to C preprocessor"));
cl::opt<std::string> moduleDeps( cl::opt<std::string> moduleDeps(

View file

@ -709,11 +709,8 @@ void translateArgs(const llvm::SmallVectorImpl<const char *> &ldmdArgs,
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
/* -L /* -L
*/ * -P
else if (p[1] == 'P') { * -defaultlib
ldcArgs.push_back(concat("-Xcpp=", p + 2 + (p[2] == '=' ? 1 : 0)));
}
/* -defaultlib
* -debuglib * -debuglib
* -deps * -deps
* -main * -main