liushuyu
fc4d884d2d
Multiple changes ...
...
* Use getVoidPtrType helper
* Replace #define with constexpr
2024-03-26 14:48:36 -06:00
liushuyu
b8a96faf92
tree-wide: port LDC to LLVM 18
2024-03-26 14:45:35 -06:00
Martin Kinkelin
ef72dedd7c
Refactor away LDC-specific FuncDeclaration::intrinsicName ( #4595 )
...
Using `mangleOverride` directly instead. Also get rid of superfluous
string copies. And for LLVMatomic_rmw, don't store the operation
string in the instantiated FuncDeclarations anymore, but fetch it
from the parent TemplateDeclaration.
2024-03-21 16:50:06 +01:00
Martin Kinkelin
bb2dec2f87
Adapt to free arrayOf(Type*) function
2024-03-03 22:12:16 +01:00
Martin Kinkelin
9041c0bf67
Adapt to free functions in dmd
C++ namespace now
2024-03-03 19:14:00 +01:00
Martin Kinkelin
b06beb049a
Handle invalid orderings for fence intrinsic
...
By not emitting any IR instruction, like clang.
2024-01-19 02:29:21 +01:00
Martin Kinkelin
d6d79187e6
Merge fix: Adapt to removed error/warning members
2023-11-06 01:10:16 +01:00
Martin Kinkelin
9b50726ae2
Fix multiple va_start calls in a single extern(D) function
...
This is supposed to work (verified via clang), and we need to properly
va_copy the implicit _argptr, so that each resulting `ap` is independent.
Fixes a new subtest in dmd-testsuite's runnable/variadic.d on Posix
x86_64.
2023-08-30 16:08:13 +02:00
Martin Kinkelin
87b22436e4
Fix function pointers/delegates on Harvard architectures
...
Resolves issue #4432 by setting the address space of such IR pointers.
2023-08-05 12:21:50 +02:00
Martin Kinkelin
69d636a15a
Remove legacy LLCallBasePtr
2023-07-29 02:09:35 +02:00
Martin Kinkelin
5d3ded9eeb
Remove legacy LL[Maybe]Align
2023-07-29 02:09:35 +02:00
Johan Engelen
338f352bdb
Add ldc.attributes.callingConvention("...") ( #4299 )
...
Add ldc.attributes.callingConvention("...")
2023-01-19 22:44:19 +01:00
Nicholas Wilson
906037988f
Move abi*.*
to abi/
( #4192 )
2022-09-21 13:16:04 +00:00
Nicholas Wilson
af51b700be
Rename DtoAggrPaint
to DtoSlicePaint
( #4174 )
...
It only does two elements and is exclusively used for slices
2022-09-15 20:44:28 +08:00
Nicholas Wilson
2476641551
Remove unused variable from ImplicitArgumentsBuilder
( #4166 )
2022-09-14 15:10:55 +08:00
Nicholas Wilson
5c789fa209
Remove getContainedType
from ImplicitArgumentsBuilder
( #4164 )
2022-09-14 09:29:28 +08:00
Nicholas Wilson
4c7a714b4b
Remove getContainedType
in DtoMemCpy
( #4162 )
2022-09-14 08:36:24 +08:00
Nicholas Wilson
f5318a4494
Remove getContainedType
in tocall.cpp
( #4153 )
2022-09-13 20:08:22 +08:00
Nicholas Wilson
86a44ce36b
Rework DtoCallable
to remove getPointerElementType
( #4041 )
2022-09-03 08:06:02 +08:00
Nicholas Wilson
404a5021cc
Use typed gep in tocallcpp
( #4095 )
2022-09-02 18:09:14 +08:00
Nicholas Wilson
634a301d0f
Use typed loads in tocall.cpp
( #4053 )
2022-08-28 14:32:58 +08:00
Nicholas Wilson
602a0512a0
Remove getPointeeType
from tocall.cpp
( #4033 )
2022-08-21 14:46:32 +08:00
Nicholas Wilson
f0a3abf1dc
Remove getPointeeType
from DtoVolatileLoad ( #4024 )
2022-08-20 05:23:17 +00:00
Martin Kinkelin
bdef01e7cc
Raise min LLVM version to 9.0
2022-04-25 23:11:48 +02:00
Martin Kinkelin
8527b3f9c8
Work around llvm::PointerType::getElementType() being deprecated in LLVM 14
2022-03-30 19:53:47 +02:00
Martin Kinkelin
143d7b3171
Fix compile & link errors against LLVM 14
2022-03-30 13:51:18 +02:00
Nicholas Wilson
4349388563
Prepare for LLVM15: Headers, attributes ( #3936 )
...
`llvm::AttrBuilder` was changed to require an LLVMContext in its constructor, and can no longer be copied.
declare `DEBIG_TYPE` after includes for the GC2Stack pass as `llvm/Support/GenericDomTreeConstruction.h `(included from `llvm/IR/Dominators.h` `#define`s and `#undef`s it.
`llvm::DIBuilder::createExpression` now takes an `ArrayRef<uint64_t>` instead of `int64_t`. EmitLocalVariable has similarly changed
2022-03-11 16:38:49 +01:00
Martin Kinkelin
0fd5c6ec16
Merge pull request #3873 from kinke/no_reverse
...
Don't reverse parameters order for extern(D)
2022-03-08 17:03:17 +01:00
Martin Kinkelin
7b6810b01b
Fix LLVM 13 deprecation messages during build
2022-02-26 19:15:46 +01:00
Martin Kinkelin
dc25da9557
ABI: Handle extern(C++) delegates for 32-bit MSVC with __thiscall convention
2022-02-22 14:48:38 +01:00
Martin Kinkelin
5a2f3ed87f
Upgrade frontend & libs to v2.099.0-beta.1+ ( dlang/dmd@1c31d85613 )
2022-02-16 20:52:07 +01:00
Martin Kinkelin
5aed4b6728
ImportC: Add support for __builtin_va_{start,copy,end}
...
Fixes dmd-testsuite's runnable/test22597.c.
2021-12-21 04:07:06 +01:00
Martin Kinkelin
efa4189483
Keep default alignment for atomic instructions, for LLVM 13+ too ( #3859 )
2021-10-24 23:34:15 +00:00
Martin Kinkelin
019e9c8e30
Add support for LLVM 13
2021-10-11 19:20:15 +02:00
Nicholas Wilson
1568d0cdca
Fix compilation with LLVM 14 ( #3822 )
2021-09-17 16:41:49 +02:00
Martin Kinkelin
369cfd13ce
Adapt to TY enum class
2021-09-07 16:51:19 +02:00
Martin Kinkelin
3cdd5b58cb
LLVM 12: Add type information to sret and byval parameter attributes
...
This fixes the failing bitcode writer assertions.
2021-04-27 23:48:26 +02:00
Martin Kinkelin
693e764787
Treat temporaries as rvalue expressions when ABI-rewriting function call arguments
...
Thus preventing bitcopies for IndirectByvalRewrite, passing the
temporary directly by ref instead.
This fixes druntime's stdcpp-memory test.
2021-04-04 18:46:11 +02:00
Martin Kinkelin
d3574b9835
DtoTypeInfoOf(): Make Loc param mandatory and move to 1st position
2020-12-13 15:15:37 +01:00
Martin Kinkelin
a9aafac862
Glue layer: Make all mutable Loc &
params const
2020-12-13 15:01:19 +01:00
DaveP1776
3f9d05ac16
Fix missing location information for error reporting of TypeInfo in betterC
...
This fixes an issue where any instantiation of TypeInfo in the final
output would lead to a cryptic error with no file or line information.
This change brings ldc in line with dmd's reporting of the same error,
which at least gives file and line information to discover the problem.
2020-12-12 22:41:21 -05:00
Martin Kinkelin
3f716ff75e
Refactoring: Introduce getIrType()
...
As *the* way to access the IrType associated with a Type via its `ctype`
field. Most importantly, it makes sure all access is redirected to the
*unqualified* type's `ctype`, which allows to get rid of the 'multiple
types' workaround for aggregates in DtoType(). Those were e.g. hit for
`shared struct SpinLock`, where the struct's type includes the `shared`
modifier...
2020-11-13 15:43:18 +01:00
Martin Kinkelin
6f5730049b
Merge remote-tracking branch 'origin/master' into merge-2.094
...
Conflicts:
gen/tocall.cpp
runtime/phobos
2020-09-30 19:46:43 +02:00
Martin Kinkelin
7544a97475
Fix LLVM < 8 compatibility (no llvm::CallBase)
2020-09-26 01:04:50 +02:00
Martin Kinkelin
96b9cde428
Add support for LLVM 11
...
One major change is the removal of llvm::CallSite, which I've replaced
by llvm::CallBase*.
2020-09-26 01:04:50 +02:00
Martin Kinkelin
f202c851ae
Upgrade frontend & libs to v2.094.0-beta.1
2020-09-22 00:06:19 +02:00
Martin Kinkelin
834f666ce5
Raise min LLVM version to 6.0 ( #3493 )
2020-07-13 20:42:50 +02:00
Martin Kinkelin
4ac7f0554b
Adapt to frontend refactorings
2019-12-22 16:29:45 +01:00
Martin Kinkelin
80b196f4b5
Extend llvm_atomic_cmp_xchg by isWeak and separate failure ordering
2019-11-14 23:59:35 +01:00
Martin Kinkelin
8219db181c
Make llvm_atomic_cmp_xchg signature match LLVM's
2019-11-14 23:58:52 +01:00