Commit Graph

590 Commits

Author SHA1 Message Date
Reid Spencer
ffb4d62720 When reading the symbol table, make sure to delete the ArchiveMember
created by reading the symbol table.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28251 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 17:56:20 +00:00
Jeff Cohen
943b9b6651 Apply bug fix supplied by Greg Pettyjohn for a bug he found: '<invalid>' is not a legal path on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28153 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-06 23:25:53 +00:00
Chris Lattner
59fecec7d0 use isValidOperands instead of duplicating checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27527 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-08 04:09:19 +00:00
Chris Lattner
30b44b6b03 Add shufflevector reading support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27509 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-08 01:17:59 +00:00
Chris Lattner
d2cfb7a670 We have an assertion that checks that we do not encode null values into the
.bc file if they are supposed to be implicit.  This is cool, except that it
checked *after* constant expr folding: improving constant expr folding could
cause the .bc reader to assert out on old .bc files.  Move the check so that
it checks all simple constants, but no constantexprs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27480 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-07 05:00:02 +00:00
Jim Laskey
f4321a3a43 Handle the removal of the debug chain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26729 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 13:07:37 +00:00
Chris Lattner
bad08000f1 Simplify the autoupgrade interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26475 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-02 23:59:12 +00:00
Reid Spencer
e2a5fb0e08 Fix auto-upgrade of intrinsics to work properly with both assembly and
bytecode reading. This code is crufty, the result of much hacking to get things
working correctly. Cleanup patches will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25682 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-27 11:49:27 +00:00
Chris Lattner
3bc5a60b80 add bc reader/writer support for inline asm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25621 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-25 23:08:15 +00:00
Jeff Cohen
05ebc8d795 Make it even more portable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25605 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-25 17:18:50 +00:00
Jeff Cohen
fb709b6817 Portably cast a pointer to an integer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25594 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-25 02:40:10 +00:00
Chris Lattner
6631601eed Rename method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25571 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-24 04:14:29 +00:00
Chris Lattner
7e6db764b1 Add support for reading/writing inline asm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25564 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-23 23:43:17 +00:00
Reid Spencer
49e732c5f2 Revert last patch because it messes up the JIT, amongst other things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25541 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-23 08:11:03 +00:00
Reid Spencer
9629efde7e For PR411:
Don't try to be smart about fixing intrinsic functions when they're read
in, just fix them after the module is read when all names are resolved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25539 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-23 07:39:03 +00:00
Reid Spencer
e1e96c0820 1. Identify bytecode modules that have upgraded intrinsics by setting a
boolean flag if we read a function prototype that needs upgrading.
2. Don't upgrade the CallInst instruction until after its been inserted
   into the basic block, and only if we know that we have seen an
   upgraded intrinsic function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25448 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 07:02:16 +00:00
Reid Spencer
3e59546352 Add a flag to identify bytecode files that have intrinsic functions that
need to be upgraded.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25445 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 06:57:58 +00:00
Reid Spencer
e812fb230a Make sure intrinsic auto-upgrade is invoked correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25434 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 01:21:04 +00:00
Robert Bocchino
b1f240b8ef Reader support for the insertelement operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25404 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-17 20:06:35 +00:00
Reid Spencer
0b118206bf For PR411:
This patch is an incremental step towards supporting a flat symbol table.
It de-overloads the intrinsic functions by providing type-specific intrinsics
and arranging for automatically upgrading from the old overloaded name to
the new non-overloaded name. Specifically:
  llvm.isunordered -> llvm.isunordered.f32, llvm.isunordered.f64
  llvm.sqrt -> llvm.sqrt.f32, llvm.sqrt.f64
  llvm.ctpop -> llvm.ctpop.i8, llvm.ctpop.i16, llvm.ctpop.i32, llvm.ctpop.i64
  llvm.ctlz -> llvm.ctlz.i8, llvm.ctlz.i16, llvm.ctlz.i32, llvm.ctlz.i64
  llvm.cttz -> llvm.cttz.i8, llvm.cttz.i16, llvm.cttz.i32, llvm.cttz.i64
New code should not use the overloaded intrinsic names. Warnings will be
emitted if they are used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25366 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-16 21:12:35 +00:00
Robert Bocchino
fee31b3610 Added bytecode support for the extractelement operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25178 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-10 19:04:39 +00:00
Duraid Madina
874874657e more C++ daintiness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25023 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-26 14:31:26 +00:00
Duraid Madina
0f7bfbac97 I bet pinski knows why g++ accepts this stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25022 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-26 14:23:22 +00:00
Reid Spencer
6ff7240a5c Fix a problem with llvm-ranlib that (on some platforms) caused the archive
file to become corrupted due to interactions between mmap'd memory segments
and file descriptors closing. The problem is completely avoiding by using
a third temporary file.

Patch provided by Evan Jones


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24527 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-30 05:21:10 +00:00
Chris Lattner
c76ea439b6 trivial cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24330 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 18:34:09 +00:00
Chris Lattner
39979ea43f Fix reading LLVM 1.3 bc files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24329 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 18:31:54 +00:00
Chris Lattner
404cddfcf9 Read and write section info from/to .bc files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24321 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 01:33:40 +00:00
Jeff Cohen
ba0ffcc1bc Wrap long line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24320 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 01:01:50 +00:00
Jeff Cohen
277973bf23 Fix VC++ warning that bools cannot be ORed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24319 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 00:59:39 +00:00
Chris Lattner
ce5e04e710 minor clarity changes, no functionality difference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24223 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-06 08:23:17 +00:00
Chris Lattner
54b369e752 don't misencode CC#'s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24219 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-06 07:46:13 +00:00
Chris Lattner
e73bd45c1d encode/decode function alignment in bc files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24218 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-06 07:43:39 +00:00
Chris Lattner
8eb52dd734 Read/write global variable alignments if present
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24216 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-06 07:11:04 +00:00
Chris Lattner
42ba6b4b88 Write/read allocation instruction alignment info to .bc files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24203 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-05 22:08:14 +00:00
Chris Lattner
f36aeedaa3 DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23940 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 02:26:13 +00:00
Jeff Cohen
66c5fd6c53 When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23888 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-23 04:37:20 +00:00
Chris Lattner
eebac5fee6 Use a map to cache the ModuleType information, so we can do logarithmic
lookups instead of linear time lookups.  This speeds up bc parsing of a
large file from

137.834u 118.256s 4:27.96
to
132.611u 114.436s 4:08.53

with a release build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23611 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 21:26:53 +00:00
Chris Lattner
7c439929bc speed up Archive::isBytecodeArchive in the case when the archive doesn't have
an llvm-ranlib symtab.  This speeds up gccld -native on an almost empty .o file
from 1.63s to 0.18s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23406 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-23 06:22:58 +00:00
Jim Laskey
cb6682fa44 Culling out use of unions for converting FP to bits and vice versa.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22838 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 19:34:49 +00:00
Chris Lattner
fea493030b This is a dummy, it doesn't matter what the ValueType is
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22809 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-16 21:59:52 +00:00
Jeff Cohen
00b16889ab Eliminate all remaining tabs and trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22523 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 06:12:32 +00:00
Reid Spencer
a229c5cce7 Final Changes For PR495:
This chagne just renames some sys::Path methods to ensure they are not
misused. The Path documentation now divides methods into two dimensions:
Path/Disk and accessor/mutator. Path accessors and mutators only operate
on the Path object itself without making any disk accesses. Disk accessors
and mutators will also access or modify the file system. Because of the
potentially destructive nature of disk mutators, it was decided that all
such methods should end in the work "Disk" to ensure the user recognizes
that the change will occur on the file system. This patch makes that
change. The method name changes are:

makeReadable        -> makeReadableOnDisk
makeWriteable       -> makeWriteableOnDisk
makeExecutable      -> makeExecutableOnDisk
setStatusInfo       -> setStatusInfoOnDisk
createDirectory     -> createDirectoryOnDisk
createFile          -> createFileOnDisk
createTemporaryFile -> createTemporaryFileOnDisk
destroy             -> eraseFromDisk
rename              -> renamePathOnDisk

These changes pass the Linux Deja Gnu tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22354 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-08 03:08:58 +00:00
Reid Spencer
dd04df0ec3 For PR495:
Get rid of the difference between file paths and directory paths. The Path
class now simply stores a path that can refer to either a file or a
directory. This required various changes in the implementation and interface
of the class with the corresponding impact to its users. Doxygen comments were
also updated to reflect these changes. Interface changes are:

appendDirectory -> appendComponent
appendFile -> appendComponent
elideDirectory -> eraseComponent
elideFile -> eraseComponent
elideSuffix -> eraseSuffix
renameFile -> rename
setDirectory -> set
setFile -> set

Changes pass Dejagnu and llvm-test/SingleSource tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22349 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-07 23:21:43 +00:00
Andrew Lenharth
213e557cef If we support structs as va_list, we must pass pointers to them to va_copy
See last commit for LangRef, this implements it on all targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22273 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-22 21:04:42 +00:00
Andrew Lenharth
017fba9d0f va_end fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22262 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-19 14:04:55 +00:00
Andrew Lenharth
558bc88a00 core changes for varargs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22254 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-18 18:34:52 +00:00
Andrew Lenharth
141e488a70 Remove code for conversion from old style va_args. Preparing the way for
returning to the old style :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22199 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-08 00:49:08 +00:00
Chris Lattner
bfed9247f1 fix the assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21994 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 23:35:47 +00:00
Jeff Cohen
39cef60259 Silence VC++ warnings about unsafe mixing of ints and bools with the | operator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21758 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-07 02:44:04 +00:00
Chris Lattner
3f6948d686 remove some dead (always dynamically false) flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21752 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-06 22:35:09 +00:00