Commit Graph

29771 Commits

Author SHA1 Message Date
Xerxes Ranby 5e24aa6490 Fix cmake build, add TargetMachineRegistry.cpp that got restored in r75807
llvm-svn: 75817
2009-07-15 19:58:35 +00:00
Stuart Hastings 850f8e4266 Restore file lost during reversion.
llvm-svn: 75807
2009-07-15 18:30:44 +00:00
Rafael Espindola f5d53d46b9 Revert 75798 to fix llvm build.
llvm-svn: 75805
2009-07-15 17:40:42 +00:00
Dan Gohman 607818a2c1 Add a Force option to raw_fd_ostream to specify whether opening
an existing file is considered an error. Convert several tools
to use raw_fd_ostream instead of std::ostream, and to use this
new option instead of doing a manual check.

llvm-svn: 75801
2009-07-15 17:29:42 +00:00
Stuart Hastings 338191cd67 Revert 75762, 75763, 75766..75769, 75772..75775, 75778, 75780, 75782 to repair broken LLVM-GCC build.
Will revert 75770 in the llvm-gcc trunk.

llvm-svn: 75799
2009-07-15 17:27:11 +00:00
Duncan Sands c5928d2fad The static function TypeToFloatSemantics is now
unused - remove it.

llvm-svn: 75798
2009-07-15 17:19:24 +00:00
Richard Osborne a8edd048c2 Fix pattern for LD16S_3r, add basic tests to check load / store instructions
are being properly selected.

llvm-svn: 75797
2009-07-15 17:06:59 +00:00
Dan Gohman 6935332d5f Add a raw_ostream version of CheckBitcodeOutputToConsole.
llvm-svn: 75796
2009-07-15 17:04:50 +00:00
Dan Gohman 213e87b1fe Check for errors on close(2) too. And lseek(2).
llvm-svn: 75793
2009-07-15 16:43:01 +00:00
Dan Gohman 33fb640835 Use 0664 instead of 0644 for the default open mode. This is
consistent with common std::ostream implmentations, and it gives
the user the option of using the umask group write bit.

llvm-svn: 75792
2009-07-15 16:39:40 +00:00
David Goodwin f39120571b Thumb-2 only support [base_reg + offset_reg] addressing, not [base_reg - offset_reg].
llvm-svn: 75789
2009-07-15 15:50:19 +00:00
Richard Osborne 57489b0658 Fix XCoreTargetLowering::isLegalAddressingMode to handle non simple VTs.
llvm-svn: 75788
2009-07-15 15:46:56 +00:00
Richard Osborne c50a460296 Remove the xcore-file-directive option now that LLVM has proper support for
emitting file directives with one parameter.

llvm-svn: 75787
2009-07-15 15:36:37 +00:00
Kevin Enderby 09ea5709a2 Added llvm-mc support for parsing the .dump and .load directives.
llvm-svn: 75786
2009-07-15 15:30:11 +00:00
Duncan Sands 9ad1594fe0 Remove the v3i32 and v3f32 value types: they are not
native for any supported targets.

llvm-svn: 75785
2009-07-15 15:28:52 +00:00
Daniel Dunbar eb8c83b4c3 Replace large swaths of copy-n-paste code with obvious helper function...
- Which was already present in the module!

 - I skipped this xform for Alpha, since it runs an extra pass during assembly
   emission, but not when emitting assembly via the DumpAsm flag.

 - No functionality change.

--
ddunbar@giles:llvm$ svn diff | grep '^- ' | sort | uniq -c
  18 -      PM.add(AsmPrinterCtor(ferrs(), *this, true));
  18 -    assert(AsmPrinterCtor && "AsmPrinter was not linked in");
  18 -    if (AsmPrinterCtor)
  18 -  if (DumpAsm) {
  18 -  }
ddunbar@giles:llvm$ svn diff | grep '^+ ' | sort | uniq -c
  18 +    addAssemblyEmitter(PM, OptLevel, true, ferrs());
  18 +  if (DumpAsm)
--

llvm-svn: 75782
2009-07-15 12:49:15 +00:00
Duncan Sands cf5b0f4155 Remove StringConstantPrefix now that the only user
(llvm-gcc) has gone.

llvm-svn: 75781
2009-07-15 12:39:48 +00:00
Daniel Dunbar 863e587d27 Kill off old (TargetMachine level, not Target level) match quality functions.
llvm-svn: 75780
2009-07-15 12:26:05 +00:00
Xerxes Ranby 9dbdf228d0 Fix cmake build lib/Target/TargetMachineRegistry.cpp removed.
llvm-svn: 75779
2009-07-15 12:19:36 +00:00
Daniel Dunbar 6db8134e80 Provide TargetMachine implementations with reference to Target they were created
from.
 - This commit is almost entirely propogating the reference through the
   TargetMachine subclasses' constructor calls.

llvm-svn: 75778
2009-07-15 12:11:05 +00:00
Daniel Dunbar 88f8559261 Kill off unused TargetMachineRegistry methods and ivars.
llvm-svn: 75774
2009-07-15 11:48:36 +00:00
Daniel Dunbar 5eb9700578 Migrate llc and the JIT to using the TargetRegistry for lookups.
- They still use the TargetMachineRegistry to populate the contents of the
   -march option (via the listener interface). We can't just populate it in the
   option parser because we can't expect the TargetRegistry to be populated yet
   (we no longer rely on static constructors).

 - There are a couple ways to finish killing off TargetMachineRegistry, but I
   haven't figured out the cleanest one yet...

llvm-svn: 75773
2009-07-15 11:36:15 +00:00
Daniel Dunbar 95b534f80e Include the Target& in the TargetMachineRegisterEntry.
llvm-svn: 75772
2009-07-15 11:23:49 +00:00
Daniel Dunbar 50859c907a Allow multiple registrations of the same target.
- This doesn't necessarily seem like a good idea, but the JIT unittest
   currently relies on it.

llvm-svn: 75769
2009-07-15 10:32:44 +00:00
Daniel Dunbar a8d73996ce Switch some obvious clients to using the new TargetRegistry.
llvm-svn: 75767
2009-07-15 10:05:03 +00:00
Daniel Dunbar 776fe8db5f Reimplement TargetMachineRegistry in terms of TargetRegistry.
- This is a temporary hack to aid in incremental refactoring, for now we
   allocate a new TargetMachineRegistryEntry on every getClosest... call.

 - No intended functionality change, other than the leaked memory.

llvm-svn: 75766
2009-07-15 09:53:37 +00:00
Daniel Dunbar b22f50e4c4 Register Target's TargetMachine and AsmPrinter in the new registry.
- This abuses TargetMachineRegistry's constructor for now, this will get
   cleaned up in time.

llvm-svn: 75762
2009-07-15 09:22:31 +00:00
Daniel Dunbar dcb50b9b54 Detect write failures on raw_fd_ostream.
llvm-svn: 75758
2009-07-15 08:11:46 +00:00
Daniel Dunbar 54995de1d4 Fix stupid thinko
llvm-svn: 75754
2009-07-15 07:37:49 +00:00
Daniel Dunbar 1c6633221f Address some review comments on TargetRegistry.
llvm-svn: 75753
2009-07-15 07:09:29 +00:00
Daniel Dunbar 56e2947a33 Add TargetInfo libraries for all targets.
- Intended to match current TargetMachine implementations.

 - No facilities for linking these in yet.

llvm-svn: 75751
2009-07-15 06:35:19 +00:00
Evan Cheng 9e0c7f2c5e Move load / store folding alignment require into the table(s).
llvm-svn: 75749
2009-07-15 06:10:07 +00:00
Ted Kremenek 1492e1781a Update CMake file.
llvm-svn: 75746
2009-07-15 05:39:55 +00:00
Chris Lattner e4a3f6fa3b rename decorateName -> DecorateCygMingName, make it assert if not
cygming, make the two callers only call it if cygming.  Other minor
cleanups.

llvm-svn: 75744
2009-07-15 04:55:56 +00:00
Chris Lattner c35b5bac32 eliminate the Mangler::PreserveAsmNames bit, the sole client of this
can do it perfectly well itself.

llvm-svn: 75743
2009-07-15 04:50:47 +00:00
Chris Lattner fe78558f95 remove printSuffixedName.
llvm-svn: 75742
2009-07-15 04:42:49 +00:00
Chris Lattner a2268c0b19 convert arm/darwin stubs to use the mangler to synthesize all the names instead of
doing it with printSuffixedName.

llvm-svn: 75741
2009-07-15 04:41:01 +00:00
Daniel Dunbar 078a71e4a9 Add new TargetRegistry.
Targets implement a single global Target structure which will live in a new
<Target>/TargetInfo library; this will be present in any image which the target
is usable in.
 - Optional target specific classes can then be registered and attached to the
   Target description.

 - Registration for normal Targets will be done via the initialization functions
   instead of using static constructors.

 - This allows clients to use a single interface to obtain target data, without
   requiring the code generator be linked in. It also provides a natural
   extension point for adding new optional target data (assembler parser,
   disassembler, etc.).

 - This also provides a new entry point for obtaining a target for a particular
   triple (without a module).

 - Not yet used, however this should eventually replace the TargetMachineRegistry.

llvm-svn: 75739
2009-07-15 04:24:58 +00:00
Chris Lattner 55452c2bea fix an arm codegen bug (the same as PR4482 on ppc) where available_externally
symbols were not getting stubs.  While I'm at it, add a big testcase for
stub generation to make sure I don't break anything.

llvm-svn: 75737
2009-07-15 04:12:33 +00:00
Chris Lattner 53fe736214 convert [Hidden]GVNonLazyPtrs to compute the global and stub names
with the mangler (like x86 and ppc), instead of going through 
printSuffixedName.

llvm-svn: 75736
2009-07-15 03:12:43 +00:00
Chris Lattner 52d0fec140 use makeNameProper to add the globalprefix instead of doing it manually.
llvm-svn: 75734
2009-07-15 03:01:23 +00:00
Chris Lattner 7d1f9542c2 get the PPC stub temporary label from the mangler instead of
using horrible string hacking.  This gives us a different label,
but it's just an assembler temporary, so the name doesn't matter.

llvm-svn: 75733
2009-07-15 02:56:53 +00:00
Chris Lattner d68df2a481 turn some if/then's into ?:
llvm-svn: 75732
2009-07-15 02:36:21 +00:00
Chris Lattner 9a066cacf5 eliminate a bunch of printSuffixedName's by using info computed from
Mangler in FnStubs.

llvm-svn: 75731
2009-07-15 02:33:19 +00:00
Chris Lattner e8382ac9b1 convert FnStubs to using a more structured form, eliminating
a couple instances of printSuffixedName (in favor of having
the mangler do stuff).

llvm-svn: 75729
2009-07-15 02:28:57 +00:00
Chris Lattner 1447bd2314 actually $stub labels *are* private, I just missed that
printSuffixedName automatically does this.

llvm-svn: 75727
2009-07-15 01:53:36 +00:00
Dan Gohman b0f8e9960d Fix indentation.
llvm-svn: 75723
2009-07-15 01:26:32 +00:00
Dan Gohman c43e47938a Make makeLoopInvariant report whether it made any changes or not,
and use this to simplify more code.

llvm-svn: 75722
2009-07-15 01:25:43 +00:00
Chris Lattner 7f318128d0 $stub references should not be private ("L") labels.
llvm-svn: 75721
2009-07-15 01:23:13 +00:00
Chris Lattner 8da3ce3bfd simplify "EmitExternalGlobal": it is only used to output a
reference to the personality function for a module, and
those are all added to the GVStubs array by looping
over MMI->getPersonalities()

llvm-svn: 75720
2009-07-15 01:16:38 +00:00