HomePhabricator

[clang-cl] Treat inputs as C++ with /E, like MSVC

Authored by rnk on Dec 26 2018, 1:04 PM.

Description

[clang-cl] Treat inputs as C++ with /E, like MSVC

midl invokes the compiler on .idl files with /E. Before this change, we
would treat unrecognized inputs as object files. Now we pre-process to
stdout as expected. I checked that MSVC defines __cplusplus when invoked
this way, so treating the input as C++ seems like the right thing to do.

After this change, I was able to run midl like this with clang-cl:
$ midl -cpp_cmd clang-cl.exe foo.idl

Things worked for the example IDL file in the Microsoft documentation,
but beyond that, I don't know if this will work well.

Fixes PR40140

llvm-svn: 350072

Details

Committed
rnkDec 26 2018, 1:04 PM
Parents
rG3ab5a9cd1c82: [MS] Mangle return adjusting thunks with the public access specifier
Branches
Unknown
Tags
Unknown