summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2015-06-23 18:20:18 +0000
committerBen Langmuir <blangmuir@apple.com>2015-06-23 18:20:18 +0000
commitcd98cb731288722bf44204feb2f570caaec6617c (patch)
treeb479486484ae89a997628da14f56b261d048be68 /clang/lib/Frontend/CompilerInvocation.cpp
parentc78c2bcb2a005266d7c6982ed57accd394028153 (diff)
downloadbcm5719-llvm-cd98cb731288722bf44204feb2f570caaec6617c.tar.gz
bcm5719-llvm-cd98cb731288722bf44204feb2f570caaec6617c.zip
[Modules] Consider -fmodule-feature in module hash and when loading
Any extra features from -fmodule-feature are part of the module hash and need to get validated on load. Also print them with -module-file-info. llvm-svn: 240433
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 250c992cbde..dd664ca652f 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1588,6 +1588,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
Opts.ImplementationOfModule =
Args.getLastArgValue(OPT_fmodule_implementation_of);
Opts.ModuleFeatures = Args.getAllArgValues(OPT_fmodule_feature);
+ std::sort(Opts.ModuleFeatures.begin(), Opts.ModuleFeatures.end());
Opts.NativeHalfType |= Args.hasArg(OPT_fnative_half_type);
Opts.HalfArgsAndReturns = Args.hasArg(OPT_fallow_half_arguments_and_returns);
Opts.GNUAsm = !Args.hasArg(OPT_fno_gnu_inline_asm);
@@ -1967,6 +1968,9 @@ std::string CompilerInvocation::getModuleHash() const {
#define BENIGN_LANGOPT(Name, Bits, Default, Description)
#define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description)
#include "clang/Basic/LangOptions.def"
+
+ for (StringRef Feature : LangOpts->ModuleFeatures)
+ code = hash_combine(code, Feature);
// Extend the signature with the target options.
code = hash_combine(code, TargetOpts->Triple, TargetOpts->CPU,
OpenPOWER on IntegriCloud