llvm-parser: init

This commit is contained in:
2024-06-20 16:40:02 +08:00
parent 1d03cda8b7
commit 451deb78a7

15
src/llvm-parser.ts Normal file
View 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;
}