Created
March 16, 2012 21:51
-
-
Save jgouly/2052963 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <llvm/Support/IRReader.h> | |
#include <llvm/LLVMContext.h> | |
#include <llvm/Module.h> | |
#include <llvm/Support/raw_ostream.h> | |
using namespace llvm; | |
int main() | |
{ | |
std::string error; | |
Module *stdlib; | |
SMDiagnostic Err; | |
stdlib = ParseIRFile("bonestd.ll", Err, getGlobalContext()); | |
for(Module::iterator i = stdlib->begin(), e = stdlib->end(); | |
i != e; ++i) | |
{ | |
// delete the functions here | |
} | |
std::string err; | |
raw_fd_ostream fs("bonestd.ll", err); | |
stdlib->print(fs, 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment