uda.cpp (ldc-1.32.1) | : | uda.cpp (ldc-1.32.2) | ||
---|---|---|---|---|
skipping to change at line 574 | skipping to change at line 574 | |||
applyAttrLLVMFastMathFlag(sle, irFunc); | applyAttrLLVMFastMathFlag(sle, irFunc); | |||
} else if (ident == Id::udaOptStrategy) { | } else if (ident == Id::udaOptStrategy) { | |||
applyAttrOptStrategy(sle, irFunc); | applyAttrOptStrategy(sle, irFunc); | |||
} else if (ident == Id::udaSection) { | } else if (ident == Id::udaSection) { | |||
applyAttrSection(sle, func); | applyAttrSection(sle, func); | |||
} else if (ident == Id::udaTarget) { | } else if (ident == Id::udaTarget) { | |||
applyAttrTarget(sle, func, irFunc); | applyAttrTarget(sle, func, irFunc); | |||
} else if (ident == Id::udaAssumeUsed) { | } else if (ident == Id::udaAssumeUsed) { | |||
applyAttrAssumeUsed(*gIR, sle, func); | applyAttrAssumeUsed(*gIR, sle, func); | |||
} else if (ident == Id::udaWeak || ident == Id::udaKernel || | } else if (ident == Id::udaWeak || ident == Id::udaKernel || | |||
ident == Id::udaNoSanitize || ident==Id::udaCallingConvention) | ident == Id::udaNoSanitize || | |||
{ | ident == Id::udaCallingConvention || | |||
ident == Id::udaNoSplitStack) { | ||||
// These UDAs are applied elsewhere, thus should silently be ignored her e. | // These UDAs are applied elsewhere, thus should silently be ignored her e. | |||
} else if (ident == Id::udaDynamicCompile) { | } else if (ident == Id::udaDynamicCompile) { | |||
irFunc->dynamicCompile = true; | irFunc->dynamicCompile = true; | |||
} else if (ident == Id::udaDynamicCompileEmit) { | } else if (ident == Id::udaDynamicCompileEmit) { | |||
irFunc->dynamicCompileEmit = true; | irFunc->dynamicCompileEmit = true; | |||
} else if (ident == Id::udaDynamicCompileConst) { | } else if (ident == Id::udaDynamicCompileConst) { | |||
sle->error( | sle->error( | |||
"Special attribute `ldc.attributes.%s` is only valid for variables", | "Special attribute `ldc.attributes.%s` is only valid for variables", | |||
ident->toChars()); | ident->toChars()); | |||
} else { | } else { | |||
skipping to change at line 685 | skipping to change at line 687 | |||
if (!sym->isFuncDeclaration() && | if (!sym->isFuncDeclaration() && | |||
hasComputeAttr(sym->getModule()) != DComputeCompileFor::hostOnly) { | hasComputeAttr(sym->getModule()) != DComputeCompileFor::hostOnly) { | |||
sym->error("`@ldc.dcompute.kernel` can only be applied to functions" | sym->error("`@ldc.dcompute.kernel` can only be applied to functions" | |||
" in modules marked `@ldc.dcompute.compute`"); | " in modules marked `@ldc.dcompute.compute`"); | |||
} | } | |||
return true; | return true; | |||
} | } | |||
/// Check whether `fd` has the `@ldc.attributes.noSplitStack` UDA applied. | ||||
bool hasNoSplitStackUDA(FuncDeclaration *fd) { | ||||
auto sle = getMagicAttribute(fd, Id::udaNoSplitStack, Id::attributes); | ||||
return sle != nullptr; | ||||
} | ||||
/// Creates a mask (for &) of @ldc.attributes.noSanitize UDA applied to the | /// Creates a mask (for &) of @ldc.attributes.noSanitize UDA applied to the | |||
/// function. | /// function. | |||
/// If a bit is set in the mask, then the sanitizer is enabled. | /// If a bit is set in the mask, then the sanitizer is enabled. | |||
/// If a bit is not set in the mask, then the sanitizer is explicitly disabled | /// If a bit is not set in the mask, then the sanitizer is explicitly disabled | |||
/// by @noSanitize. | /// by @noSanitize. | |||
unsigned getMaskFromNoSanitizeUDA(FuncDeclaration &fd) { | unsigned getMaskFromNoSanitizeUDA(FuncDeclaration &fd) { | |||
opts::SanitizerBits inverse_mask = opts::NoneSanitizer; | opts::SanitizerBits inverse_mask = opts::NoneSanitizer; | |||
callForEachMagicAttribute(fd, Id::udaNoSanitize, Id::attributes, | callForEachMagicAttribute(fd, Id::udaNoSanitize, Id::attributes, | |||
[&inverse_mask](StructLiteralExp *sle) { | [&inverse_mask](StructLiteralExp *sle) { | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 9 lines changed or added |