mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-07 19:36:06 +03:00
Rename ExplicitByvalRewrite to IndirectByvalRewrite
This commit is contained in:
parent
8faab8b684
commit
5d8b581025
4 changed files with 10 additions and 10 deletions
|
@ -173,22 +173,22 @@ struct IntegerRewrite : ABIRewrite {
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Implements explicit ByVal semantics defined like this:
|
||||
* Implements indirect high-level-by-value semantics defined like this:
|
||||
* Instead of passing a copy of the original argument directly to the callee,
|
||||
* the caller makes a bitcopy on its stack first and then passes a pointer to
|
||||
* that copy to the callee.
|
||||
* The pointer is passed as regular parameter and hence occupies either a
|
||||
* register or a function parameters stack slot.
|
||||
*
|
||||
* This differs from LLVM's ByVal attribute for pointer parameters.
|
||||
* The ByVal attribute instructs LLVM to pass the pointed-to argument directly
|
||||
* as a copy on the function parameters stack. In this case, there's no need to
|
||||
* pass an explicit pointer; the address is implicit.
|
||||
* This differs from LLVM's byval attribute for pointer parameters.
|
||||
* The byval attribute instructs LLVM to bitcopy the IR argument pointee onto
|
||||
* the callee parameters stack. The callee's IR parameter is an implicit pointer
|
||||
* to that private copy.
|
||||
*/
|
||||
struct ExplicitByvalRewrite : ABIRewrite {
|
||||
struct IndirectByvalRewrite : ABIRewrite {
|
||||
const unsigned minAlignment;
|
||||
|
||||
explicit ExplicitByvalRewrite(unsigned minAlignment = 16)
|
||||
explicit IndirectByvalRewrite(unsigned minAlignment = 16)
|
||||
: minAlignment(minAlignment) {}
|
||||
|
||||
LLValue *put(DValue *v, bool) override {
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
struct Win64TargetABI : TargetABI {
|
||||
private:
|
||||
const bool isMSVC;
|
||||
ExplicitByvalRewrite byvalRewrite;
|
||||
IndirectByvalRewrite byvalRewrite;
|
||||
IntegerRewrite integerRewrite;
|
||||
|
||||
bool isX87(Type *t) const {
|
||||
|
|
|
@ -1066,7 +1066,7 @@ void ldc::DIBuilder::EmitLocalVariable(llvm::Value *ll, VarDeclaration *vd,
|
|||
|
||||
const bool isRefOrOut = vd->isRef() || vd->isOut(); // incl. special-ref vars
|
||||
|
||||
// For MSVC x64 targets, declare params rewritten by ExplicitByvalRewrite as
|
||||
// For MSVC x64 targets, declare params rewritten by IndirectByvalRewrite as
|
||||
// DI references, as if they were ref parameters.
|
||||
const bool isPassedExplicitlyByval =
|
||||
isTargetMSVCx64 && !isRefOrOut && isaArgument(ll) && addr.empty();
|
||||
|
|
|
@ -388,7 +388,7 @@ static void DtoCreateNestedContextType(FuncDeclaration *fd) {
|
|||
} else if (vd->isParameter() && (vd->storage_class & STClazy)) {
|
||||
// The LL type is a delegate (LL struct).
|
||||
// Depending on the used TargetABI, the LL parameter is either a struct or
|
||||
// a pointer to a struct (`byval` attribute, ExplicitByvalRewrite).
|
||||
// a pointer to a struct (`byval` attribute, IndirectByvalRewrite).
|
||||
t = getIrParameter(vd)->value->getType();
|
||||
if (t->isPointerTy())
|
||||
t = t->getPointerElementType();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue