Commit graph

29 commits

Author SHA1 Message Date
Frits van Bommel
4158fb474a Add an llvm::OStream workalike class for use with Logger::cout(), with the
crucial difference being special handling of `llvm::Type`s so they get printed
by name rather than printing their full representation (which can be positively
*huge*).

This allows re-enabling some logger calls that were disabled due to extreme
verbosity.
2009-06-16 19:31:10 +02:00
Frits van Bommel
f5b56ce346 Fix typo in function name 2009-05-07 15:33:06 +02:00
Frits van Bommel
cf0b8936ce Factor out the code to find gcc, and add a command-line option to override the
default executable name.
This should help cross-compilation by allowing a cross-gcc to be specified from
the configuration file instead of only through the CC environment variable.
2009-05-04 13:32:16 +02:00
Frits van Bommel
257d305032 Change meaning of optimization levels: -O0 now means 'no optimization' like with
other compilers.
2009-03-29 15:51:14 +02:00
Frits van Bommel
e129494812 Allow specific optimization passes to be requested from the command line.
Now you can run "`ldc test.d -c -mem2reg -simplifycfg`" if you feel the urge.
The -O<N> options are still supported, and are inserted in the passes list in
the position where they appear on the command line.
(so -simplifycfg -O1 -instcombine does the "right thing")

One small change: -inline is renamed to -enable-inlining due to a naming
conflict with the option to add the -inline pass. -inline now inserts the
inlining pass in the position specified, not in the middle of -O<N>.
(ldmd has been updated to translate -inline to -enable-inlining)
2009-03-29 15:46:55 +02:00
Frits van Bommel
a742c59a67 Pass -m32/-m64 on to gcc when assembling and linking 2009-03-01 22:59:03 +01:00
Frits van Bommel
e37c82d1ec Use LLVM OStream wrapper instead of <iostream> in the logger.
llvm::OStream provides all std::ostream functionality (by holding a
std::ostream* internally), but
 * doesn't include <iostream>, avoiding per-file overhead.
 * allows the stream pointer to be null, and the (inlined) operators do nothing
   when that's the case. (This also allows removal of the ofstream("/dev/null")
   hack Logger used when disabled, which presumably wasn't very portable)
2009-02-26 14:51:02 +01:00
Frits van Bommel
b3d87205ad Use LLVM-style command line (instead of DMD-style)
Note: For a backward compatible interface, use the new bin/ldmd script. It
      supports all old options while passing on anything it doesn't recognize.

Some changes caused by this:
* -debug and -version are now -d-debug and -d-version due to a conflict with
  standard LLVM options.
* All "flag" options now allow an optional =true/=1/=false/=0 suffix.
* Some "hidden debug switches" starting with "--" were renamed because LLVM
  doesn't care about the number of dashes, so they were conflicting with other
  options (such as -c).
  The new versions start with "-hidden-debug-" instead of "--"
* --help works, but has a non-zero exit code. This breaks some Tango scripts
  which use it to test for compiler existence. See tango.patch.

Some changes not (directly) caused by this;
* (-enable/-disable)-FOO options are now available for pre- and postconditions.
* -march is used instead of -m (like other LLVM programs), but -m is an alias
  for it.
* -defaultlib, -debuglib, -d-debug and -d-version allow comma-separated values.
  The effect should be identical to specifying the same option multiple times.
  I decided against allowing these for some other options because paths might
  contain commas on some systems.
* -fPIC is removed in favor of the standard LLVM option -relocation-model=pic

Bug:
* If -run is specified as the last argument in DFLAGS, no error is generated.
  (Not very serious IMHO)
2009-02-25 17:34:51 +01:00
Christian Kamm
287fa3446c Add -m64 switch to gcc calls on 64-bit platforms. 2009-01-23 10:12:57 +01:00
Christian Kamm
ab9b9cc2e9 Solaris compatibility and proc map parsing #183, thanks BlueZeniX! 2009-01-22 18:53:32 +01:00
Christian Kamm
4042f90800 Apply afb's patch from #168 to use $CC instead of "gcc" for toobj and linker. 2009-01-17 17:52:09 +01:00
elrood
4c3d23ddfe modified gen/linker.cpp to only append .exe suffix on windows if not already present 2008-12-18 19:24:33 +01:00
Christian Kamm
881a141a1a Guess exe name from first object name if none specified. 2008-10-13 19:02:03 +02:00
Christian Kamm
b4e57e83eb Another link order fix. 2008-10-11 22:14:16 +02:00
Christian Kamm
ee407e597a Link using gcc instead. 2008-10-11 21:21:21 +02:00
Christian Kamm
6eeeafdba6 First part of rename to LDC. 2008-10-06 22:46:55 +02:00
Tomas Lindquist Olsen
d0c5df393c Applied the FreeBSD patch from Ralith, closes ticket #95 , slightly changed but basically the same. Thanx Ralith :) 2008-10-02 03:25:46 +02:00
Christian Kamm
877da230a3 Get rid of runtime path. Allow defaultlib and debuglib switches to be given multiple times. 2008-09-02 19:14:25 +02:00
Christian Kamm
8efe20f5f9 Link in pthread, dl and m on OS X. 2008-08-29 14:11:20 +02:00
Christian Kamm
72a2db6d7c Get rid of isLinux and isWindows in favor of global.params.os. 2008-08-24 16:22:58 +02:00
Tomas Lindquist Olsen
1f00395f0b Fixed path seperator issue on windows in linker. 2008-07-27 14:15:22 +02:00
Tomas Lindquist Olsen
70f16e36fb Added bitcode filename to very verbose logging.
Fixed -O<n> switches from llvm 2.4.
Removed md5 from the kdevelop project filelist.
2008-07-26 15:02:57 +02:00
Christian Kamm
d54a1347a4 Do only link to libpthread, libm and libdl on Linux. 2008-07-21 20:12:24 +02:00
Christian Kamm
6a45ce2474 [svn r346] Fixed #55 - llvmdc can link as fast as dmd now!
Made runtime to compile to native by default. Changed linker.cpp to link in native runtime library.
This change requires a runtime rebuild as well as a new symbolic link in lib/ to tango/lib/libtango-base-llvmdc-native.a.
2008-07-10 19:38:34 +02:00
Tomas Lindquist Olsen
a3c7b8b369 [svn r327] Fixed some more MinGW32 issues. It's now very close to working.
Fixed problems with inline asm like: mov EAX, FS:4 , which incidentally is used in the runtime to get the stack bottom, on Windows.
2008-06-27 23:58:22 +02:00
Tomas Lindquist Olsen
fe09b045f3 [svn r299] forgot to return status in runExecutable 2008-06-20 22:12:15 +02:00
Tomas Lindquist Olsen
41a104c0f4 [svn r298] Eliminated the dmd/link.c source file entirely in favor of a llvm::sys based approach to the same functionality. 2008-06-20 22:09:04 +02:00
Tomas Lindquist Olsen
c743549032 [svn r297] Fixed: rewrote linker code to use LLVM's Program facilities instead of DMD's oldschool broken "native" approach. 2008-06-20 17:45:13 +02:00
Tomas Lindquist Olsen
8b83eda2a2 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
Did a lot of smaller cleans up here and there.
Replaced more llvm::Foo with LLFoo for common stuff.
Split up tollvm.cpp.
2008-06-09 09:37:08 +02:00