tan  0.0.1
clang_frontend.h
1 #ifndef __TAN_INCLUDE_CLANG_FRONTEND_H__
2 #define __TAN_INCLUDE_CLANG_FRONTEND_H__
3 #include "base.h"
4 
5 namespace tanlang {
6 struct TanCompilation;
7 }
8 
9 /**
10  * \brief Call clang with commandline args
11  * \details Requires the system to have `clang` in $PATH.
12  * This function doesn't directly invoke clang,
13  * but it uses the binary path to find paths to standard headers and libraries.
14  * (Try replacing $(which clang) with a blank text file and see if the compiler works :D)
15  * Defined in clang_driver.cpp
16  */
17 extern int clang_main(int argc, char **argv);
18 
19 /**
20  * \brief Compile CXX files to objects using clang::driver::Driver
21  * \details Only the following options in TanCompilation will affect the compilation of the files
22  * - TanCompilation::opt_level
23  * - TanCompilation::import_dirs
24  * \note This function requires the system to have clang executable installed
25  * \return Error code returned by clang::driver::Driver::ExecuteCompilation
26  * */
27 int clang_compile(vector<str> input_files, tanlang::TanCompilation *config);
28 
29 #endif /* __TAN_INCLUDE_CLANG_FRONTEND_H__ */
Compilation configuration.
Definition: tan.h:42