1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[clang] Include missing LangOpts in getModuleHash.

`ObjCRuntime` and `CommentOpts.BlockCommandNames` are checked by
`ASTReader::checkLanguageOptions`, but are not part of the module
context hash. This can lead to errors when using implicit modules if
different TUs have different values for these options when using the
same module cache.

This was not hit very often due to the rare usage of
`-fblock-command-names=` and that `ObjCRuntime` is by default set by
the target triple, which is part of the existing context hash.
This commit is contained in:
Michael Spencer 2020-07-07 17:13:02 -06:00
parent befa4bf06a
commit f52442d598

View File

@ -14,6 +14,7 @@
#ifndef LLVM_SUPPORT_VERSIONTUPLE_H
#define LLVM_SUPPORT_VERSIONTUPLE_H
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/Optional.h"
#include <string>
#include <tuple>
@ -144,6 +145,10 @@ public:
return !(X < Y);
}
friend llvm::hash_code hash_value(const VersionTuple &VT) {
return llvm::hash_combine(VT.Major, VT.Minor, VT.Subminor, VT.Build);
}
/// Retrieve a string representation of the version number.
std::string getAsString() const;