Commit graph

92 commits

Author SHA1 Message Date
Kai Nacke
fe39da53e3 Merge of 2.065.0-b3.
The new visitor class is used for IR generation. This removes some modifications from DMD source.
2014-02-10 08:47:25 +01:00
kai
c28c7fb134 Introduce a debug info builder.
Moves all code from todebug into a new class.
Also caches the compilation unit in order to fix a LLVM 3.4 compile error.
2013-07-29 00:04:08 +02:00
David Nadlinger
292caa1438 Merge the 2.063 frontend. 2013-06-12 20:16:37 +02:00
David Nadlinger
5b5ad8e0f7 Add some no-op virtual destructors to silence GCC warning. 2013-06-12 20:16:05 +02:00
David Nadlinger
5742a0219c Fix inline asm labels in template functions.
This is a giant kludge to avoid a redesign of the inline asm
handling code. I'd be glad if somebody came up with a better
solution.

GitHub: Fixes #340.
2013-05-11 21:01:24 +02:00
David Nadlinger
8b9deecf34 Remove dead code. 2013-05-11 20:12:25 +02:00
David Nadlinger
bc09ceae18 Remove useless log delimiters, we do have log scopes. 2013-03-17 02:00:42 +01:00
kai
1e4a8fffc2 Remove DMDV1 and DMDV2. 2013-03-06 10:20:24 +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
8ff3a8060a Use llvm_unreachable instead of assert(0).
Also removed some unused functions.
2013-02-07 03:38:15 +01:00
Martin
62cb04f6f6 Merged x86 and x86_64 assembly parsers. 2013-01-27 15:31:26 +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
89809fdde3 Cleanup: Silence another "maybe-undefined" warning.
Also makes the assert in line 775 actually work.
2012-12-20 02:10:32 +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
0cd78dd579 Cleanup: Clang warning fixes.
No warnings left on a '-Wall' build except for a single tautological
compare in gen/asm-x86-32.h, which indeed seems like a bug.
2012-12-20 01:00:55 +01:00
David Nadlinger
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01: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
David Nadlinger
6fea7358dc Fixed several asm-related error message formats. 2012-09-07 03:51:32 +02:00
kai
2dbee75523 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-02 19:55:29 +02:00
Alexey Prokhin
e74e55df89 Merge 2.058beta 2012-02-15 13:23:16 +04:00
kai
f9201e8352 Merge 1.072 2012-02-02 03:13:27 +01:00
David Nadlinger
3916835380 Merge remote-tracking branch 'AlexeyProkhin/master' into merge-3.0
Conflicts:
	CMakeLists.txt
	druntime
	runtime/CMakeLists.txt
2011-12-04 18:38:09 +01:00
David Nadlinger
fe19ee84f5 Merge branch 'llvm3.0' into merge-3.0
Conflicts:
	gen/configfile.cpp
2011-12-04 18:16:36 +01:00
David Nadlinger
d0ea856024 Emit all D inline asm labels as local labels.
On OS X, there is an actual significance to the distinction, which before lead e.g. to exception throwing in the below example being broken:

---
import core.exception;

void main() {
  asm {
    jmp Lfoo;
Lfoo:
    ;
  }
  throw cast(OutOfMemoryError)cast(void*)OutOfMemoryError.classinfo.init;
  assert(0);
}
---
2011-12-04 18:13:33 +01:00
Alexey Prokhin
91f4e5d015 Added emission of dwarf lexical blocks.
Also, dropped support for DISABLE_DEBUG_INFO definition.
2011-12-04 15:34:35 +04:00
kai
a5b3dd29b5 Fixes 2 kinds of warnings.
1) The last parameter of getGetElementPtr() has type bool. In some instances, a 2 is used as parameter. This is converted to true.
2) Several loops use int instead of unsigned. This causes warning about signed/unsigned mismatch.

Curiously, only Visual C++ complains about this. Nevertheless I think that the warnings should be fixed.
2011-11-23 19:01:04 +01:00
David Nadlinger
abd1d160f4 Tabs->spaces. 2011-11-14 20:10:45 +01:00
Alexey Prokhin
629f13929e WIP: port to llvm 3.0 2011-10-25 15:43:39 +04:00
Alexey Prokhin
8f4a15c868 Fix ldc1 regressions 2011-09-10 13:24:29 +04:00
Alexey Prokhin
79edefdc37 Fixed compilation of functions that does not have return statement but contain inline asm 2011-07-19 22:22:49 +04:00
Alexey Prokhin
7a31b599cc Updated to dmdfe 2.054 2011-07-19 19:20:38 +04:00
Alexey Prokhin
c5e9784863 Updated to dmdfe 2.051 2011-01-05 18:21:40 +03:00
Alexey Prokhin
3ceb476d32 Inline assembler is not allowed in @safe functions 2011-01-04 19:18:53 +03:00
Tomas Lindquist Olsen
1fac40d2bd Update to work with LLVM 2.7.
Removed use of dyn_cast, llvm no compiles
without exceptions and rtti by
default. We do need exceptions for the libconfig stuff, but rtti isn't
necessary (anymore).

Debug info needs to be rewritten, as in LLVM 2.7 the format has
completely changed. To have something to look at while rewriting, the
old code has been wrapped inside #ifndef DISABLE_DEBUG_INFO , this means
that you have to define this to compile at the moment.

Updated tango 0.99.9 patch to include updated EH runtime code, which is
needed for LLVM 2.7 as well.
2010-05-19 12:42:32 +02:00
Benjamin Kramer
c220dcac05 IntegerType is now contextifed.
Requires llvm >= 78969. resistor says this will be the last context API change :)
2009-08-14 00:39:18 +02:00
Benjamin Kramer
66101517d7 LLVMContext changes up to r77366 2009-07-30 15:25:10 +02:00
Benjamin Kramer
d7049de966 More factory methods moved to LLVMContext 2009-07-15 18:09:41 +02:00
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
Tomas Lindquist Olsen
f5d635dfc7 Adds explicit alignment information for alloca instructions in general, there's a few cases that still needs to be looked at but this should catch the majority. Fixes ticket #293 . 2009-05-14 13:26:40 +02:00
Christian Kamm
0ef57dcfbe Reenable error for gotos into or out of finally blocks. 2009-03-28 19:16:53 +01:00
Christian Kamm
671c7791e3 Reorganize EnclosingHandlers to require less changes to the frontend and allow us to
implement the synchronized storage class for functions.
2009-03-24 21:18:18 +01:00
Tomas Lindquist Olsen
8b751cce0e - Updated to DMD frontend 1.041.
- Removed dmd/inifile.c , it's not under a free license, replaced with libconfig based config file.
2009-03-12 20:37:27 +01:00
Frits van Bommel
ff354d59b2 Use stringstream in asm generation instead of OutBuffer.
Besides looking better, this should reduce allocations and copying.
2009-03-12 14:08:57 +01:00
Frits van Bommel
c1bd2234a9 Clean up asm code a bit.
- Use vector instead of Array, reducing allocations.
 - Use vectors instead of deques since we only push_back and index.
 - Remove redundant typedefs of iterators.
 - Comment out unused variable (used only in commented-out GDC code).
 - A few whitespace changes.
2009-03-12 14:08:57 +01:00
Frits van Bommel
2687d58198 Always pass an address expression (not a var expression) to asm operands of
type Arg_Memory.

This fixes the following code:
{{{
  void f(real x) { asm { fld x[RBP];      } }
  void g(int x)  { asm { mov EAX, x[RBP]; } }
}}}
2009-03-08 00:57:58 +01:00
Tomas Lindquist Olsen
bb495c6e40 remove memory clobber again ... 2009-03-03 19:27:23 +01:00
Tomas Lindquist Olsen
ae214b18e7 Added ~{memory} clobber when a jump_target is generated in inline asm (branch out of inline asm) 2009-03-03 19:18:47 +01:00
Frits van Bommel
695fc3f5c3 Fix some -vv output 2009-02-26 14:51:05 +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
8ce2c9773e Clean up the code generated when jumping out of inline asm and make label names more expressive. 2009-02-18 22:50:22 +01:00