Commit Graph

20 Commits

Author SHA1 Message Date
Chris Lattner
39253260b9 Fix a bug where the bcreader could crash on .bc files that were an exact
multiple of the page size, due to a bug in MappedFile


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36980 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-11 00:00:27 +00:00
Reid Spencer
1ea733db9d Use the stat information in the Path object, if it is already obtained. This
avoids a call to ::fstat by MappedFile when the file size information was
already obtained by the Path object.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35477 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 19:11:22 +00:00
Reid Spencer
0554575567 For PR797:
Make the Win32 code exception free (untested/uncompiled) which forced some
interface changes which had ripple effect. This should be the last of 797.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29884 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 21:37:17 +00:00
Reid Spencer
6d045fcdcd For PR797:
Make MappedFile not throw any exceptions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29816 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-22 16:04:22 +00:00
Chris Lattner
ff3d80ff7e simple optimization: don't bother calling "exists" (which calls the syscall
"access").  Instead, just let the open call fail if the file doesn't exist.
This reduces the # syscalls executed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29173 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 07:07:51 +00:00
Chris Lattner
84bad2f96c Remove a dead conditional: info_ can only be allocated if FD is good. Improve
spacing


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29172 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 07:03:14 +00:00
Chris Lattner
0af7093532 The only entry in the stat buf this code cares about is the size. Keep just
the size, not the whole stat buffer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29171 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 07:01:08 +00:00
Chris Lattner
cca68faac2 Reduce code in the error path by only allocating info_ if everything looks
good.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29170 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 06:57:51 +00:00
Chris Lattner
c22c7d3cdf Unindent some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29169 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 06:52:52 +00:00
Misha Brukman
6b8a63ae58 Remove vim settings from source code; people should use llvm/utils/vim/vimrc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21704 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-05 22:33:09 +00:00
Chris Lattner
946af52687 If errno is zero strerror_r does not modify the buffer, leaving it unterminated.
This causes garbage to be printed out after error messages.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20165 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 22:46:37 +00:00
Reid Spencer
cdf54d04c7 For PR351:
* Ensure #includes are wrapped with appropriate HAVE_ guards


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19156 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-27 06:16:52 +00:00
Reid Spencer
56c3ed854f Make the size() method const
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18852 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 02:58:51 +00:00
Reid Spencer
1fce09125c Path::get -> Path::toString
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18785 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-11 00:14:15 +00:00
Reid Spencer
083507cd3f Fix bugs in class invariant
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17779 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 22:07:50 +00:00
Reid Spencer
6cb21d443e Change Library Names Not To Conflict With Others When Installed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17286 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-27 23:18:45 +00:00
Brian Gaeke
e789a6bfff Must include sys/stat.h before declaring a 'struct stat'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16728 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-05 18:46:59 +00:00
Tanya Lattner
c5a0bbfbeb Added a couple of includes to get this to compile on Sparc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16685 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-05 00:51:26 +00:00
Chris Lattner
341e1dad1b Solaris doesn't have MAP_FILE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16682 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-05 00:46:21 +00:00
Reid Spencer
9737492204 First version of the MappedFile abstraction for operating system idependent
mapping of files. This first version uses mmap where its available. The
class needs to implement an alternate mechanism based on malloc'd memory
and file reading/writing for platforms without virtual memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16649 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-04 11:08:32 +00:00