aboutsummaryrefslogtreecommitdiff
path: root/lib/Wrap/file_wrapper_input.cpp
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2013-10-23 08:35:49 -0700
committerDerek Schuff <dschuff@chromium.org>2013-10-23 08:35:49 -0700
commit99a581677ff9a785f77e9d9d171b87d61f2da25e (patch)
tree68028c90a26c775aee1bd2834a4d3ec2953f140e /lib/Wrap/file_wrapper_input.cpp
parent7287c45c13dc887cebe3db6abfa2f1080186bb97 (diff)
Remove obsolete bitcode wrapper code
We are using our own bitcode reader now, and no longer need this. R=jvoung@chromium.org, kschimpf@google.com BUG=cleanup Review URL: https://codereview.chromium.org/32943005
Diffstat (limited to 'lib/Wrap/file_wrapper_input.cpp')
-rw-r--r--lib/Wrap/file_wrapper_input.cpp53
1 files changed, 0 insertions, 53 deletions
diff --git a/lib/Wrap/file_wrapper_input.cpp b/lib/Wrap/file_wrapper_input.cpp
deleted file mode 100644
index fc592e0246..0000000000
--- a/lib/Wrap/file_wrapper_input.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Copyright 2012 The Native Client Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can
- * be found in the LICENSE file.
- */
-
-#include <sys/stat.h>
-#include <stdlib.h>
-
-#include "llvm/Wrap/file_wrapper_input.h"
-
-FileWrapperInput::FileWrapperInput(const std::string& name) :
- _name(name), _at_eof(false), _size_found(false), _size(0) {
- _file = fopen(name.c_str(), "rb");
- if (NULL == _file) {
- fprintf(stderr, "Unable to open: %s\n", name.c_str());
- exit(1);
- }
-}
-
-FileWrapperInput::~FileWrapperInput() {
- fclose(_file);
-}
-
-size_t FileWrapperInput::Read(uint8_t* buffer, size_t wanted) {
- size_t found = fread((char*) buffer, 1, wanted, _file);
- if (feof(_file) || ferror(_file)) {
- _at_eof = true;
- }
- return found;
-}
-
-bool FileWrapperInput::AtEof() {
- return _at_eof;
-}
-
-off_t FileWrapperInput::Size() {
- if (_size_found) return _size;
- struct stat st;
- if (0 == stat(_name.c_str(), &st)) {
- _size_found = true;
- _size = st.st_size;
- return _size;
- } else {
- fprintf(stderr, "Unable to compute file size: %s\n", _name.c_str());
- exit(1);
- }
- // NOT REACHABLE.
- return 0;
-}
-
-bool FileWrapperInput::Seek(uint32_t pos) {
- return 0 == fseek(_file, (long) pos, SEEK_SET);
-}