Merge pull request #340 from emankov/master

[HIPIFY][fix] Fix PragmaDirective
Этот коммит содержится в:
Evgeny Mankov
2018-01-24 18:09:54 +03:00
коммит произвёл GitHub
родитель 591aeccad3 b9fc653b08
Коммит 657be80c29
+6 -1
Просмотреть файл
@@ -213,8 +213,13 @@ void HipifyAction::InclusionDirective(clang::SourceLocation hash_loc,
}
void HipifyAction::PragmaDirective(clang::SourceLocation Loc, clang::PragmaIntroducerKind Introducer) {
if (pragmaOnce) { return; }
if (pragmaOnce) {
return;
}
clang::SourceManager& SM = getCompilerInstance().getSourceManager();
if (!SM.isWrittenInMainFile(Loc)) {
return;
}
clang::Preprocessor& PP = getCompilerInstance().getPreprocessor();
const clang::Token tok = PP.LookAhead(0);
StringRef Text(SM.getCharacterData(tok.getLocation()), tok.getLength());