356a4b433b
Differential Revision: https://reviews.llvm.org/D70268
This is a recommit of f978ea4983
with a fix for the PowerPC failure.
The issue was that:
* `CompilerInstance::ExecuteAction` calls
`getTarget().adjust(getLangOpts());`.
* `PPCTargetInfo::adjust` changes `LangOptions::HasAltivec`.
* This happens after the first few calls to `getModuleHash`.
There’s even a FIXME saying:
```
// FIXME: We shouldn't need to do this, the target should be immutable once
// created. This complexity should be lifted elsewhere.
```
This only showed up on PowerPC because it's one of the few targets that
almost always changes a hashed langopt.
I looked into addressing the fixme, but that would be a much larger
change, and it's not the only thing that happens in `ExecuteAction` that
can change the module context hash. Instead I changed the code to not
call `getModuleHash` until after it has been modified in `ExecuteAction`.
23 lines
981 B
JSON
23 lines
981 B
JSON
[
|
|
{
|
|
"directory": "DIR",
|
|
"command": "clang -E DIR/modules_cdb_input2.cpp -IInputs -D INCLUDE_HEADER2 -MD -MF DIR/modules_cdb2.d -fmodules -fcxx-modules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -fimplicit-module-maps",
|
|
"file": "DIR/modules_cdb_input2.cpp"
|
|
},
|
|
{
|
|
"directory": "DIR",
|
|
"command": "clang -E DIR/modules_cdb_input.cpp -IInputs -fmodules -fcxx-modules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -fimplicit-module-maps",
|
|
"file": "DIR/modules_cdb_input.cpp"
|
|
},
|
|
{
|
|
"directory": "DIR",
|
|
"command": "clang -E DIR/modules_cdb_input.cpp -IInputs -fmodules -fcxx-modules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -fimplicit-module-maps -o a.o",
|
|
"file": "DIR/modules_cdb_input.cpp"
|
|
},
|
|
{
|
|
"directory": "DIR",
|
|
"command": "clang -E DIR/modules_cdb_input.cpp -IInputs -fmodules -fcxx-modules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -fimplicit-module-maps -o b.o",
|
|
"file": "DIR/modules_cdb_input.cpp"
|
|
}
|
|
]
|