Beispiel #1
0
 public function gen()
 {
     $ir = "";
     $function = $this->obj->content[0]->string;
     /* convert the C types to LLVM IR */
     $function = preg_replace("/char\\s*\\*\\s*.+?(,|\\))/", "i8*\$1", $function);
     $function = preg_replace("/int([,( ])/", "i32\$1", $function);
     /* add a @-symbol in front of the function name */
     $function = preg_replace("/(.+? )(.+?\\()/", "\$1@\$2", $function);
     \Tables::addDeclaration($function);
     return $ir;
 }