Initial commit of LLVM 3.4

This commit is contained in:
Pascal Junod
2014-01-07 11:45:01 +01:00
parent 569cee53d0
commit 0c32ada97e
10493 changed files with 713743 additions and 208975 deletions
+4 -11
View File
@@ -17,6 +17,7 @@
#define DEBUG_TYPE "Data-stream"
#include "llvm/Support/DataStream.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/system_error.h"
#include <cerrno>
@@ -27,7 +28,6 @@
#else
#include <io.h>
#endif
#include <fcntl.h>
using namespace llvm;
// Interface goals:
@@ -66,18 +66,11 @@ public:
error_code OpenFile(const std::string &Filename) {
if (Filename == "-") {
Fd = 0;
sys::Program::ChangeStdinToBinary();
sys::ChangeStdinToBinary();
return error_code::success();
}
int OpenFlags = O_RDONLY;
#ifdef O_BINARY
OpenFlags |= O_BINARY; // Open input file in binary mode on win32.
#endif
Fd = ::open(Filename.c_str(), OpenFlags);
if (Fd == -1)
return error_code(errno, posix_category());
return error_code::success();
return sys::fs::openFileForRead(Filename, Fd);
}
};