diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-04-26 18:57:40 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-04-26 18:57:40 +0000 |
commit | 40c0efa5152b2dfd80d0a9e106a89c6231cbe2da (patch) | |
tree | 04a018ce3ef250cbc9f179be60652ee5175eff0f /clang/lib/Frontend/FrontendActions.cpp | |
parent | 088d001f05e62a393fd0ae2fa064db547e28664e (diff) | |
download | llvm-40c0efa5152b2dfd80d0a9e106a89c6231cbe2da.zip llvm-40c0efa5152b2dfd80d0a9e106a89c6231cbe2da.tar.gz llvm-40c0efa5152b2dfd80d0a9e106a89c6231cbe2da.tar.bz2 |
Refactor frontend InputKind to prepare for treating module maps as a distinct kind of input.
No functionality change intended.
llvm-svn: 301442
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendActions.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp index e818038..1fce1e5 100644 --- a/clang/lib/Frontend/FrontendActions.cpp +++ b/clang/lib/Frontend/FrontendActions.cpp @@ -777,29 +777,27 @@ void PrintPreprocessedAction::ExecuteAction() { } void PrintPreambleAction::ExecuteAction() { - switch (getCurrentFileKind()) { - case IK_C: - case IK_CXX: - case IK_ObjC: - case IK_ObjCXX: - case IK_OpenCL: - case IK_CUDA: + switch (getCurrentFileKind().getLanguage()) { + case InputKind::C: + case InputKind::CXX: + case InputKind::ObjC: + case InputKind::ObjCXX: + case InputKind::OpenCL: + case InputKind::CUDA: break; - case IK_None: - case IK_Asm: - case IK_PreprocessedC: - case IK_PreprocessedCuda: - case IK_PreprocessedCXX: - case IK_PreprocessedObjC: - case IK_PreprocessedObjCXX: - case IK_AST: - case IK_LLVM_IR: - case IK_RenderScript: + case InputKind::Unknown: + case InputKind::Asm: + case InputKind::LLVM_IR: + case InputKind::RenderScript: // We can't do anything with these. return; } + // We don't expect to find any #include directives in a preprocessed input. + if (getCurrentFileKind().isPreprocessed()) + return; + CompilerInstance &CI = getCompilerInstance(); auto Buffer = CI.getFileManager().getBufferForFile(getCurrentFile()); if (Buffer) { |