github.com/alexanius/gollvm12@v0.0.0-20230419200121-b152358b84f3/driver/DummyCompileC.h (about) 1 //===-- DummyCompileC.h ----------------------------------------------------===// 2 // 3 // Copyright 2022 The Go Authors. All rights reserved. 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file. 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // Defines the DummyCompileC class (helper for driver functionality). 10 // 11 //===----------------------------------------------------------------------===// 12 13 #ifndef GOLLVM_DRIVER_DUMMYCOMPILEC_H 14 #define GOLLVM_DRIVER_DUMMYCOMPILEC_H 15 16 #include "Tool.h" 17 18 namespace gollvm { 19 namespace driver { 20 21 class ToolChain; 22 class Compilation; 23 class Action; 24 class Artifact; 25 26 // Concrete (dummy) C compiler tool. This tool is used by the driver to carry 27 // out "compile" actions when "-x c" is passed, e.g. "compile this set of C 28 // files into assembly". Since gollvm can't compile C, we require 29 // that the input file be empty, and don't produce any output. 30 31 class DummyCompileC : public InternalTool { 32 public: 33 DummyCompileC(ToolChain &tc, const std::string &executablePath); 34 ~DummyCompileC(); 35 36 // Perform compilation. 37 bool performAction(Compilation &compilation, 38 const Action &jobAction, 39 const ArtifactList &inputArtifacts, 40 const Artifact &output) override; 41 }; 42 43 } // end namespace driver 44 } // end namespace gollvm 45 46 #endif // GOLLVM_DRIVER_DUMMYCOMPILEC_H