llvm-parser: init
This commit is contained in:
15
src/llvm-parser.ts
Normal file
15
src/llvm-parser.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export function functionList(module: string) {
|
||||
let result: string[] = [];
|
||||
|
||||
// Split the LLVM module string by lines
|
||||
const lines = module.split('\n');
|
||||
|
||||
lines.forEach(line => {
|
||||
if (line.startsWith('define')) {
|
||||
let begin = line.indexOf('@');
|
||||
let end = line.indexOf('(');
|
||||
result.push(line.substring(begin + 1, end).trim());
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user