[HIPIFY][#207][fix] Translate all preprocessor's conditional blocks

+ Start to translate preprocessor's false conditional blocks too:
  based on clang's https://reviews.llvm.org/D66597;
  available only starting from LLVM 10.0 or trunk.
+ Option -skip-excluded-preprocessor-conditional-blocks for skipping excluded conditional blocks:
  the default behavior for hipify-clang built with LLVM < 10.0;
  false by default for hipify-clang built with LLVM 10 or trunk.
+ Add 4 preprocessor unit tests, 2 of which are LLVM 10.0 only
+ Update couple of existing tests by setting -skip-excluded-preprocessor-conditional-blocks option:
  update lit testing accordingly


[ROCm/hip commit: 24be21495d]
This commit is contained in:
Evgeny Mankov
2019-08-28 21:17:35 +03:00
parent d81b612791
commit e78eb9bb47
15 changed files with 223 additions and 12 deletions
@@ -484,6 +484,11 @@ public:
}
bool HipifyAction::BeginInvocation(clang::CompilerInstance &CI) {
llcompat::RetainExcludedConditionalBlocks(CI);
return true;
}
void HipifyAction::ExecuteAction() {
clang::Preprocessor& PP = getCompilerInstance().getPreprocessor();
clang::SourceManager& SM = getCompilerInstance().getSourceManager();