Commit Graph

612 Commits

Author SHA1 Message Date
Chris Lattner
9646acfccf By popular demand, link up types by name if they are isomorphic and one is an
autorenamed version of the other.   This makes the IR easier to read, because
we don't end up with random renamed versions of the types after LTO'ing a large app.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146728 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 08:36:07 +00:00
Daniel Dunbar
4ab406d7fc LLVMBuild: Remove trailing newline, which irked me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146409 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 19:48:00 +00:00
Daniel Dunbar
d782bae970 build/CMake: Finish removal of add_llvm_library_dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145420 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 19:25:30 +00:00
Daniel Dunbar
a3a2dfd4a2 build: Add initial cut at LLVMBuild.txt files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143634 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 18:53:17 +00:00
Tanya Lattner
9af37a3de8 Add support to the linker to lazily link in functions. This change only links functions marked with specific linkage (internal, private, linker_private, linker_private_weak, linker_private_weak_def_auto, linkonce, linkonce_odr, and available_externally) if they have uses in the destination module. Instead of automatically linking, these functions are placed onto a worklist to be processed in the final stage of linking. We iterate over the list and if any functions on the list have uses in the destination module, we link them in and repeat the process until no changes in the state (uses) has changed. This means that any functions in the LazilyLink worklist that have a use in the destination module will be linked in and none that don't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143524 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 00:24:56 +00:00
Peter Collingbourne
8895316d04 Teach ModuleLinker::getLinkageResult about materialisable functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143316 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-30 17:46:34 +00:00
Tanya Lattner
2b28a74bc6 Allow the source module to be materialized during the linking process.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142010 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-14 22:17:46 +00:00
Tanya Lattner
f1f1a4f161 Make it possible to use the linker without destroying the source module. This is so the source module can be linked to multiple other destination modules. For all that used LinkModules() before, they will continue to destroy the source module as before.
This line, and those below, will be ignored--

M    include/llvm/Linker.h
M    tools/bugpoint/Miscompilation.cpp
M    tools/bugpoint/BugDriver.cpp
M    tools/llvm-link/llvm-link.cpp
M    lib/Linker/LinkModules.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141606 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 00:24:54 +00:00
Ivan Krasin
5f2318e065 lib/Linker: add support of deps which does not end with ".so".
It happens (for example) when you want to have a dependency on the .so
with the specific version, like liblzma.so.1.0.0 or
libcrypto.so.0.9.8.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140201 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 22:52:35 +00:00
Chris Lattner
1bcbf8582e switch to the new struct api.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137482 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 18:07:26 +00:00
Devang Patel
211da8f7a9 Linke NamedMDNodes after linking global values as comment suggests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136909 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04 19:44:28 +00:00
Chandler Carruth
ac03e736c7 Rewrite the CMake build to use explicit dependencies between libraries,
specified in the same file that the library itself is created. This is
more idiomatic for CMake builds, and also allows us to correctly specify
dependencies that are missed due to bugs in the GenLibDeps perl script,
or change from compiler to compiler. On Linux, this returns CMake to
a place where it can relably rebuild several targets of LLVM.

I have tried not to change the dependencies from the ones in the current
auto-generated file. The only places I've really diverged are in places
where I was seeing link failures, and added a dependency. The goal of
this patch is not to start changing the dependencies, merely to move
them into the correct location, and an explicit form that we can control
and change when necessary.

This also removes a serialization point in the build because we don't
have to scan all the libraries before we begin building various tools.
We no longer have a step of the build that regenerates a file inside the
source tree. A few other associated cleanups fall out of this.

This isn't really finished yet though. After talking to dgregor he urged
switching to a single CMake macro to construct libraries with both
sources and dependencies in the arguments. Migrating from the two macros
to that style will be a follow-up patch.

Also, llvm-config is still generated with GenLibDeps.pl, which means it
still has slightly buggy dependencies. The internal CMake
'llvm-config-like' macro uses the correct explicitly specified
dependencies however. A future patch will switch llvm-config generation
(when using CMake) to be based on these deps as well.

This may well break Windows. I'm getting a machine set up now to dig
into any failures there. If anyone can chime in with problems they see
or ideas of how to solve them for Windows, much appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136433 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 00:14:25 +00:00
Frits van Bommel
39b5abf507 Migrate LLVM and Clang to use the new makeArrayRef(...) functions where previously explicit non-default constructors were used.
Mostly mechanical with some manual reformatting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135390 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 12:00:32 +00:00
Devang Patel
2959ebd14d Link NamedMDNode before linking function bodies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135204 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 22:13:07 +00:00
Chris Lattner
f84c59d110 simplify this logic now that GlobalAlias::isDeclaration is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135183 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 20:23:05 +00:00
Chris Lattner
1afcace3a3 Land the long talked about "type system rewrite" patch. This
patch brings numerous advantages to LLVM.  One way to look at it
is through diffstat:
 109 files changed, 3005 insertions(+), 5906 deletions(-)

Removing almost 3K lines of code is a good thing.  Other advantages
include:

1. Value::getType() is a simple load that can be CSE'd, not a mutating
   union-find operation.
2. Types a uniqued and never move once created, defining away PATypeHolder.
3. Structs can be "named" now, and their name is part of the identity that
   uniques them.  This means that the compiler doesn't merge them structurally
   which makes the IR much less confusing.
4. Now that there is no way to get a cycle in a type graph without a named
   struct type, "upreferences" go away.
5. Type refinement is completely gone, which should make LTO much MUCH faster
   in some common cases with C++ code.
6. Types are now generally immutable, so we can use "Type *" instead 
   "const Type *" everywhere.

Downsides of this patch are that it removes some functions from the C API,
so people using those will have to upgrade to (not yet added) new API.  
"LLVM 3.0" is the right time to do this.

There are still some cleanups pending after this, this patch is large enough
as-is.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 17:41:24 +00:00
Bill Wendling
87fa8d12b4 Set the unnamed_addr only when we're creating a new GV in the dest module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128507 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-29 23:31:06 +00:00
Bill Wendling
5f49c29612 Revert r128501. It caused test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128506 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-29 23:28:02 +00:00
Bill Wendling
75c7563f83 We need to copy over the unnamed_addr attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128501 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-29 23:05:41 +00:00
Rafael Espindola
4e93885bab Correctly merge available_externally and regular definitions when they have
different visibilities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124650 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 05:33:52 +00:00
Rafael Espindola
ba7c38c36a Allow unnamed_addr on declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123529 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-15 08:15:00 +00:00
Rafael Espindola
c2a94da313 Keep unnamed_addr when linking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123364 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-13 05:12:34 +00:00
Chris Lattner
b5fa5fcecc Revamp the ValueMapper interfaces in a couple ways:
1. Take a flags argument instead of a bool.  This makes
   it more clear to the reader what it is used for.
2. Add a flag that says that "remapping a value not in the
   map is ok".
3. Reimplement MapValue to share a bunch of code and be a lot
   more efficient.  For lookup failures, don't drop null values
   into the map.
4. Using the new flag a bunch of code can vaporize in LinkModules
   and LoopUnswitch, kill it.

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123058 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 08:15:20 +00:00
Chris Lattner
a797ee0210 include the module identifier when emitting this warning, PR8865.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-30 02:49:45 +00:00
Chris Lattner
c7bad77606 print the right string, thanks for Frits for noticing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122636 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-30 01:07:20 +00:00
Chris Lattner
e0f6db369d improve warning message to at least say what the triples are.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 22:41:18 +00:00
Michael J. Spencer
79e8625220 Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 22:23:15 +00:00
Michael J. Spencer
7385509101 Support/PathV1: Deprecate get{Basename,Dirname,Suffix}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122157 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 22:23:07 +00:00
Owen Anderson
fffa863536 Revert r122143 through r122140, which collectively broke the LLVMC tests on
the buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 07:37:18 +00:00
Michael J. Spencer
1d6e7d2e42 Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122142 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 04:13:46 +00:00
Michael J. Spencer
b9c767cce5 Support/PathV1: Deprecate get{Basename,Dirname,Suffix}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122141 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 04:13:36 +00:00
Michael J. Spencer
3ff9563c3e MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 03:29:14 +00:00
Michael J. Spencer
333fb04506 Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 17:36:48 +00:00
Michael J. Spencer
1f6efa3996 Merge System into Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 18:16:10 +00:00
Mikhail Glushenkov
c8aef4b2ea GetDLLSuffix: Remove the leading dot from LTDL_SHLIB_EXT.
This allows using GetDLLSuffix() with appendSuffix().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118051 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 20:32:59 +00:00
Mikhail Glushenkov
572ec1f3c0 Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118050 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 20:32:52 +00:00
Rafael Espindola
19785995f6 Fix PR8300 by remembering to keep the bitcast in all cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 02:02:57 +00:00
Bill Wendling
933f9bdb00 Revert "RequiresUnique" patch. This should be handled at a lower level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115827 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 20:18:44 +00:00
Bill Wendling
c7a012e581 Change RequiresMerge to RequiresUnique. It's a better description of what this
fix is trying to accomplish.

This code could still use some polishing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 07:03:52 +00:00
Bill Wendling
7f5124829f If the destination module all ready has a copy of the global coming from the
source module *and* it must be merged (instead of simply replaced or appended
to), then merge instead of replacing or adding another global.

The ObjC __image_info section was being appended to because of this
failure. This caused a crash because the linker expects the image info section
to be a specific size.

<rdar://problem/8198537>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115753 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 06:16:30 +00:00
Michael J. Spencer
3a210e2d30 Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
This reverts commit r113632

Conflicts:

	cmake/modules/AddLLVM.cmake

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113819 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 23:59:48 +00:00
Michael J. Spencer
4e9c939312 CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 21:14:25 +00:00
Chris Lattner
0b5b18340b dead code patrol
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112713 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 16:06:39 +00:00
Dan Gohman
6cb8c23db1 Reapply r112091 and r111922, support for metadata linking, with a
fix: add a flag to MapValue and friends which indicates whether
any module-level mappings are being made. In the common case of
inlining, no module-level mappings are needed, so MapValue doesn't
need to examine non-function-local metadata, which can be very
expensive in the case of a large module with really deep metadata
(e.g. a large C++ program compiled with -g).

This flag is a little awkward; perhaps eventually it can be moved
into the ClonedCodeInfo class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112190 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 15:41:53 +00:00
Daniel Dunbar
fd406f1ee2 Revert r112091, "Remap metadata attached to instructions when remapping
individual ...", which depends on r111922, which I am reverting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112157 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 03:48:08 +00:00
Dan Gohman
ce934260dc Remap metadata attached to instructions when remapping individual
instructions, not when remapping modules.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 21:36:50 +00:00
Bill Wendling
4e34d50272 - Add the LinkerPrivateWeakDefAutoLinkage to the Ada bindings.
- Support the LinkerWeak*Linkage types in llvm-nm and in LinkModules.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 20:00:52 +00:00
Dan Gohman
e422d1b162 Link NamedMDNodes after linking GlobalValues, so that MDNodes
which reference GlobalValues are properly remapped.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111949 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 19:37:11 +00:00
Dan Gohman
e5835fbe7f When linking NamedMDNodes, remap their operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 19:31:04 +00:00
Dan Gohman
05ea54e886 Use MapValue in the Linker instead of having a private function
which does the same thing. This eliminates redundant code and
handles MDNodes better. MDNode linking still doesn't fully
work yet though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111941 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 18:50:07 +00:00
Dan Gohman
c47a474802 Don't cast away qualifiers with C-style casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111933 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 18:09:44 +00:00
Argyrios Kyrtzidis
8c8b9ee8c8 Revert r111082. No warnings for this common pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 10:27:23 +00:00
Argyrios Kyrtzidis
7268d97ae6 Add ATTRIBUTE_UNUSED to methods that are not supposed to be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 21:35:10 +00:00
Dan Gohman
17aa92c92a Make NamedMDNode not be a subclass of Value, and simplify the interface
for creating and populating NamedMDNodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 23:38:33 +00:00
Bill Wendling
07d3177117 Revert r107205 and r107207.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 22:34:52 +00:00
Bill Wendling
207855cff9 Introducing the "linker_weak" linkage type. This will be used for Objective-C
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:

       .globl l_objc_msgSend_fixup_alloc
       .weak_definition l_objc_msgSend_fixup_alloc
       .section __DATA, __objc_msgrefs, coalesced
       .align 3
l_objc_msgSend_fixup_alloc:
        .quad   _objc_msgSend_fixup
        .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107205 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 21:24:00 +00:00
Dan Gohman
30377e7809 Add basic error checking to MemoryBuffer::getSTDIN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104855 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 17:31:51 +00:00
Dan Gohman
95131fcb67 Use the return value of getMagicNumber instead of using a
separate canRead() call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104853 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 17:18:38 +00:00
Duncan Sands
47c5188789 Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move some
methods to try to have the type predicates be more logically positioned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 14:50:09 +00:00
Victor Hernandez
c8d7b85ba1 Linker should not remap null operands of metadata
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95468 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-06 01:31:55 +00:00
Victor Hernandez
7bf5cf401f Need to recurse for all operands of function-local metadata; and handle Instructions (which map to themselves)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 22:03:03 +00:00
Jeffrey Yasskin
f0356fe140 Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods.  The bindings to
other languages still use the ModuleProvider concept.  It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 20:34:15 +00:00
Chris Lattner
0a65a14417 merge two ifs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94650 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 02:18:21 +00:00
Victor Hernandez
2c9ad13b14 Linker needs to do deep-copy of function-local metadata to update references to function arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 00:30:42 +00:00
Chris Lattner
43b5f9312d make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 20:43:08 +00:00
Devang Patel
bc5201f837 Remove MetadataBase class because it is not adding significant value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 22:52:10 +00:00
Chris Lattner
e73a31f667 Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore.  libvmcore is
currently blocked on bugpoint, which uses EH.  Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 06:49:46 +00:00
David Chisnall
3472246ede Fixed linking of modules containing aliases to constant bitcasts. Existing behaviour first tried to replace the aliases with the global that they aliased (rather than the bitcast), causing a crash on an assert because the types didn't match. When this was fixed, it then did the same thing creating the new alias (creating an alias with a different type to its aliasee).
Linking modules containing aliases to GEPs is still not quite right.  GEPs that are equivalent to bitcasts will be replaced by bitcasts, GEPs that are not will just break.  Aliases to GEPs that are not equivalent to bitcasts are horribly broken anyway (it might be worth adding an assert when creating the alias to prevent these being created; they just cause problems later).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93052 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 16:27:31 +00:00
David Greene
2abc1ec2dd Change this back to errs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92674 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:55:22 +00:00
David Greene
0fbf0e3d5e Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92628 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:27:59 +00:00
David Greene
c2e0974afb Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92626 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:27:53 +00:00
Chris Lattner
5d0cacdbb6 rename "elements" of metadata to "operands". "Elements" are
things that occur in types.  "operands" are things that occur
in values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 01:22:29 +00:00
Bill Wendling
e90c545aeb Remove dead store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92192 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 01:54:15 +00:00
Daniel Dunbar
d65267ee62 Fix MemoryBuffer::getSTDIN to *not* return null if stdin is empty, this is a lame API.
Also, Stringrefify some more MemoryBuffer functions, and add two performance FIXMEs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86630 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 00:43:58 +00:00
Chris Lattner
570a0b8d74 random tidy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86511 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 04:18:23 +00:00
Chris Lattner
49e27a5375 remove a redundant printout, LinkInArchive prints this as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 04:15:28 +00:00
Daniel Dunbar
2928c83b01 Pass StringRef by value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86251 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 10:58:06 +00:00
Chris Lattner
2a749d3647 implement linker support for BlockAddress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85700 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-01 02:46:39 +00:00
Dan Gohman
be6d1fd5f4 Remove unnecessary #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 22:24:25 +00:00
Devang Patel
faf8fa5664 There is not any need to copy metadata while merging modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80941 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 20:35:57 +00:00
Chris Lattner
74382b7c69 Prune #includes from llvm/Linker.h and llvm/System/Path.h,
forcing them down into various .cpp files.

This change also:
1. Renames TimeValue::toString() and Path::toString() to ::str()
   for similarity with the STL.
2. Removes all stream insertion support for sys::Path, forcing
   clients to call .str().
3. Removes a use of Config/alloca.h from bugpoint, using smallvector
   instead.
4. Weans llvm-db off <iostream>

sys::Path really needs to be gutted, but I don't have the desire to
do it at this point.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79869 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 22:45:37 +00:00
Chris Lattner
bdff548e4d eliminate the "Value" printing methods that print to a std::ostream.
This required converting a bunch of stuff off DOUT and other cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79819 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 04:37:46 +00:00
Devang Patel
ab67e705f5 Link NamedMDNodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 18:01:24 +00:00
Devang Patel
ae709eaeb1 Link metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 06:46:31 +00:00
Owen Anderson
a7235ea724 Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:28:14 +00:00
Owen Anderson
debcb01b0f Move types back to the 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 22:17:13 +00:00
Benjamin Kramer
6c1e983a17 Remove now unused Context variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77495 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 19:14:17 +00:00
Owen Anderson
baf3c40440 Move ConstantExpr to 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77494 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 18:55:55 +00:00
Owen Anderson
af7ec97587 Return ConstantVector to 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77366 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 21:19:26 +00:00
Owen Anderson
1fd7096407 Change ConstantArray to 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77347 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 18:32:17 +00:00
Owen Anderson
8fa3338ed2 Move ConstantStruct back to 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 22:29:26 +00:00
Daniel Dunbar
03d7651c36 Remove Value::{isName, getNameRef}.
Also, change MDString to use a StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 23:55:21 +00:00
Daniel Dunbar
92ccf70ad4 Finish migrating VMCore to StringRef/Twine based APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77051 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 06:02:13 +00:00
Daniel Dunbar
6e0d1cb309 Initial update to VMCore to use Twines for string arguments.
- The only meat here is in Value.{h,cpp} the rest is essential 'const
   std::string &' -> 'const Twine &'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77048 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 04:41:11 +00:00
Daniel Dunbar
bc8d813f71 Switch ValueSymbolTable to StringRef based API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 18:52:12 +00:00
Owen Anderson
e922c02019 Get rid of the Pass+Context magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 00:24:57 +00:00
Bill Wendling
3d10a5a757 Add plumbing for the `linker_private' linkage type. This type is meant for
"private" symbols which the assember shouldn't strip, but which the linker may
remove after evaluation. This is mostly useful for Objective-C metadata.

This is plumbing, so we don't have a use of it yet. More to come, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 01:03:30 +00:00
Torok Edwin
c23197a26f llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 16:55:14 +00:00
Torok Edwin
c25e7581b9 assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 20:10:48 +00:00
Owen Anderson
e9b11b4313 Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75025 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 19:03:57 +00:00
Owen Anderson
3d29df3e8a Push LLVMContext through GlobalVariables and IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74985 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 01:26:06 +00:00
Owen Anderson
c9ab7bf98f LLVM Context-ification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 21:07:14 +00:00
Owen Anderson
4434ed44c4 Make the use of const with respect to LLVMContext sane. Hopefully this is the last time, for the
moment, that I will need to make far-reaching changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74655 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 23:13:44 +00:00
Owen Anderson
31895e7359 Hold the LLVMContext by reference rather than by pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 21:22:36 +00:00
Owen Anderson
8b477ed579 Add a pointer to the owning LLVMContext to Module. This requires threading LLVMContext through a lot
of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools.

Patches for Clang and LLVM-GCC to follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74614 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 16:58:40 +00:00
Chris Lattner
266c7bbbbc Add a new "available_externally" linkage type. This is intended
to support C99 inline, GNU extern inline, etc.  Related bugzilla's
include PR3517, PR3100, & PR2933.  Nothing uses this yet, but it
appears to work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 05:44:34 +00:00
Duncan Sands
a05ef5e107 Apply ODR linkage changes accidentally dropped during
final cleaning.  This fixes a bunch of testsuite failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66380 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-08 13:35:23 +00:00
Duncan Sands
667d4b8de6 Introduce new linkage types linkonce_odr, weak_odr, common_odr
and extern_weak_odr.  These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global.  In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time.   This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function.  If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body.  The
code generators on the other hand map weak and weak_odr linkage
to the same thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66339 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 15:45:40 +00:00
Mikhail Glushenkov
c834bbf558 Oops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65942 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 10:04:23 +00:00
Mikhail Glushenkov
eba2cb0d5a 80-column violation + trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65936 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 07:22:23 +00:00
Rafael Espindola
bb46f52027 Add the private linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62279 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 20:18:42 +00:00
Misha Brukman
9b8f542e27 Removed trailing whitespace from Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-09 16:44:42 +00:00
Dan Gohman
5d9759bd04 Make comments and code for QuietWarnings and QuietErrors
actually correspond to what their names suggest.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 17:57:20 +00:00
Anton Korobeynikov
d13726f1e9 Also properly handle linking of strong alias and weak global
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57595 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 20:10:50 +00:00
Anton Korobeynikov
e655e37032 Properly handle linking of strong alias with weak function, this fixes PR2883
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57594 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 20:10:08 +00:00
Duncan Sands
5df3186f59 Rename isWeakForLinker to mayBeOverridden. Use it
instead of hasWeakLinkage in a bunch of optimization
passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56782 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 11:25:42 +00:00
Oscar Fuentes
3d01fc7de8 Initial support for the CMake build system.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56419 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 01:08:49 +00:00
Anton Korobeynikov
19e861a4ff Make safer variant of alias resolution routine to be default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56005 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 20:05:04 +00:00
Anton Korobeynikov
832b2a9cd8 Fix incorrect linker behaviour: we shouldn't resolve weak aliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55997 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 18:23:48 +00:00
Chris Lattner
6157e383c4 Reimplement LinkFunctionProtos in terms of GetLinkageResult. This fixes
the second half of link-global-to-func.ll and causes some minor changes in
messages.

There are two TODOs here.  First, this causes a regression in 
2008-07-06-AliasWeakDest.ll, which is now failing (so I xfailed it).  Anton,
I would really appreciate it if you could take a look at this.  It should be
a matter of adding proper alias support to GetLinkageResult, and was probably
already a latent bug that would manifest with globals.

The second todo is to reimplement LinkAlias in the same pattern as 
function and global linking.  This should be pretty straight-forward for 
someone who knows aliases, but isn't a requirement for correctness.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53548 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 07:23:24 +00:00
Chris Lattner
ae1132d2b8 don't do any linkage, not even type resolution, of symbols that have
internal linkage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53547 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 06:52:19 +00:00
Chris Lattner
d1ec48c641 implement linking of globals to functions, in one direction
(replacing a function with a global).  This is needed when building
llvm itself with LTO on darwin, because of the EXPLICIT_SYMBOL hack
in lib/system/DynamicLibrary.cpp.

Implementation of linking the other way will need to wait for a 
cleanup of LinkFunctionProtos.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53546 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 06:49:45 +00:00
Chris Lattner
0bb8757997 wrap long lines, remove some code from a non-assert build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53545 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 05:52:33 +00:00
Chris Lattner
5ed2ba2668 The source and dest of an alias are *not* required to have the same type,
though that would be nice and make sense :).  Patch by Nathan Keynes!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53387 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 01:09:33 +00:00
Dan Gohman
6b345ee9b2 Make DenseMap's insert return a pair, to more closely resemble std::map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53177 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 17:46:23 +00:00
Anton Korobeynikov
80585f1daa Add convenient helper for checking whether global is weak in linker sense
having weak or linkonce or common or extweak LLVM linkage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53158 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 23:48:30 +00:00
Anton Korobeynikov
f88bc65932 Override weak stuff during linking of aliases. This fixes PR2463.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53156 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 23:33:22 +00:00
Anton Korobeynikov
194c2cef8a Properly link alias and function decls. This fixes PR2146
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53154 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 23:03:21 +00:00
Chris Lattner
a534b0f7bf when linking globals, make sure to preserve the address space of the global.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52810 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 03:10:24 +00:00
Chris Lattner
ec91ccba3c Fix an error handling redefinition of linkonce functions where the
types differ.  Patch by Nathan Keynes!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52527 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 05:29:39 +00:00
Chris Lattner
fc196f9ee9 Add a missing ~ (dtor became ctor) which caused crashes on a bunch of stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52374 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 23:06:51 +00:00
Chris Lattner
a4477f9b31 stop making PATypeHolder's so crazily.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52364 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 21:17:12 +00:00
Chris Lattner
62a81a1eba use a real associative container for type association instead of using
a vector with a linear search.  This speeds up the linking testcase 
in PR1860 from 0.965s to 0.385s on my system.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52357 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 21:00:18 +00:00
Chris Lattner
56539659eb bail out sooner if we have two concrete but different types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52351 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 20:03:01 +00:00
Chris Lattner
9ddf2c898f simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52350 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 19:55:40 +00:00
Chris Lattner
849dcd928a Apply a patch from Nathan Keynes, which speeds up llvm-link on
the testcases in PR1860 from taking more than 1 hour (when I killed it)
to taking 1s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52347 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 19:48:08 +00:00
Chris Lattner
f6f4f7a149 handle vectors. Any integers that got here would necessarily be different already.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52341 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 18:27:53 +00:00
Chris Lattner
bc1c82a0f7 Simplify ResolveTypes by pulling the null case out into the one
client that cares and simplifying its control flow.

Remove the DestST argument to ResolveTypes and RecursiveResolveTypes*
which are dead now.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52340 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 18:19:05 +00:00
Chris Lattner
371ca83d8b simplify RecursiveResolveTypes and ResolveTypes by pulling the naming out of
ResolveTypes into the one place that needs it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52338 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 18:11:40 +00:00
Chris Lattner
822143e6f7 use 'continue' to make the function linker simpler. When linking a strong
function into a weak function, zap the weak function body so that the
strong one overrides it.  This fixes PR2410


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52135 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-09 07:47:34 +00:00
Chris Lattner
8246849829 minor changes to short circuit the 'no linkage' case earlier for
function bodies.  We now don't try to unify types or handling type
mismatches if when linking an internal foo to an external foo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52134 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-09 07:36:11 +00:00
Chris Lattner
bc3d1c7e4c simplify function visibility handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52133 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-09 07:25:28 +00:00
Duncan Sands
28c3cff825 Factor code to copy global value attributes like
the section or the visibility from one global
value to another: copyAttributesFrom.  This is
particularly useful for duplicating functions:
previously this was done by explicitly copying
each attribute in turn at each place where a
new function was created out of an old one, with
the result that obscure attributes were regularly
forgotten (like the collector or the section).
Hopefully now everything is uniform and nothing
is forgotten.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51567 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-26 19:58:59 +00:00
Gabor Greif
b1dbcd886a Fix a bunch of 80col violations that arose from the Create API change. Tweak makefile targets to find these better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 10:04:30 +00:00
Dale Johannesen
aafce77b17 Add CommonLinkage; currently tentative definitions
are represented as "weak", but there are subtle differences
in some cases on Darwin, so we need both.  The intent
is that "common" will behave identically to "weak" unless
somebody changes their target to do something else.
No functional change as yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51118 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 20:12:51 +00:00
Anton Korobeynikov
caa8ae8125 Fix linking of internal aliases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50950 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-10 14:41:43 +00:00
Anton Korobeynikov
0b12ecf6ff Turn StripPointerCast() into a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50836 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 22:54:15 +00:00
Anton Korobeynikov
149a315369 If weak GlobalVariable was bitcast'ed to different type during linking
we will need to strip all casts for intializer lookup.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50776 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 22:52:54 +00:00
Owen Anderson
6bc41e8a74 Revert r49614. As Dan pointed out, some of these aren't correct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49657 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 17:38:21 +00:00
Owen Anderson
386ea355e7 Replace calls of the form V1->setName(V2->getName()) with V1->takeName(V2),
which is significantly more efficient.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49614 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 19:15:17 +00:00
Gabor Greif
051a950000 API changes for class Use size reduction, wave 1.
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49277 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 20:25:17 +00:00
Chris Lattner
038112a4e0 Change the MemoryBuffer::getFile* methods to take just a pointer to the
start of a filename, not a filename+length.  All clients can produce a
null terminated name, and the system api's require null terminated 
strings anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49041 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 18:04:03 +00:00
Anton Korobeynikov
5241957b1f Ultimately resolve aliases during linking, if possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48259 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11 22:51:09 +00:00
Anton Korobeynikov
7fcb6b65c9 Fix thinko: alias always defines new symbol. Even is aliasee itself is undefined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48203 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11 00:24:53 +00:00
Anton Korobeynikov
ed61c0bc76 Add sanity checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48184 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 22:36:53 +00:00
Anton Korobeynikov
b8cdaf7099 Typo: 'function' => 'alias'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48183 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 22:36:35 +00:00
Anton Korobeynikov
817bf2aeb2 Syntactic sugar'ify stuff :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48182 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 22:36:08 +00:00
Anton Korobeynikov
aeb09967fd Always run 'make check' :) Fix fallout from prev. commit: query for possible
alias destination only if we don't have anything to link to


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48181 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 22:35:31 +00:00
Anton Korobeynikov
1438b9dd82 Make error messages to have common style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48180 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 22:34:46 +00:00
Anton Korobeynikov
01f6939935 Properly link globals with aliases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48179 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 22:34:28 +00:00
Anton Korobeynikov
968e39a5ab Remove the LinkGlobal weirderness in common linking phase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48177 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 22:33:53 +00:00
Anton Korobeynikov
2b48ef0450 Typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48176 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 22:33:22 +00:00
Ted Kremenek
58d5e05157 Fix some compilation errors on msvc:
- "Redefinition of I" (iterator masks previous definition)
- include missing header file

Patch by Argiris Kirtzidis!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48115 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09 18:32:50 +00:00
Anton Korobeynikov
75c7915c3a Clarify some important bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48010 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07 18:34:50 +00:00
Anton Korobeynikov
e20c814518 Small cleanup: propagate thread-localness via generic routine.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48009 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07 18:32:18 +00:00
Anton Korobeynikov
9f2ee70366 Missed patch from my last commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47977 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05 23:21:39 +00:00
Anton Korobeynikov
3db9191baf Resolve aliases to aliasees, where possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47975 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05 23:08:47 +00:00
Anton Korobeynikov
b5a4bd86df Handle functions as targets during linking of aliases as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47974 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05 23:08:16 +00:00
Anton Korobeynikov
58887bc593 Try hard to link aliases. Checks can be too strict by now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47968 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05 22:22:46 +00:00
Anton Korobeynikov
4fb2873bb4 Remember the source->dest mapping when copying aliases. This fixes PR2054
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47945 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05 15:27:21 +00:00
Anton Korobeynikov
1c01a72d4d Clarify the state-of-the-art
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47944 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05 15:11:00 +00:00
Anton Korobeynikov
eba0415600 Properly populate lists of defined/undefined symbols in presence of aliases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47900 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04 20:16:11 +00:00
Lauro Ramos Venancio
6b0f14b96a Emit an error when a library is not found. It is the GNU ld behavior and it is expected by the configure scripts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47674 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 17:20:32 +00:00
Anton Korobeynikov
a27694d7aa And final pack of warnings silencing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47372 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 11:27:04 +00:00
Chris Lattner
f27dfcb210 random cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47334 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 18:49:08 +00:00
Chris Lattner
4ee451de36 Remove attribution from file headers, per discussion on llvmdev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 20:36:04 +00:00
Chris Lattner
fc643c5e88 remove attribution from lib Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45415 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 20:09:26 +00:00
Anton Korobeynikov
650d5053bf Ignore functions with internal linkages during linking. This snipped mimics the
behaviour of LinkGlobals() function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45375 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-27 23:21:57 +00:00
Gordon Henriksen
194c90ed2a Fixing several transforms which would drop the collector attribute
when copying functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45356 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-25 22:16:06 +00:00
Duncan Sands
dc024674ff Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls.  This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll).  Hopefully
a bitcode guru (who might that be? :) ) will fix it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44359 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 13:23:08 +00:00
Dan Gohman
c318329a10 Use correct parentheses with the '&& "..."' idiom in an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42750 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:13:30 +00:00
Chris Lattner
97f8b0900a Fix PR1611 - Visibility should be ignored for a declaration
when a definition's visibility is different.  Likewise, the
visibility of two declarations mismatching is not an error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41174 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-19 22:22:54 +00:00
Reid Spencer
49068bf311 Improve error handling in the linker by:
1. Eliminate redundant error messages. LinkInFile and LinkInArchive
   already call the error() method in each case so there's no use
   telling the user again that an item couldn't be linked in.

2. Improve the formatting of error messages (separating content).

3. Change the wording for the warning about unrecognized files. Make
   it clear that the file is being ignored.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41121 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-16 07:47:30 +00:00
Reid Spencer
af11dc00a0 Ensure that error messages a propagated from calls to LinkInModule so they get
reported to the end user.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41117 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-16 07:23:37 +00:00
Reid Spencer
53424ad141 Allow the filename "-" to be a place holder for stdin. This allows directing
stdin through llvm-ld and llvm-link.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40938 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 19:52:29 +00:00
Reid Spencer
858dd546bb Report an error if one occurs in releaseModule.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40405 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-22 21:39:37 +00:00
Gabor Greif
e75ca3d809 eliminate residual cruft related to recognizing bytecode
files.
bitcode files are the only LLVM format left.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37945 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 13:38:17 +00:00
Gabor Greif
a99be51bf5 Here is the bulk of the sanitizing.
Almost all occurrences of "bytecode" in the sources have been eliminated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37913 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 17:07:56 +00:00
Lauro Ramos Venancio
00d8a84b44 Fix a bug in my previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37778 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-28 20:06:38 +00:00
Lauro Ramos Venancio
31ed0fb804 When linking two modules, we should copy the alias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-28 19:02:54 +00:00
Lauro Ramos Venancio
9613e871d2 Propagate alignment, section name and visibility when linking "appending
global values".
Fix noinline linkage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37482 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-06 22:01:12 +00:00
Chris Lattner
4bcca0f2ac switch this to bitcode instead of bytecode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36867 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06 09:29:13 +00:00
Chris Lattner
1a019e5ffd add bitcode support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36855 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06 06:02:13 +00:00
Reid Spencer
c9a83e4f19 If an archive is not recognized as an LLVM bytecode archive then declare
that it is native so that the linker will pass it on downstream. This avoids
a problem where the native link line fails because there is both a .so and
a .a file. The .a file gets processed as bytecode and then dropped from the
command line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36584 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-30 00:29:39 +00:00
Reid Spencer
126b1b8683 Dependent libraries could be native too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36582 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-30 00:00:10 +00:00
Anton Korobeynikov
9cd3ccf506 Implement visibility checking during linking. Also implement protected
visibility support for bitcode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36577 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-29 20:56:48 +00:00
Lauro Ramos Venancio
c763552299 Implement the "thread_local" keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35950 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 18:32:50 +00:00
Reid Spencer
18da072088 For PR1146:
Put the parameter attributes in their own ParamAttr name space. Adjust the
rest of llvm as a result.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35877 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 02:44:20 +00:00
Reid Spencer
c07cfdda02 For PR1302:
Use local variable names that match the function parameter name that it
is passed to so the code is more clear, to wit: is_bytecode -> is_native


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35656 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-04 06:44:18 +00:00
Reid Spencer
c8539731bd For PR1302:
Implement file tests for both LinkInLibrary and LinkInFile to determine if
the file is native. Don't generate warnings if the file is native.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35653 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-04 06:33:17 +00:00
Reid Spencer
9d6565a5b1 For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34293 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 02:26:10 +00:00
Chris Lattner
33f294930e simplify this code by using value::takename
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34172 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-11 00:39:38 +00:00
Chris Lattner
f2e292ce58 push bytecode decompressor out through APIs. Now the bytecode reader
api's look like this:

ModuleProvider *getBytecodeModuleProvider(
  const std::string &Filename,  ///< Name of file to be read
  BCDecompressor_t *BCDC = Compressor::decompressToNewBuffer,
  std::string* ErrMsg = 0,      ///< Optional error message holder
  BytecodeHandler* H = 0        ///< Optional handler for reader events
);

This is ugly, but allows a client to say:

  getBytecodeModuleProvider("foo", 0);

If they do this, there is no dependency on the compression libraries, saving
codesize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34012 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 21:41:02 +00:00
Reid Spencer
688b0490e2 For PR411:
Adjust to changes in Module interface:
getMainFunction() -> getFunction("main")
getNamedFunction(X) -> getFunction(X)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33922 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 21:19:13 +00:00
Reid Spencer
ef9b9a7939 For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33918 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 20:47:22 +00:00
Reid Spencer
619f024cc3 Fix some comments and other minor sundry things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33873 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-04 04:43:17 +00:00
Reid Spencer
471feac1b2 Ensure that visibility and section are properly propagated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33872 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-04 04:30:33 +00:00
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
Reid Spencer
0288d18bb6 Remvoe a do-nothing else block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31687 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 20:27:49 +00:00
Reid Spencer
4952143236 For PR998:
Fix an infinite loop in the Linker and a few other assorted link problems.

Patch contributed by Scott Michel. Thanks, Scott!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31680 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 11:54:25 +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
Reid Spencer
3ed469ccd7 For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 20:25:50 +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
501d529ccc Remove a redundant syscall.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29405 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-28 22:52:11 +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
Reid Spencer
8d8a7ffe58 Finish removal of EH usage from the Archive library. The REQUIRES_EH flag
in lib/Bytecode/Archive/Makefile is now removed. One small step closer to
a smaller LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29067 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-07 20:56:50 +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
John Criswell
43da9c65f2 Fixed style of curly brace. No functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25414 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-17 22:01:57 +00:00
Reid Spencer
f4484f3e16 For PR521:
With these patches we implement the ability for the Linker library to
keep track of which libraries were actually bytecode files (not archives)
and cause their users to remove such files from the list of libraries to
pass to the native linker.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25169 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-10 03:14:40 +00:00
Reid Spencer
3e5e127f29 Be a little more explanatory in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25168 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-10 03:12:29 +00:00
Reid Spencer
328ead9fce Adjust the constructor to the Linker class to take an argument that names
the module being constructed. This is used to correctly name the module.
Previously the name of the linker tool was used which produces confusing
output when the module identifier is used in an error message.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24699 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-13 20:00:37 +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
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
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
Reid Spencer
c7f083297c For PR495:
Change interface to Path class:
readable -> canRead
writable -> canWrite
executable -> canExecute

More (incremental) changes coming to close 495.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22345 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-07 18:21:42 +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
c72e57314a fix some 80 column violations
Add support for programs that define main in a .a file, such as f2c'd programs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20631 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 23:03:34 +00:00
Chris Lattner
fc82ef6797 consolidate LinkFiles into LinkItems, use lib_* iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20630 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 22:55:17 +00:00
Chris Lattner
ad988f397d consolidate LinkLibraries into LinkItems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20629 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 22:51:40 +00:00