Purple
0.1
Standard Language Specification
|
Functions for interacting with clang. More...
#include <regex.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "data.h"
#include "utils/clang.h"
#include "utils/logging.h"
Functions | |
const char * | get_temp_dir (void) |
Get the default temporary directory. More... | |
void | create_tmp_generator_program (void) |
Create a temporary file for a generator program used to determine compilation information. More... | |
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. More... | |
void | clang_compile_llvm (const char *fn) |
Starts up the clang compiler to compile the generated LLVM-IR into a binary. More... | |
char * | get_target_datalayout (void) |
Search through GENERATOR_PROGRAM for the target datalayout. More... | |
char * | get_target_triple (void) |
Get the target triple for the current target. More... | |
char * | regex_match (const char *regex, char *target_str, int len, int group_index) |
Simple regex parser. More... | |
Functions for interacting with clang.
void clang_compile_llvm | ( | const char * | fn | ) |
Starts up the clang compiler to compile the generated LLVM-IR into a binary.
fn | Name of file to compile |
void create_tmp_generator_program | ( | void | ) |
Create a temporary file for a generator program used to determine compilation information.
char * get_target_datalayout | ( | void | ) |
Search through GENERATOR_PROGRAM for the target datalayout.
char * get_target_triple | ( | void | ) |
Get the target triple for the current target.
const char * get_temp_dir | ( | void | ) |
Get the default temporary directory.
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.
char * regex_match | ( | const char * | regex, |
char * | target_str, | ||
int | len, | ||
int | group_index | ||
) |
Simple regex parser.
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) |