Purple  0.1
Standard Language Specification
clang.h
Go to the documentation of this file.
1
8#ifndef CLANG_H
9#define CLANG_H
10
14#define GENERATOR_PROGRAM_CONTENTS "#include <stdio.h>\nint main(void){printf(\"\");}"
18#define GENERATOR_PROGRAM_CONTENTS_LENGTH sizeof(GENERATOR_PROGRAM_CONTENTS)
22#define GENERATOR_PROGRAM_FILENAME ".prp_platform_information_generator.c"
26#define GENERATOR_PROGRAM_FILENAME_LL ".prp_platform_information_generator.ll"
30static char generatorProgramFullPath[512];
38static bool generatorProgramWritten = false;
42#define PURPLE_GLOBALS_PLACEHOLDER ";<purple_globals_placeholder>"
46#define PURPLE_GLOBALS_PLACEHOLDER_LEN sizeof(PURPLE_GLOBALS_PLACEHOLDER) - 1
47
48void clang_compile_llvm(const char* fn);
49void link_globals(void);
51char* get_target_datalayout(void);
52char* get_target_triple(void);
53char* get_postamble(void);
54char* regex_match(const char* regex, char* target_str, int len, int group_index);
55
56#endif /* CLANG_H */
void create_tmp_generator_program(void)
Create a temporary file for a generator program used to determine compilation information.
Definition: clang.c:51
char * get_target_triple(void)
Get the target triple for the current target.
Definition: clang.c:251
void link_globals(void)
Link globals.ll to main LLVM file by copying the contents of each LLVM file into a temporary file,...
Definition: clang.c:113
void clang_compile_llvm(const char *fn)
Starts up the clang compiler to compile the generated LLVM-IR into a binary.
Definition: clang.c:175
char * get_postamble(void)
static char generatorProgramLLFullPath[512]
Full path to GENERATOR_PROGRAM's LLVM-compiled file.
Definition: clang.h:34
static char generatorProgramFullPath[512]
Full path to GENERATOR_PROGRAM.
Definition: clang.h:30
char * get_target_datalayout(void)
Search through GENERATOR_PROGRAM for the target datalayout.
Definition: clang.c:214
char * regex_match(const char *regex, char *target_str, int len, int group_index)
Simple regex parser.
Definition: clang.c:292
static bool generatorProgramWritten
True if the generator program has been written and compiled.
Definition: clang.h:38