Commit Graph

133 Commits

Author SHA1 Message Date
Reid Spencer
8bef0373f1 Back out last revision which was committed by accident.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33871 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-04 04:29:21 +00:00
Reid Spencer
3dad8dc367 Make sure that section and visibility are properly propagated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33870 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-04 04:28:18 +00:00
Andrew Lenharth
5dfbaf1fe3 preserve sections of globals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33756 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 17:12:54 +00:00
Reid Spencer
5cbf985dcb For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33663 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-30 20:08:39 +00:00
Chris Lattner
ec9bfdc152 Read from the right place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33611 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-29 02:18:13 +00:00
Chris Lattner
c36357c406 Fix PR1139
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33610 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-29 00:21:34 +00:00
Reid Spencer
26f238589f For PR761:
The Module::setEndianness and Module::setPointerSize methods have been
removed. Instead you can get/set the DataLayout. Adjust thise accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33530 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 08:11:39 +00:00
Reid Spencer
a54b7cbd45 For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
Reid Spencer
78d033e086 For PR411:
Take an incremental step towards type plane elimination. This change
separates types from values in the symbol tables by finally making use
of the TypeSymbolTable class. This yields more natural interfaces for
dealing with types and unclutters the SymbolTable class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32956 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-06 07:24:44 +00:00
Andrew Lenharth
8753c447a5 extern_weak linkage. fixes PR1038
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32603 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 17:35:32 +00:00
Reid Spencer
4da49122f3 Change inferred getCast into specific getCast. Passes all tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32469 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 05:05:00 +00:00
Bill Wendling
1a097e30d3 Don't use <sstream> in Streams.h but <iosfwd> instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32340 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 23:41:45 +00:00
Bill Wendling
e81561909d Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 01:30:32 +00:00
Anton Korobeynikov
78ee7b78c3 Introducing external weak linkage. Darwin codegen should be added later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32052 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-01 00:25:12 +00:00
Bill Wendling
41edad7e4b Removed #include <iostream> and replaced with llvm_* streams.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31936 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 10:09:12 +00:00
Chris Lattner
b324bd735f silence warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31587 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-09 05:18:12 +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
Chris Lattner
27d672136a eliminate some ugly code, using ConstantExpr::getWithOperands instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29149 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-14 22:21:31 +00:00
Chris Lattner
1127315562 Fix Regression/Linker/2006-06-15-GlobalVarAnment.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28812 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-16 01:24:04 +00:00
Chris Lattner
620fd68b10 Fix linking of inline asm objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28640 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 19:14:22 +00:00
Chris Lattner
9273b0403e Add shufflevector support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27515 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-08 01:19:47 +00:00
Evan Cheng
39c61fd527 Add code to RemapOperand() to handle Instruction::ExtractElement and
Instruction::InsertElement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27477 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-07 01:27:42 +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
e1b2e14f92 Add support for linking inline asm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25560 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-23 23:08:37 +00:00
Chris Lattner
a88eb9287e add support for ConstantPacked to the linker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25467 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 23:15:58 +00:00
Chris Lattner
ed74a4ef3b Fix test/Regression/Linker/2005-12-06-AppendingZeroLengthArrays.ll and
PR662.  Thanks to Markus for providing me with a ton of files to
reproduce the problem!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24619 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-06 17:30: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
Chris Lattner
cb9048a6e8 Preserve CC's when linking modules
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21799 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 01:09:39 +00:00
Misha Brukman
f976c856fc Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21422 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 22:55:34 +00:00
Chris Lattner
e4d5c441e0 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 04:54:21 +00:00
Chris Lattner
b9476d9b45 Eliminate silly warnings from the linker of the form:
WARNING: Type conflict between types named 'union.._604.'.
    Src=' %union.._604.'.
   Dest=' %union.._604.'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20252 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-19 17:52:37 +00:00
Chris Lattner
e6f8c5a716 Allow globals to be of different const'nesses when we link.
This finally resolves PR502, PR450,
and test/Regression/Linker/2005-02-12-ConstantGlobals{,-2}.ll correctly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20135 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-12 19:20:28 +00:00
Reid Spencer
0ba9e211be Make LinkModules a static member function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18859 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 03:00:16 +00:00
Chris Lattner
152f19ac65 Make sure to link the target-triple as well, so it ends up in the .llvm.bc file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18774 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-10 20:26:15 +00:00
Chris Lattner
d37a75b9be Revert this disgusting hack, John has a much nicer solution
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18611 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-08 03:31:14 +00:00
Chris Lattner
a6a2bdd0e0 Add a disgusting hack to work around a libstdc++ issue. This code should
be removed when PR400 is resolved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18610 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-08 03:28:51 +00:00
Chris Lattner
c8ef1edc63 Fix linkage of mismatched weak globals. This unbreaks 300.twolf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18494 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-04 18:54:48 +00:00
Chris Lattner
aee38ea569 Significantly rework linker support for global variables, allowing it to
correctly link globals whose LLVM types do not match.

This fixes several of the F2C SPEC FP benchmarks, which were failing this
due to the implementation of common blocks used by f2c.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18465 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-03 22:18:41 +00:00
Reid Spencer
719012d625 Remove blank comment lines for uniformity.
Make sure lines don't exceed 80 cols.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18242 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-25 09:29:44 +00:00
Chris Lattner
a63acbfeab Don't increment a dead iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17904 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 19:04:40 +00:00
Chris Lattner
0033baf94e Simplify the remapper by only needing one map, since the body of the functions
being linked do not need to be remapped any longer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17900 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 17:12:38 +00:00
Chris Lattner
4bbfbff119 Take advantage of the fact that we are allowed to clobber the input module
by splicing function bodies from the src module to the destination module.

This speeds up linking quite a bit, e.g. gccld time on 176.gcc from 26s -> 20s
when forming the .rbc file, with a profile build.  One of the really strange
but cool effects of this patch is that it speeds up the optimizers as well,
from 12s -> 10.7s, presumably because of better locality???

In any case, this is just a first step.  We can trivially get rid of the
LocalMap now and do other simplifications.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17893 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 07:31:51 +00:00
Chris Lattner
242e525edc The second arg may be clobbered by this function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17880 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:41:36 +00:00
Reid Spencer
7cc371a795 Linker.h moved to include/llvm from include/llvm/Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17807 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 23:27:04 +00:00
Reid Spencer
7f49602e5a This file originated in lib/VMCore/Linker.cpp but now lives in
lib/Linker/LinkModules.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17694 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-12 20:37:43 +00:00
Reid Spencer
07adb2836b Stop propagating method names that violate the coding standard
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17498 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-05 22:15:36 +00:00
Chris Lattner
b976e66816 Add support for undef and unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17041 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-16 18:08:06 +00:00
Chris Lattner
d4984cca0e Make sure the const bit gets inherited correctly when linking declarations
of disagreeing constness.  This fixes
test/Regression/Linker/ConstantGlobals[123].ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16692 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-05 02:28:11 +00:00
Reid Spencer
57a0efa322 Implement support for dependent libraries. The "source" module's dependent
libraries list is merged into the "destination" module's list. Also, if the
source module is one of the dependent libraries, it is removed from the
list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16282 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-11 04:25:17 +00:00
Chris Lattner
72cf7df6a3 Fix a nasty bug that Nate ran into. In particular, instead of emitting a 2+MB
error message, print out:

llvm-link: error linking in 'g.2.rbc': Global Variable Collision on
' %struct.D_Reduction* %d_reduction_10_gram' - External linkage globals have
different initializers

That's a bit more concise, huh?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15958 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 00:50:59 +00:00