Commit Graph

404 Commits

Author SHA1 Message Date
Anton Korobeynikov
93c2b37340 Small fixes for supporting dll* linkage types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30441 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-17 13:06:18 +00:00
Anton Korobeynikov
b74ed07bfd Adding dllimport, dllexport and external weak linkage types.
DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30374 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 18:23:27 +00:00
Anton Korobeynikov
7d51544903 - Fixed broken Win32 build
- Removed warning about clobbered parameter in Bytecode/Reader


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30026 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-01 20:35:17 +00:00
Reid Spencer
99655e16a6 For PR797:
Final commit for this bug. This removes the last EH holdouts in LLVM
and turns off exception support by using the -fno-exceptions option. This
leads to the following reduction in library and executable sizes:
                DEBUG BUILD                RELEASE BUILD
         before     after   delta     before   after    delta
lib    162,328K  157,616K   4,712    17,864K  16,416K  1,448K
bin    571,444K  557,156K  14,288    63,296K   56,996K 6,300K

Debug   Improvement: 19,000K (2.59%)
Release Improvement:  7,748K (9.55%)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29882 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 19:54:53 +00:00
Reid Spencer
0b5a504d10 For PR797:
Remove exception throwing/handling from lib/Bytecode, and adjust its users
to compensate for changes in the interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29875 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 17:43:11 +00:00
Reid Spencer
b152fd247c For PR797:
Adjust the use of MappedFile to its new non-throwing interface. We just
propagate the exceptions if an error occurs. This will get cleaned up
later, incrementally.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29820 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-22 16:10:12 +00:00
Reid Spencer
233fe721c5 For PR797:
Make the Bytecode Reader use setjmp/longjump instead of exceptions to handle
errors. The alternative was even uglier than setjmp/longjump as it would
impact the interface and workings of nearly every function in the reader.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29819 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-22 16:09:19 +00:00
Chris Lattner
7c339b8ca2 These libs use EH info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29043 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-07 16:44:31 +00:00
Chris Lattner
94aa7f3ba8 Fix a bug in my previous patch which broke building llvm/runtime when using llvm-gcc3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29041 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-07 06:06:06 +00:00
Chris Lattner
0300f3e712 Change the ModuleProvider interface to not throw exceptions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29024 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-06 21:35:01 +00:00
Chris Lattner
05ac92ca7d Change the verifier to never throw an exception. Instead verifyModule canoptionally return the string error, which is an easier api for clients touse anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29017 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-06 18:02:27 +00:00
Reid Spencer
32f5553c03 For PR787:
Provide new llvm::sys::Program facilities for converting the stdout and
stdin to binary mode. There is no standard way to do this and the available
mechanisms are platform specific. Adjust the bytecode reader and writer to
use these methods when their input is stdin or output is stdout. THis avoids
the problem with \n writing CRLF to a bytecode file on windows.

Patch Contributed by Michael Smith.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28722 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-07 23:18:34 +00:00
Reid Spencer
18c8b49e7d Use archive libraries instead of object files for VMCore, BCReader,
BCWriter, and bzip2 libraries. Adjust the various makefiles to accommodate
these changes. This was done to speed up link times.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28610 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 01:30:27 +00:00
Chris Lattner
a65371ea25 Fix a bug in the bc reader/writer: we were not correctly encoding varargs
nonccc calls (we were dropping the CC and tail flag).  This broke several
FORTRAN programs.

Testcase here: Regression/Assembler/2006-05-26-VarargsCallEncode.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28501 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:42:34 +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
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
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
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
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
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
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