Commit Graph

3097 Commits

Author SHA1 Message Date
Rafael Espindola 235457ca7f Clone and restore the module being reduced in
ReduceMiscompilingFunctions::TestFuncs. This makes the test functional
(i.e., no side effects).

Before we would end up using dead functions if a pass decided to remove them
(inline for example) and we would also keep broken functions and conclude that
that a single function was enough to reproduce the bug.

llvm-svn: 109387
2010-07-26 00:07:51 +00:00
Rafael Espindola 74cc8b270f Revert unintended white space change.
llvm-svn: 109364
2010-07-24 23:05:45 +00:00
Rafael Espindola f8203a3a6d Fix a trivial use after free.
llvm-svn: 109363
2010-07-24 23:02:11 +00:00
Mikhail Glushenkov 1e5d7c6e82 Get rid of exceptions in llvmc.
llvmc can be now compiled with llvm-gcc on Windows.

llvm-svn: 109215
2010-07-23 03:42:55 +00:00
Chris Lattner 14caa59b14 there is now no reason to link in TARGETS_TO_BUILD since we list
arm explicitly.  X86 and ARM are the only two targets that support
disassembly, so our explicit list is enough.  These other targets
weren't getting pulled in anyway though, since there were no 
references to their symbols.

llvm-svn: 108934
2010-07-20 21:26:27 +00:00
Chris Lattner 75217e8cb7 fix edis to only try to link in the x86 parts if the x86 backend is
enabled.  Add direct ARM support.

llvm-svn: 108933
2010-07-20 21:23:57 +00:00
Douglas Gregor 5d69a3d518 Fix edis makefile
llvm-svn: 108931
2010-07-20 21:21:27 +00:00
Chris Lattner 9289f93153 fix DISABLE_EDIS
llvm-svn: 108925
2010-07-20 20:55:57 +00:00
Chris Lattner 03b7884b88 this logic is handled by tools/makefile.
llvm-svn: 108919
2010-07-20 20:33:59 +00:00
Chris Lattner db2e0ba6b5 edis needs to link in mcdisassembler.
llvm-svn: 108876
2010-07-20 18:35:23 +00:00
Chris Lattner b7a70ff82c update cmake.
llvm-svn: 108875
2010-07-20 18:33:29 +00:00
Chris Lattner 36dd830ba6 edinfo doesn't need to be built here.
llvm-svn: 108873
2010-07-20 18:31:54 +00:00
Chris Lattner 979634bbb0 start straightening out libedis's dependencies and make it fit
better in the llvm world.  Among other things, this changes:

1. The guts of libedis are now moved into lib/MC/MCDisassembler
2. llvm-mc now depends on lib/MC/MCDisassembler, not tools/edis,
   so edis and mc don't have to be built in series.
3. lib/MC/MCDisassembler no longer depends on the C api, the C
   API depends on it.
4. Various code cleanup changes. 

There is still a lot to be done to make edis fit with the llvm
design, but this is an incremental step in the right direction.

llvm-svn: 108869
2010-07-20 18:25:19 +00:00
Owen Anderson 81781220d2 Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch
would cause them to fail the way they are, but none of the other intervening patches seem likely either.

llvm-svn: 108818
2010-07-20 08:26:15 +00:00
Owen Anderson 8dc129325f Reapply r108794, a fix for the failing test from last time.
llvm-svn: 108813
2010-07-20 06:52:42 +00:00
Daniel Dunbar 4a35d6f8cd Revert r108794, "Separate PassInfo into two classes: a constructor-free
superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).", it is
breaking teh everything.

llvm-svn: 108805
2010-07-20 03:06:07 +00:00
Owen Anderson e7c5fe586a Separate PassInfo into two classes: a constructor-free superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).
llvm-svn: 108794
2010-07-20 01:19:58 +00:00
Mikhail Glushenkov 303838d69f llvmc: Add a new option type (switch_list).
llvm-svn: 108673
2010-07-19 03:16:25 +00:00
Daniel Dunbar 419197cc4d Target: Give the TargetAsmParser access to the TargetMachine.
- Unfortunate, but necessary for now to handle subtarget instruction matching. Eventually we should factor out the lower level target machine information so we don't need to do this.

llvm-svn: 108664
2010-07-19 00:33:49 +00:00
Daniel Dunbar fb44525696 edis: Save the TargetMachine in the EDDisassembler object.
llvm-svn: 108663
2010-07-19 00:33:43 +00:00
Daniel Dunbar 7f5bf5ae2a MC: Move several clients to using AsmParser constructor function.
llvm-svn: 108645
2010-07-18 18:31:33 +00:00
Daniel Dunbar 7a85f9cf4d llvm-mc: Fix llvm-mc -as-lex.
llvm-svn: 108644
2010-07-18 18:31:28 +00:00
Duncan Sands 2155e6539e Fix what seems like a clear buffer overflow, noticed by cppcheck.
llvm-svn: 108629
2010-07-17 20:23:37 +00:00
Dan Gohman aa28801f6a Make llvm-bcanalyzer print out the full enum name for all metadata
code ids, not just some of them.

llvm-svn: 108543
2010-07-16 18:28:07 +00:00
Daniel Dunbar bdb298912b build/Darwin: Add an LLVM_LTO_VERSION_OFFSET make variable to allow offsetting
the libLTO library version from the actual build version.

llvm-svn: 108495
2010-07-16 01:41:38 +00:00
Bob Wilson f1a6d7abc3 Remove some broken code to check the DISABLE_EDIS flag (edis is now in the
DIRS list, so it does no good to filter it from PARALLEL_DIRS), and replace
it with a check to disable building the shared library version of edis when
the flag is set.  Disabling it entirely does not work because MC uses it now.

llvm-svn: 108367
2010-07-14 22:41:51 +00:00
Duncan Sands 41b4a6b36a Convert some tab stops into spaces.
llvm-svn: 108130
2010-07-12 08:16:59 +00:00
Bill Wendling 03bcd6ecc8 Implement the "linker_private_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. However, this linkage isn't specific to
Objective-C.

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".

Currently only supported on Darwin platforms.

llvm-svn: 107433
2010-07-01 21:55:59 +00:00
Daniel Dunbar 02877d6e85 MC: Pass the target instance to the AsmParser constructor.
llvm-svn: 107426
2010-07-01 20:41:56 +00:00
Devang Patel 9b2a93a6cc Preserve debug info for only extracted symbols.
llvm-svn: 107417
2010-07-01 19:58:05 +00:00
Mikhail Glushenkov ed6aea770d Make -filelist work with -linker=c++.
llvm-svn: 107362
2010-07-01 01:00:32 +00:00
Bill Wendling 3632171750 Revert r107205 and r107207.
llvm-svn: 107215
2010-06-29 22:34:52 +00:00
Bill Wendling 1767723dbe 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".

llvm-svn: 107205
2010-06-29 21:24:00 +00:00
Duncan Sands b69a3e27df Remove variables that are written by not read.
llvm-svn: 107126
2010-06-29 11:07:47 +00:00
Devang Patel 0dc3c2d37e Use ValueMap instead of DenseMap.
The ValueMapper used by various cloning utility maps MDNodes also.

llvm-svn: 106706
2010-06-24 00:33:28 +00:00
Rafael Espindola ef49815638 Add an extra-library-path option to the plugin. This is used to support
having a library both as bitcode and native code. We want to use the
bitcode first, but if codegen produces new undefined references we have to use
the native code to satisfy those references.

Gold has no notion of bitcode and native search directories, so instead it has
an API where the plugin can instruct it to look for the libraries it is passing
to it. This patch uses that API.

llvm-svn: 106674
2010-06-23 20:20:59 +00:00
Rafael Espindola 9d94ebf1b6 add_input_file and add_input_library now take const arguments, remove the
const_cast.

llvm-svn: 106410
2010-06-21 02:23:12 +00:00
Rafael Espindola 720f49ed86 Save more temps with -save-temps.
llvm-svn: 106409
2010-06-21 02:17:36 +00:00
Rafael Espindola 8297640062 Add a pass-through option to the plugin. The use case for this option is to
ask the linker to take another look into some library or object. The case when
one might want to do this is when codegen introduces a new undefined reference.
The canonical example is libgcc.

llvm-svn: 106303
2010-06-18 19:18:58 +00:00
Rafael Espindola 77b6d01906 Don't produce output only if *all* files are unused.
llvm-svn: 105962
2010-06-14 21:20:52 +00:00
Daniel Dunbar 70883c32ec llvm-mc: Don't set NO_INSTALL on llvm-mc.
llvm-svn: 105837
2010-06-11 22:00:08 +00:00
Duncan Sands 9f403695e1 Change another reference to the "indirect callgraph node" to
refer to the "external node" instead.

llvm-svn: 105731
2010-06-09 17:39:05 +00:00
Duncan Sands 516473902b Output "external node" rather than "Indirect CallGraph node" when printing
callgraph SCC's.  This makes it match what the node itself would print.  Also,
"indirect callgraph node" doesn't make sense - it has nothing particularly to
do with indirect calls.

llvm-svn: 105730
2010-06-09 17:35:00 +00:00
Nick Lewycky 4ecf2cc5ea Plug a leak in the non-error case by removing one level of indirection.
llvm-svn: 105556
2010-06-07 21:42:19 +00:00
Dan Gohman fa9ad13002 Run dead type elimination after dead argument elimination.
llvm-svn: 105552
2010-06-07 20:28:37 +00:00
Dan Gohman 34a2249fde Use ->isVoidTy().
llvm-svn: 105550
2010-06-07 20:19:26 +00:00
Rafael Espindola c4dca3aeb6 Misc cleanups to the gold plugin.
llvm-svn: 105534
2010-06-07 16:45:22 +00:00
Dan Gohman 8c292adba4 No need to special-case structs here; structs are first-class now.
llvm-svn: 105513
2010-06-05 00:42:29 +00:00
Dan Gohman ae8bb42f5b No need to special-case structs here; structs are first-class now.
llvm-svn: 105442
2010-06-04 00:18:06 +00:00
Rafael Espindola 8fb957e5cb Add a emit-llvm option to the plugin and make the path argument to also-emit-llvm optional.
llvm-svn: 105414
2010-06-03 21:11:20 +00:00