This is an archive of the discontinued LLVM Phabricator instance.

[frontend] Don't include the C++ stdlib for -x assembler-with-cpp
ClosedPublic

Authored by arphaman on Jun 28 2018, 12:33 PM.

Details

Summary

The new C++ stdlib warning added in https://reviews.llvm.org/D48297 gets triggered when compiling an assembly file with -x assembler-with-cpp.
This commit ensures that the C++ stdlib is not included when compiling assembly. In general, it's not really useful to include the C++ stdlib search path when compiling assembly source.

Diff Detail

Repository
rC Clang

Event Timeline

arphaman created this revision.Jun 28 2018, 12:33 PM
bruno added inline comments.Jun 28 2018, 2:58 PM
lib/Frontend/InitHeaderSearch.cpp
474

Since you added HSOpts.UseStandardCXXIncludes to the condition, would it be worth adding a test case for triggering this option when !Lang.AsmPreprocessor evals to true?

arphaman added inline comments.Jun 28 2018, 3:55 PM
lib/Frontend/InitHeaderSearch.cpp
474

This option was already there. I only added '&& !Lang.AsmPreprocessor'. Or do you mean something else?

bruno accepted this revision.Jun 28 2018, 3:57 PM

LGTM

lib/Frontend/InitHeaderSearch.cpp
474

Oh, right!

This revision is now accepted and ready to land.Jun 28 2018, 3:57 PM
This revision was automatically updated to reflect the committed changes.