Commit Graph

107 Commits

Author SHA1 Message Date
Frits van Bommel
622a93a810 Make LDC work with LLVM trunk (s/LinkOnceLinkage/LinkOnceOdrLinkage/)
Also moved the #defines for linkage types into a separate header instead of
mars.h so we can #include revisions.h without having to rebuild the entire
frontend every time we update.
(I'm using revisions.h to get the LLVM revision for use in preprocessor
conditionals. It should work with LLVM release 2.5, old trunk and new trunk)
2009-03-08 16:13:10 +01:00
Tomas Lindquist Olsen
57a69e8177 - Fixed LLVM style CL args for D2.
- Moved main() into its own file gen/main.cpp
- Fixed basic cross compilation
- removed the option for setting OS
- added support for llc's mattr, mcpu and mtriple switches
- added basic ABI abstraction for return value rewrites, it's not perfect and will probably be completely rewritten once I get to handling parameter rewrites as well.
- x86-64 extern(C) abi for cfloat returns now match (llvm-)gcc.
2009-02-26 14:11:49 +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
648e0b02cc Add OSX version declaration for Mac OS X to improve dmd-mac compatibility. 2009-02-15 21:44:03 +01:00
Tomas Lindquist Olsen
319e058410 Reverted back to the LLVM_InlineAsm_X86 versions, a few more things still needs to be sorted out first. 2009-02-04 20:47:27 +01:00
Christian Kamm
ab521c06ff LDC should follow the D ABI now. Switch back from LLVM_InlineAsm_X86 to
D_InlineAsm_X86.
2009-02-04 18:51:11 +01:00
Tomas Lindquist Olsen
dc5944df99 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Fixed align N; in asm blocks.

Fixed inreg parameter passing on x86 for ref/out params.

Removed support for lazy initialization of function local static variables, I have no idea why I ever implemented this, it's not in the D spec, and DMD doesn't support it :P

Some of the global variable related changes might cause minor regressions, but they should be easily fixable.
2009-02-03 08:54:57 +01:00
Tomas Lindquist Olsen
9b85a345e9 Removed use of TARGET_LINUX and replaced with POSIX, fixes bug [172] 2009-02-02 00:58:36 +01:00
Christian Kamm
f2ce0df11c Port some LDC1 portability fixes to LDC2. Fixes #196. 2009-01-29 17:19:48 +01:00
Christian Kamm
ab9b9cc2e9 Solaris compatibility and proc map parsing #183, thanks BlueZeniX! 2009-01-22 18:53:32 +01:00
Tomas Lindquist Olsen
dcb9628849 Merged DMD 1.039 2009-01-07 19:34:48 +01:00
Tomas Lindquist Olsen
16409a3367 Merged DMD 1.038 2009-01-06 16:33:51 +01:00
Christian Kamm
e7f750aee1 Apply BlueZeniX's patch for OpenSolaris compatibility. Fixes #158. 2009-01-04 15:49:28 +01:00
Christian Kamm
dff06d0f15 Add Elrood's patch to output LDC and LLVM source revs. 2008-12-14 16:51:36 +01:00
Christian Kamm
dabe5d3efd Remove unportable env-sanitizing code. If it is really needed, it needs to be
rethought. Closes #131.
2008-12-14 16:30:06 +01:00
Tomas Lindquist Olsen
6716aecc52 Merged DMD 1.037 frontend 2008-12-13 13:15:31 +01:00
Tomas Lindquist Olsen
e0972b0793 Fixed ModuleInfo generation to no longer use the ModuleInfo class' default initializer for types/defaults, it's unsafe as initializers don't necesarily match the "formal" type. There might be explicit padding.
Changed -g switch to emit DW_LANG_D debug info, make demangling work with a patched GDB, still more work to do for full support of D's Dwarf extensions.
Added getNullValue helper method.
2008-12-01 02:10:16 +01:00
Tomas Lindquist Olsen
f46f865375 Removed KDevelop3 project files, CMake can generate them just fine!
Fixed function literals in static initializers.
Changed alignment of delegates from 2*PTRSIZE to just PTRSIZE.
Changed errors to go to stderr instead of stdout.
Fairly major rewriting of struct/union/class handling, STILL A BIT BUGGY !!!
2008-11-29 21:25:43 +01:00
Christian Kamm
d260cab7e9 Print llvm package string in version header. See #128. 2008-11-26 19:40:11 +01:00
Christian Kamm
375b6cd888 Apply Elrood's CMake changes from #124. Thanks a lot! 2008-11-24 18:17:58 +01:00
Christian Kamm
891d17e4b5 Applied easy part from wilsonk's x86-64 patch in #107 2008-10-30 11:08:34 +01:00
Tomas Lindquist Olsen
6b9e85df48 Attempt at getting LLVM to provide a proper target data layout. Should assert now if things are borked.
Added untested support for Thumb target.
2008-10-27 17:37:34 +01:00
Christian Kamm
29dfacde9a Fold in mandel's patch for ARM from #106 2008-10-27 16:36:59 +01:00
Tomas Lindquist Olsen
5ad345646a Merged DMD 1.036.
Improved comments a little in the runtime source code.
2008-10-22 17:06:17 +02:00
Christian Kamm
773b15ba5e Use malloc instead of alloca. 2008-10-21 20:46:12 +02:00
Christian Kamm
742ffd88a3 Fix -of with multiple input files. 2008-10-21 18:15:34 +02:00
Christian Kamm
6c532ac149 Hopefully sensible command switch handling. Changed default ext to .o on Windows. 2008-10-16 22:07:02 +02:00
Tomas Lindquist Olsen
1757e2e1de Updated rebuild profile for .o output as default, compiler needs to be fixed still.
Fixed segfault with ' ldc foo.o -offoo '.
2008-10-13 18:19:43 +02:00
Tomas Lindquist Olsen
f15b115ee9 Started changing target triple stuff, part of fixing #97 2008-10-13 17:28:39 +02:00
Christian Kamm
ee8dd42c1d Some cleanups in command line argument descriptions. 2008-10-13 11:13:20 +02:00
Christian Kamm
bc39d73425 Allow output of only bc, ll, or s by making -of set the output type depending
on the extension.
2008-10-13 10:58:00 +02:00
Christian Kamm
a455186f28 Homepage rename. 2008-10-12 18:03:34 +02:00
Christian Kamm
697e5830fc Fix remaining make files. Fix linking order for static libs. 2008-10-11 21:40:44 +02:00
Christian Kamm
ee407e597a Link using gcc instead. 2008-10-11 21:21:21 +02:00
Christian Kamm
1bfc0316aa Make ldc call gcc to assemble. 2008-10-11 20:00:36 +02:00
Christian Kamm
73d7a299c9 Disable bc output by default. Remove -dis. Add -output-bc, -output-ll, -output-s.
Call to gcc to convert assembly to object file still required.
2008-10-11 13:07:59 +02:00
Christian Kamm
6eeeafdba6 First part of rename to LDC. 2008-10-06 22:46:55 +02:00
Tomas Lindquist Olsen
06a55194d7 Upgraded frontend to DMD 1.035 2008-10-06 16:22:11 +02:00
Tomas Lindquist Olsen
81b93325ca Added -nodefaultlib switch do disable implicitly linked standard lib modules 2008-10-05 18:55:43 +02:00
Tomas Lindquist Olsen
e2a1394ae8 Added FreeBSD support to the -t switch 2008-10-02 03:38:29 +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
Tomas Lindquist Olsen
f411df11e3 Fixed choosing default target machine without needing to link in targets. 2008-09-07 17:44:25 -07:00
Christian Kamm
d44f21687e Restructure path handling a bit. Fixes #66. 2008-09-06 12:27:27 +02:00
Tomas Lindquist Olsen
ccfa5218c3 merge 2008-09-04 17:05:35 +02:00
Christian Kamm
3779b7c7d1 Split runtime into three parts again. 2008-09-03 22:07:04 +02:00
Tomas Lindquist Olsen
f3b3db7fa9 Changed all '#if linux || __APPLE__' to '#if POSIX' so we can support other platforms too, thanx for the suggestion anders. 2008-09-02 23:10:12 +02:00
Christian Kamm
d6e7a65b69 Automated merge with http://hg.dsource.org/projects/llvmdc 2008-09-02 19:14:37 +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
Tomas Lindquist Olsen
9f0633a7dd Added some sanity checks for target detection. 2008-08-31 18:51:14 +02:00
Tomas Lindquist Olsen
c65cd45966 Removed unimplemented switches. 2008-08-26 21:02:25 +02:00