Hi everyone,
I have implemented llvm-strings tool, it's similar to GNU strings tool. Input is LLVM IR file (.bc) it dumps on stdout strings from IR file, there is also option for printing input file name (-f).
Example:
$cat test.c
#include <stdio.h>
int main() {
printf("\n\n\n\nHello world\n\n");
printf("123456789");
return 0;
}
$clang -emit-llvm -c -o test.bc test.c
$llvm-strings -f test.bc
test.bc: .str
test.bc: Hello world
test.bc: .str.1
test.bc: 123456789
test.bc: main
test.bc: printf
If someone is interested I can post patch on phabricator.
Regards,
Strahinja