HomePhabricator

enable -save-temps with -finclude-defult-header

Description

enable -save-temps with -finclude-defult-header

Currently the two flags can not work together.

To illustrate the issue, we can have an one line file a.cl contains only an empty function

cat a.cl

void test(){}

Then use

clang -v -save-temps -x cl -Xclang -cl-std=CL2.0 -Xclang -finclude-default-header -target amdgcn -S -c a.cl

we will get redefinition errors for various things.

The reason is that the -finclude-default-header flag is not meant to be on cc1 command other than the preprocessor.

The fix is modeled after the code just below the change to filter the -finclude-default-header flag out when we are not in the preprocess phase.

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

Details

Committed
guansongMar 15 2017, 1:57 PM
Differential Revision
D30743: enable -save-temps with -finclude-defult-header
Parents
rL297889: Add GDB pretty-printer for llvm::Twine type
Branches
Unknown
Tags
Unknown