blob: f559aed2eb02599cef4944eb478c3e51dceda1b3 [file] [log] [blame]
alan-bakerfec0a472018-11-08 18:09:40 -05001// Copyright 2018 The Clspv Authors. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#include "clang/CodeGen/CodeGenAction.h"
16#include "clang/Frontend/CompilerInstance.h"
17
18namespace clspv {
19struct ExtraValidationASTAction final : public clang::PluginASTAction {
20 virtual std::unique_ptr<clang::ASTConsumer>
21 CreateASTConsumer(clang::CompilerInstance &CI,
22 llvm::StringRef InFile) override;
23
24 virtual bool ParseArgs(const clang::CompilerInstance &CI,
25 const std::vector<std::string> &arg) override {
26 // Parsing succeeded.
27 return true;
28 }
29
30 virtual clang::PluginASTAction::ActionType getActionType() override {
31 return clang::PluginASTAction::AddBeforeMainAction;
32 }
33};
34} // namespace clspv