Commit graph

162 commits

Author SHA1 Message Date
David Nadlinger
6a1bc70bd7 Added -float-abi and auto-detection logic for ARM.
Even though this argument design conflates two separate concepts
(ABI and hardware/software implementation), I chose to go
with it since users are liekly know it from GCC and the
combination of softloat operations with hardfloat ABI makes
no sense.

I didn't implement it for old LLVM versions, as ARM EABI
exception handling requires LLVM 3.3+ anyway, without which
LDC would be useless anyway.
2013-05-11 21:07:54 +02:00
David Nadlinger
30bf4e121f Do not optimize for host CPU by default.
GitHub: Fixes #323.
2013-05-09 22:15:19 +02:00
David Nadlinger
56e35e31a0 Factored out target creation logic to separate functions.
Care was taken to avoid dependencies on the host of
command line globals.

std::string should probably replaced by llvm::StringRef
in some places.
2013-05-09 17:27:35 +02:00
kai
41bbc8fbf5 Rewrite the llvm::Linker fix for LLVM 3.3.
The previous commit changed the behaviour a bit. This solution should have an identical result.
2013-05-05 20:27:12 +02:00
kai
ebaa3f08b3 Fix LLVM 3.3 build error.
llvm/Linker.h was changed. This commit reflects the new logic.
2013-05-05 18:42:14 +02:00
David Nadlinger
b8cdfad8c0 global.params.useAvailableExternally -> global.inExtraInliningSemantic.
This will hopefully make the associated code a bit easier
to read.
2013-04-01 21:17:13 +02:00
David Nadlinger
862ece3ca4 Fix -lib with fully specified output name and '-c'.
The whole output path handling code is in dire need of a
cleanup/rework.
2013-03-18 13:33:55 +01:00
David Nadlinger
153caa9bf7 Print nice error message for wrong '-run' argument.
This fixes DMD test case 'diag6743'.
2013-03-16 14:02:01 +01:00
David Nadlinger
58908e044a Removed DMD code remnants from driver/main.cpp. 2013-03-16 13:37:07 +01:00
kai
d04864103e Use the new Port::stricmp() method. 2013-03-08 06:53:12 +01:00
kai
bf52dbe389 Merge of DMD 2.062. 2013-03-06 18:18:56 +01:00
kai
aa4fe6a748 Remove DMDV1 and DMDV2. 2013-03-06 18:18:00 +01:00
David Nadlinger
e7bbacadb7 Removed useless -quiet switch. 2013-02-13 00:07:49 +01:00
David Nadlinger
0a96aea868 Sort includes according to style guidelines:
1. Main include corresponding to .cpp file, if any.
 2. DMD and LDC includes.
 3. LLVM includes.
 4. System includes.

Also updated a few include guards to match the default format.
2013-02-07 21:20:55 +01:00
David Nadlinger
d4b391249d Removed redundant global.params.os field.
I hope I have untangled the checks for "native" Windows (Triple::Win32)
vs. Windows/MinGW/Cygwin (Triple::isOSWindows) correctly.

MinGW needs some default libraries as well, has to be fixed later.
2013-02-07 21:20:54 +01:00
David Nadlinger
5f3ba41574 Removed redundant global.params.cpu field.
Now that we have global.params.targetTriple, the information
is only duplicated.
2013-02-07 17:36:54 +01:00
David Nadlinger
bee0b9eba1 Remove global.params.isLE. 2013-02-07 14:37:21 +01:00
kai
6ddb524b91 More LLVM 3.3 changes 2013-01-11 22:46:36 +01:00
kai
a11459bc31 "The Great Renaming" continues.
More changes to match the renamed files of LLVM 3.3.
2013-01-06 17:17:30 +01:00
David Nadlinger
2f8705f4d6 Don't pass file name to executable on '-run'. 2013-01-04 01:42:01 +01:00
David Nadlinger
59a4a02e49 Cleanup: Avoid signed/unsigned comparisons.
The ones ones left are for DMD-defined constants.
2012-12-20 01:21:09 +01:00
David Nadlinger
fca550e534 Cleanup: Remove warning overrides and fix two more warnings. 2012-12-20 01:00:57 +01:00
David Nadlinger
b713afe9c4 Cleaned up version output.
I removed the copyright notice. I don't think we are obliged to
display it for DMD; on the other hand, if we do, we might also
have to display the libconfig one (LGPL). Thus, this seemed like
the better choice.

The indentation is to align with the registered target output,
which we cannot control.
2012-12-16 18:08:19 +01:00
David Nadlinger
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
alexrp
811dca3cf6 Correctly set MIPS64 version identifier. 2012-11-15 16:47:37 +01:00
David Nadlinger
b7ecd71d75 Don't run inlining semantic3's on unit test builds.
Fixes build of std.net.curl unit tests.
2012-11-06 23:16:50 +01:00
kai
1423a9adb4 Add new platform AIX.
I have now access to a POWER7 box, so I hope to really supports this in druntime, too.
2012-10-23 08:42:16 +02:00
alexrp
05e634c267 Check for MIPS64 when using LLVM 3.1+. 2012-10-22 20:29:27 +02:00
alexrp
a54c2cf0f6 Drop Alpha and S/390 support. 2012-10-22 20:24:16 +02:00
alexrp
b5420eb22c A bunch of updates to version identifiers and platform detection. 2012-10-22 18:34:01 +02:00
kai
83a7258ae4 Add address space number to getPointerSize() calls.
This is required for LLVM 3.2.
2012-10-20 17:49:58 +02:00
kai
a7c7b514c0 Add changes for LLVM 3.2
- The Attributes class was changed again
- TargetData was renamed to DataLayout

Compiles again with LLVm 3.0, 3.1 and trunk(3.2).
2012-10-13 18:54:42 +02:00
David Nadlinger
0777102e9d Workaround for --help output being truncated when redirecting to file. 2012-10-07 15:08:24 +02:00
kai
3847471b0e DMD defines Win32 and Win64 mutually exclusive. Now LDC does the same. 2012-10-06 14:30:26 +02:00
David Nadlinger
9d52cf6855 Workaround for LLVM bug 11479 in -singleobj mode.
This applies the same fix as in 88f08cf for multiple object file
builds.

Fixes std.socket unit test builds.
2012-10-06 13:27:54 +02:00
David Nadlinger
e37cb50999 Use -of for object name when building executable with -singleobj.
This is what DMD does, and arguably the expected behavior – otherwise,
there would be no way other than using -od to prevent races if two
compiler instances could ever compile the same file(s) at the same
time (e.g. for debug/release configurations).

Should we transition to assuming -singleobj by default?
2012-10-03 18:01:58 +02:00
kai
940d6e907f Take advantage of Triple and TargetData.
A lot of system specific knowledge is already present in LLVM. This is used to populate several fields in global.params instead of hard coded values in main(). Ensures that the frontend and LLVM have always the same values.
2012-09-16 19:50:21 +02:00
kai
6e554c6647 Add support for MS Lib.
If the target OS is Windows using the MS runtime then use LIB.EXE as the archiver.
2012-09-16 00:03:27 +02:00
kai
4b0c4bf4ae Get rid of global.params.dataLayout.
The string representation of the data layout is retrieved from the TargetData class (in main) and passed via global.params.dataLayout to the module. Since the gTargetData is also a global variable it makes no sense to pass this information using another global variable.
2012-09-08 20:25:42 +02:00
David Nadlinger
bf0d8afc88 Merge branch 'dmd-2.060' into master.
Conflicts:
	dmd2/func.c
	dmd2/mars.c
2012-09-07 04:15:44 +02:00
David Nadlinger
837ef30fec Merged DMD 2.060 frontend.
Upstream Git tag v2.060 (e8fe11c20249cb9e42538be88c99b74ede4d12e3).
2012-09-07 03:51:31 +02:00
kai
9a3cdf2e10 Use .obj extension on Windows.
The Windows linker LINK insists on the .obj extension. The following changes are made:
- CMake uses the same extension as the C compiler
- global.obj_ext_alt (aka .obj) is recognized as objectfile extension
- global.obj_ext_alt is used on Windows
2012-09-05 19:23:34 +02:00
kai
af69672dc7 Fixed a bug regarding lifetime of C strings.
The string returned by c_str() is only valid as long as the object exists. Now the object 'triple' exists until the end.
2012-08-28 06:52:29 +02:00
kai
e6a07ffdfe Several changes to optimizer related code.
- New functions codeGenOptLevel() and verifyModule() to remove code duplication
- Hidden option no-verify renamed to disable-verify and moved to optimizer (like opt tool)
- Removed global.params.noVerify
2012-08-16 23:26:52 +02:00
kai
c01cae1c2b Prefer C++-style casts.
This is based on Item 2 of "More Effective C++". In general, the C++ cast operators are more expressive and easy to find,
e.g. by grep. Using const_cast also shuts up some compiler warnings.
2012-08-03 22:46:14 +02:00
kai
76cf66f50b Expose LLVM as global version symbol.
Required because prototypes of intrinsics changed between 3.0 and 3.1.
2012-08-03 16:44:34 +02:00
kai
8d06145ac0 Fixes ticket 457 from dsource.org.
-mattr=help does not printout help without source file
2012-07-29 20:46:14 +02:00
kai
10a0bdf891 More unification work. 2012-07-29 15:19:13 +02:00
kai
41bf3ea5c8 Fix warning about casting away constness by using const_cast<>. 2012-07-25 18:20:42 +02:00
kai
508dd9ff70 Simplify CMakeLists.txt.
This version works with LLVM 3.0 and 3.1.
2012-07-24 23:33:15 +02:00