mirror of
https://github.com/obfuscator-llvm/obfuscator
synced 2026-06-08 16:28:34 +00:00
Initial import of LLVM 3.3
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "llvm-c/BitWriter.h"
|
||||
#include "llvm/Bitcode/ReaderWriter.h"
|
||||
#include "llvm/IR/Module.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
using namespace llvm;
|
||||
|
||||
@@ -17,12 +18,11 @@ using namespace llvm;
|
||||
|
||||
int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path) {
|
||||
std::string ErrorInfo;
|
||||
raw_fd_ostream OS(Path, ErrorInfo,
|
||||
raw_fd_ostream::F_Binary);
|
||||
|
||||
raw_fd_ostream OS(Path, ErrorInfo, raw_fd_ostream::F_Binary);
|
||||
|
||||
if (!ErrorInfo.empty())
|
||||
return -1;
|
||||
|
||||
|
||||
WriteBitcodeToFile(unwrap(M), OS);
|
||||
return 0;
|
||||
}
|
||||
@@ -30,7 +30,7 @@ int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path) {
|
||||
int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose,
|
||||
int Unbuffered) {
|
||||
raw_fd_ostream OS(FD, ShouldClose, Unbuffered);
|
||||
|
||||
|
||||
WriteBitcodeToFile(unwrap(M), OS);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user