Function headers for interacting with clang.
More...
Go to the source code of this file.
Function headers for interacting with clang.
- Author
- Charles Averill
- Date
- 13-Sep-2022
◆ GENERATOR_PROGRAM_CONTENTS
#define GENERATOR_PROGRAM_CONTENTS "#include <stdio.h>\nint main(void){printf(\"\");}" |
Program used to determine platform information.
◆ GENERATOR_PROGRAM_CONTENTS_LENGTH
Length of GENERATOR_PROGRAM_CONTENTS.
◆ GENERATOR_PROGRAM_FILENAME
#define GENERATOR_PROGRAM_FILENAME ".prp_platform_information_generator.c" |
Filename of GENERATOR_PROGRAM.
◆ GENERATOR_PROGRAM_FILENAME_LL
#define GENERATOR_PROGRAM_FILENAME_LL ".prp_platform_information_generator.ll" |
Filename of GENERATOR_PROGRAM's LLVM-compiled file.
◆ PURPLE_GLOBALS_PLACEHOLDER
#define PURPLE_GLOBALS_PLACEHOLDER ";<purple_globals_placeholder>" |
Placeholder in main LLVM file used when linking globals.
◆ PURPLE_GLOBALS_PLACEHOLDER_LEN
Length of PURPLE_GLOBALS_PLACEHOLDER.
◆ clang_compile_llvm()
void clang_compile_llvm |
( |
const char * |
fn | ) |
|
Starts up the clang compiler to compile the generated LLVM-IR into a binary.
- Parameters
-
fn | Name of file to compile |
◆ create_tmp_generator_program()
void create_tmp_generator_program |
( |
void |
| ) |
|
Create a temporary file for a generator program used to determine compilation information.
◆ get_postamble()
char * get_postamble |
( |
void |
| ) |
|
◆ get_target_datalayout()
char * get_target_datalayout |
( |
void |
| ) |
|
Search through GENERATOR_PROGRAM for the target datalayout.
- Returns
- char* Pointer to target datalayout string
◆ get_target_triple()
char * get_target_triple |
( |
void |
| ) |
|
Get the target triple for the current target.
- Returns
- char* Pointer to the target triple string
◆ link_globals()
void link_globals |
( |
void |
| ) |
|
Link globals.ll to main LLVM file by copying the contents of each LLVM file into a temporary file, then copying back to the main LLVM file.
◆ regex_match()
char * regex_match |
( |
const char * |
regex, |
|
|
char * |
target_str, |
|
|
int |
len, |
|
|
int |
group_index |
|
) |
| |
Simple regex parser.
- Parameters
-
regex | Regular expression to compile |
target_str | String to search in |
len | Maximum length of the output match, if found |
group_index | Index of group to match (0 for no group) |
- Returns
- char* Pointer to the match text if match found, else NULL
◆ generatorProgramFullPath
char generatorProgramFullPath[512] |
|
static |
Full path to GENERATOR_PROGRAM.
◆ generatorProgramLLFullPath
char generatorProgramLLFullPath[512] |
|
static |
Full path to GENERATOR_PROGRAM's LLVM-compiled file.
◆ generatorProgramWritten
bool generatorProgramWritten = false |
|
static |
True if the generator program has been written and compiled.