llvm-project/clang/lib/Frontend
Chandler Carruth 0d745bcf66 [modules] Teach the AST reader to handle the case of importing a module
with a subset of the existing target CPU features or mismatched CPU
names.

While we can't check that the CPU name used to build the module will end
up being able to codegen correctly for the translation unit, we actually
check that the imported features are a subset of the existing features.

While here, rewrite the code to use std::set_difference and have it
diagnose all of the differences found.

Test case added which walks the set relationships and ensures we
diagnose all the right cases and accept the others.

No functional change for implicit modules here, just better diagnostics.

llvm-svn: 232248
2015-03-14 04:47:43 +00:00
..
Rewrite Fix a [-Werror,-Wreorder] initialization ordering error. 2015-02-26 00:29:54 +00:00
ASTConsumers.cpp Remove some unused includes of llvm/IR headers from parts of Clang that really 2015-02-26 00:01:03 +00:00
ASTMerge.cpp Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325) 2014-08-10 19:56:51 +00:00
ASTUnit.cpp [modules] Teach the AST reader to handle the case of importing a module 2015-03-14 04:47:43 +00:00
CMakeLists.txt Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
CacheTokens.cpp Standardize on StringMap::insert, removing uses of StringMap::GetOrCreateValue. 2014-11-19 03:06:06 +00:00
ChainedDiagnosticConsumer.cpp Remove spurious mode marker from .cpp file. 2012-10-29 06:05:01 +00:00
ChainedIncludesSource.cpp Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
CodeGenOptions.cpp [cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.py 2015-01-14 11:29:14 +00:00
CompilerInstance.cpp Give better diagnostics when -fmodule-file= finds a bad file: if the file is 2015-02-28 03:09:52 +00:00
CompilerInvocation.cpp Add clang support for Objective-C application extensions. 2015-03-02 19:01:14 +00:00
CreateInvocationFromCommandLine.cpp Driver: Use pointee_iterator rather than iterating over unique_ptrs 2014-10-03 01:04:53 +00:00
DependencyFile.cpp Update for LLVM API change 2014-11-19 02:56:13 +00:00
DependencyGraph.cpp Unique_ptrify PPCallbacks ownership. 2014-09-10 04:53:53 +00:00
DiagnosticRenderer.cpp Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created. 2014-08-27 06:28:36 +00:00
FrontendAction.cpp [PCH/Modules] Check that the specific module cache path the PCH was built with, is the same as 2015-02-19 20:12:20 +00:00
FrontendActions.cpp [modules] Teach the AST reader to handle the case of importing a module 2015-03-14 04:47:43 +00:00
FrontendOptions.cpp Remove duplicated case. 2013-06-22 16:44:45 +00:00
HeaderIncludeGen.cpp Unique_ptrify PPCallbacks ownership. 2014-09-10 04:53:53 +00:00
InitHeaderSearch.cpp Fix up default header paths for CloudABI. 2015-03-11 08:46:01 +00:00
InitPreprocessor.cpp Add C11 *_DECIMAL_DIG. 2015-02-23 09:12:31 +00:00
LangStandards.cpp [C++11] Use 'nullptr'. Frontend edition. 2014-05-22 04:46:25 +00:00
LayoutOverrideSource.cpp Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h. 2013-02-08 22:30:41 +00:00
LogDiagnosticPrinter.cpp Add DiagID and Warning Flag to DiagnosticsLog 2014-11-14 21:23:56 +00:00
Makefile Make clang's rewrite engine a core feature 2014-07-16 16:48:33 +00:00
ModuleDependencyCollector.cpp [cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.py 2015-01-14 11:29:14 +00:00
MultiplexConsumer.cpp [modules] Don't clobber a destructor's operator delete when adding another one; 2015-03-10 01:41:22 +00:00
PrintPreprocessedOutput.cpp Add -fuse-line-directive flag to control usage of #line with -E 2015-02-26 00:17:25 +00:00
SerializedDiagnosticPrinter.cpp Add missing include. 2015-03-01 21:36:40 +00:00
SerializedDiagnosticReader.cpp [cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.py 2015-01-14 11:29:14 +00:00
TextDiagnostic.cpp The prefix 'Ms-' should be 'MS-' 2015-02-02 19:30:52 +00:00
TextDiagnosticBuffer.cpp Support 'remark' in VerifyDiagnosticConsumer 2014-05-01 14:06:01 +00:00
TextDiagnosticPrinter.cpp Remove uses of the redundant ".reset(nullptr)" of unique_ptr, in favor of ".reset()" 2014-07-19 01:06:45 +00:00
VerifyDiagnosticConsumer.cpp Make DiagnosticsEngine::takeClient return std::unique_ptr<> 2014-11-17 23:46:02 +00:00