[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)
Doug Wyatt via cfe-commits
cfe-commits at lists.llvm.org
Sat May 4 13:55:07 PDT 2024
================
@@ -3649,6 +3649,25 @@ FunctionProtoType::FunctionProtoType(QualType result, ArrayRef<QualType> params,
auto &EllipsisLoc = *getTrailingObjects<SourceLocation>();
EllipsisLoc = epi.EllipsisLoc;
}
+
+ if (!epi.FunctionEffects.empty()) {
+ auto &ExtraBits = *getTrailingObjects<FunctionTypeExtraBitfields>();
+ // TODO: bitfield overflow?
+ ExtraBits.NumFunctionEffects = epi.FunctionEffects.size();
+
+ ArrayRef<FunctionEffect> SrcFX = epi.FunctionEffects.effects();
+ auto *DestFX = getTrailingObjects<FunctionEffect>();
+ std::copy(SrcFX.begin(), SrcFX.end(), DestFX);
+
+ ArrayRef<FunctionEffectCondition> SrcConds =
+ epi.FunctionEffects.conditions();
+ if (!SrcConds.empty()) {
+ ExtraBits.EffectsHaveConditions = true;
+ auto *DestConds = getTrailingObjects<FunctionEffectCondition>();
+ std::copy(SrcConds.begin(), SrcConds.end(), DestConds);
+ addDependence(TypeDependence::DependentInstantiation);
----------------
dougsonos wrote:
done
https://github.com/llvm/llvm-project/pull/84983
More information about the cfe-commits
mailing list