From 842a6a889820bf966cb6048a0b6f6fd2c2c2c900 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 29 Apr 2020 09:53:48 -0700 Subject: [PATCH] Added Obsolete support for moved collections --- BeefLibs/corlib/src/Collections/BinaryHeap.bf | 6 ++ BeefLibs/corlib/src/Collections/Dictionary.bf | 6 ++ BeefLibs/corlib/src/Collections/HashSet.bf | 6 ++ .../corlib/src/Collections/KeyValuePair.bf | 6 ++ BeefLibs/corlib/src/Collections/List.bf | 6 ++ BeefLibs/corlib/src/Collections/Queue.bf | 6 ++ BeefLibs/corlib/src/Collections/Sorter.bf | 6 ++ IDE/mintest/minlib/src/System/Attribute.bf | 9 +- .../minlib/src/System/Collections/List.bf | 6 ++ IDEHelper/Compiler/BfCompiler.cpp | 28 ++++++ IDEHelper/Compiler/BfCompiler.h | 1 + IDEHelper/Compiler/BfExprEvaluator.cpp | 73 +------------- IDEHelper/Compiler/BfModule.cpp | 95 ++++++++++++++++++- IDEHelper/Compiler/BfModule.h | 1 + IDEHelper/Compiler/BfModuleTypeUtils.cpp | 28 +++++- IDEHelper/Compiler/BfResolvedTypeUtils.h | 58 +++++------ 16 files changed, 232 insertions(+), 109 deletions(-) diff --git a/BeefLibs/corlib/src/Collections/BinaryHeap.bf b/BeefLibs/corlib/src/Collections/BinaryHeap.bf index fe5a7a44..ecb47e21 100644 --- a/BeefLibs/corlib/src/Collections/BinaryHeap.bf +++ b/BeefLibs/corlib/src/Collections/BinaryHeap.bf @@ -116,3 +116,9 @@ namespace System.Collections } } } + +namespace System.Collections.Generic +{ + [Obsolete("The System.Collections.Generic types have been moved into System.Collections", false)] + typealias BinaryHeap = System.Collections.BinaryHeap; +} diff --git a/BeefLibs/corlib/src/Collections/Dictionary.bf b/BeefLibs/corlib/src/Collections/Dictionary.bf index 67ee05d4..0bfec1f8 100644 --- a/BeefLibs/corlib/src/Collections/Dictionary.bf +++ b/BeefLibs/corlib/src/Collections/Dictionary.bf @@ -940,3 +940,9 @@ namespace System.Collections } } } + +namespace System.Collections.Generic +{ + [Obsolete("The System.Collections.Generic types have been moved into System.Collections", false)] + typealias Dictionary = System.Collections.Dictionary; +} diff --git a/BeefLibs/corlib/src/Collections/HashSet.bf b/BeefLibs/corlib/src/Collections/HashSet.bf index a9c3d00f..b5216f1f 100644 --- a/BeefLibs/corlib/src/Collections/HashSet.bf +++ b/BeefLibs/corlib/src/Collections/HashSet.bf @@ -1164,3 +1164,9 @@ namespace System.Collections } } } + +namespace System.Collections.Generic +{ + [Obsolete("The System.Collections.Generic types have been moved into System.Collections", false)] + typealias HashSet = System.Collections.HashSet; +} diff --git a/BeefLibs/corlib/src/Collections/KeyValuePair.bf b/BeefLibs/corlib/src/Collections/KeyValuePair.bf index 094cda37..e2c1133b 100644 --- a/BeefLibs/corlib/src/Collections/KeyValuePair.bf +++ b/BeefLibs/corlib/src/Collections/KeyValuePair.bf @@ -37,3 +37,9 @@ namespace System.Collections } } } + +namespace System.Collections.Generic +{ + [Obsolete("The System.Collections.Generic types have been moved into System.Collections", false)] + typealias KeyValuePair = System.Collections.KeyValuePair; +} diff --git a/BeefLibs/corlib/src/Collections/List.bf b/BeefLibs/corlib/src/Collections/List.bf index 145cfc90..3bcc165c 100644 --- a/BeefLibs/corlib/src/Collections/List.bf +++ b/BeefLibs/corlib/src/Collections/List.bf @@ -798,3 +798,9 @@ namespace System.Collections }*/ } } + +namespace System.Collections.Generic +{ + [Obsolete("The System.Collections.Generic types have been moved into System.Collections", false)] + typealias List = System.Collections.List; +} diff --git a/BeefLibs/corlib/src/Collections/Queue.bf b/BeefLibs/corlib/src/Collections/Queue.bf index fdd5b260..005ae687 100644 --- a/BeefLibs/corlib/src/Collections/Queue.bf +++ b/BeefLibs/corlib/src/Collections/Queue.bf @@ -460,3 +460,9 @@ namespace System.Collections } } } + +namespace System.Collections.Generic +{ + [Obsolete("The System.Collections.Generic types have been moved into System.Collections", false)] + typealias Queue = System.Collections.Queue; +} diff --git a/BeefLibs/corlib/src/Collections/Sorter.bf b/BeefLibs/corlib/src/Collections/Sorter.bf index 68d4248a..654cc94f 100644 --- a/BeefLibs/corlib/src/Collections/Sorter.bf +++ b/BeefLibs/corlib/src/Collections/Sorter.bf @@ -299,3 +299,9 @@ namespace System.Collections } } } + +namespace System.Collections.Generic +{ + [Obsolete("The System.Collections.Generic types have been moved into System.Collections", false)] + typealias Sorter = System.Collections.Sorter; +} diff --git a/IDE/mintest/minlib/src/System/Attribute.bf b/IDE/mintest/minlib/src/System/Attribute.bf index d871c801..e707db15 100644 --- a/IDE/mintest/minlib/src/System/Attribute.bf +++ b/IDE/mintest/minlib/src/System/Attribute.bf @@ -27,11 +27,12 @@ namespace System MemberAccess = 0x20000, Alloc = 0x40000, Delete = 0x80000, + Alias = 0x100000, All = Assembly | Module | Class | Struct | Enum | Constructor | Method | Property | Field | StaticField | Interface | Parameter | Delegate | Function | ReturnValue | GenericParameter | Invocation | MemberAccess | - Alloc | Delete, + Alloc | Delete | Alias, } public enum ReflectKind @@ -350,7 +351,7 @@ namespace System { } - [AttributeUsage(.Method | .Constructor)] + [AttributeUsage(.Method | .Constructor | .Class | .Struct | .Alias)] public struct ObsoleteAttribute : Attribute { public this(bool isError) @@ -370,7 +371,7 @@ namespace System } - [AttributeUsage(.Method | .Constructor)] + [AttributeUsage(.Method | .Constructor | .Class | .Struct | .Alias)] public struct ErrorAttribute : Attribute { public this(String error) @@ -379,7 +380,7 @@ namespace System } } - [AttributeUsage(.Method | .Constructor)] + [AttributeUsage(.Method | .Constructor | .Class | .Struct | .Alias)] public struct WarnAttribute : Attribute { public this(String error) diff --git a/IDE/mintest/minlib/src/System/Collections/List.bf b/IDE/mintest/minlib/src/System/Collections/List.bf index 1d7c649a..c962f820 100644 --- a/IDE/mintest/minlib/src/System/Collections/List.bf +++ b/IDE/mintest/minlib/src/System/Collections/List.bf @@ -654,3 +654,9 @@ namespace System.Collections } } } + +namespace System.Collections.Generic +{ + [Obsolete("The System.Collections.Generic containers have been moved into System.Collections", false)] + typealias List = System.Collections.List; +} diff --git a/IDEHelper/Compiler/BfCompiler.cpp b/IDEHelper/Compiler/BfCompiler.cpp index 3e51efd0..634e09ab 100644 --- a/IDEHelper/Compiler/BfCompiler.cpp +++ b/IDEHelper/Compiler/BfCompiler.cpp @@ -4623,6 +4623,16 @@ void BfCompiler::MarkStringPool(BfModule* module) MarkStringPool(specModulePair.mValue); } +void BfCompiler::MarkStringPool(BfIRConstHolder* constHolder, BfIRValue irValue) +{ + auto constant = constHolder->GetConstant(irValue); + if ((constant != NULL) && (constant->mTypeCode == BfTypeCode_StringId)) + { + BfStringPoolEntry& stringPoolEntry = mContext->mStringObjectIdMap[constant->mInt32]; + stringPoolEntry.mLastUsedRevision = mRevision; + } +} + void BfCompiler::ClearUnusedStringPoolEntries() { BF_ASSERT(!IsHotCompile()); @@ -4630,6 +4640,24 @@ void BfCompiler::ClearUnusedStringPoolEntries() for (auto module : mContext->mModules) { MarkStringPool(module); + } + + for (auto type : mContext->mResolvedTypes) + { + auto typeInstance = type->ToTypeInstance(); + if (typeInstance == NULL) + continue; + if (typeInstance->mCustomAttributes == NULL) + continue; + for (auto& attribute : typeInstance->mCustomAttributes->mAttributes) + { + for (auto arg : attribute.mCtorArgs) + MarkStringPool(typeInstance->mConstHolder, arg); + for (auto setValue : attribute.mSetProperties) + MarkStringPool(typeInstance->mConstHolder, setValue.mParam.mValue); + for (auto setValue : attribute.mSetField) + MarkStringPool(typeInstance->mConstHolder, setValue.mParam.mValue); + } } for (auto itr = mContext->mStringObjectIdMap.begin(); itr != mContext->mStringObjectIdMap.end(); ) diff --git a/IDEHelper/Compiler/BfCompiler.h b/IDEHelper/Compiler/BfCompiler.h index 1384b02f..2a8d6431 100644 --- a/IDEHelper/Compiler/BfCompiler.h +++ b/IDEHelper/Compiler/BfCompiler.h @@ -437,6 +437,7 @@ public: BfTypeDef* GetArrayTypeDef(int dimensions); void GenerateAutocompleteInfo(); void MarkStringPool(BfModule* module); + void MarkStringPool(BfIRConstHolder* constHolder, BfIRValue irValue); void ClearUnusedStringPoolEntries(); void ClearBuildCache(); int GetDynCastVDataCount(); diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 6684f069..58cd19c2 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -4134,77 +4134,8 @@ void BfExprEvaluator::ResolveArgValues(BfResolvedArgs& resolvedArgs, BfResolveAr void BfExprEvaluator::PerformCallChecks(BfMethodInstance* methodInstance, BfAstNode* targetSrc) { BfCustomAttributes* customAttributes = methodInstance->GetCustomAttributes(); - if (customAttributes != NULL) - { - auto _AddMethodDeclarationMoreInfo = [&]() - { - if (methodInstance->mMethodDef->mMethodDeclaration != NULL) - mModule->mCompiler->mPassInstance->MoreInfo( - StrFormat("See method declaration '%s'", mModule->MethodToString(methodInstance).c_str()), - methodInstance->mMethodDef->GetRefNode()); - }; - - BfIRConstHolder* constHolder = methodInstance->GetOwner()->mConstHolder; - auto customAttribute = customAttributes->Get(mModule->mCompiler->mObsoleteAttributeTypeDef); - if ((customAttribute != NULL) && (!customAttribute->mCtorArgs.IsEmpty())) - { - String err; - err = StrFormat("'%s' is obsolete", mModule->MethodToString(methodInstance).c_str()); - - bool isError = false; - - auto constant = constHolder->GetConstant(customAttribute->mCtorArgs[0]); - if (constant->mTypeCode == BfTypeCode_Boolean) - { - isError = constant->mBool; - } - else if (customAttribute->mCtorArgs.size() >= 2) - { - String* str = mModule->GetStringPoolString(customAttribute->mCtorArgs[0], constHolder); - if (str != NULL) - { - err += ":\n '"; - err += *str; - err += "'"; - } - - constant = constHolder->GetConstant(customAttribute->mCtorArgs[1]); - isError = constant->mBool; - } - - BfError* error = NULL; - if (isError) - error = mModule->Fail(err, targetSrc); - else - error = mModule->Warn(0, err, targetSrc); - if (error != NULL) - _AddMethodDeclarationMoreInfo(); - } - - customAttribute = customAttributes->Get(mModule->mCompiler->mErrorAttributeTypeDef); - if ((customAttribute != NULL) && (!customAttribute->mCtorArgs.IsEmpty())) - { - String err = StrFormat("Method error: '", mModule->MethodToString(methodInstance).c_str()); - String* str = mModule->GetStringPoolString(customAttribute->mCtorArgs[0], constHolder); - if (str != NULL) - err += *str; - err += "'"; - if (mModule->Fail(err, targetSrc) != NULL) - _AddMethodDeclarationMoreInfo(); - } - - customAttribute = customAttributes->Get(mModule->mCompiler->mWarnAttributeTypeDef); - if ((customAttribute != NULL) && (!customAttribute->mCtorArgs.IsEmpty())) - { - String err = StrFormat("Method warning: '", mModule->MethodToString(methodInstance).c_str()); - String* str = mModule->GetStringPoolString(customAttribute->mCtorArgs[0], constHolder); - if (str != NULL) - err += *str; - err += "'"; - if (mModule->Warn(0, err, targetSrc) != NULL) - _AddMethodDeclarationMoreInfo(); - } - } + if (customAttributes != NULL) + mModule->CheckErrorAttributes(methodInstance->GetOwner(), methodInstance, customAttributes, targetSrc); } BfTypedValue BfExprEvaluator::CreateCall(BfMethodInstance* methodInstance, BfIRValue func, bool bypassVirtual, SizedArrayImpl& irArgs, BfTypedValue* sret, bool isTailCall) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 8120bdac..b7827aa3 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -1557,7 +1557,7 @@ String* BfModule::GetStringPoolString(BfIRValue constantStr, BfIRConstHolder * c { auto& entry = mContext->mStringObjectIdMap[strId]; return &entry.mString; - } + } return NULL; } @@ -2747,6 +2747,98 @@ BfError* BfModule::Warn(int warningNum, const StringImpl& warning, BfAstNode* re return bfError; } +void BfModule::CheckErrorAttributes(BfTypeInstance* typeInstance, BfMethodInstance* methodInstance, BfCustomAttributes* customAttributes, BfAstNode* targetSrc) +{ + auto _AddDeclarationMoreInfo = [&]() + { + if (methodInstance != NULL) + { + if (methodInstance->mMethodDef->mMethodDeclaration != NULL) + mCompiler->mPassInstance->MoreInfo( + StrFormat("See method declaration '%s'", MethodToString(methodInstance).c_str()), + methodInstance->mMethodDef->GetRefNode()); + } + else + { + mCompiler->mPassInstance->MoreInfo( + StrFormat("See type declaration '%s'", TypeToString(typeInstance, BfTypeNameFlag_UseUnspecializedGenericParamNames).c_str()), + typeInstance->mTypeDef->GetRefNode()); + } + }; + + BfIRConstHolder* constHolder = typeInstance->mConstHolder; + auto customAttribute = customAttributes->Get(mCompiler->mObsoleteAttributeTypeDef); + if ((customAttribute != NULL) && (!customAttribute->mCtorArgs.IsEmpty())) + { + String err; + if (methodInstance != NULL) + err = StrFormat("'%s' is obsolete", MethodToString(methodInstance).c_str()); + else + err = StrFormat("'%s' is obsolete", TypeToString(typeInstance, BfTypeNameFlag_UseUnspecializedGenericParamNames).c_str()); + + bool isError = false; + + auto constant = constHolder->GetConstant(customAttribute->mCtorArgs[0]); + if (constant->mTypeCode == BfTypeCode_Boolean) + { + isError = constant->mBool; + } + else if (customAttribute->mCtorArgs.size() >= 2) + { + String* str = GetStringPoolString(customAttribute->mCtorArgs[0], constHolder); + if (str != NULL) + { + err += ":\n '"; + err += *str; + err += "'"; + } + + constant = constHolder->GetConstant(customAttribute->mCtorArgs[1]); + isError = constant->mBool; + } + + BfError* error = NULL; + if (isError) + error = Fail(err, targetSrc); + else + error = Warn(0, err, targetSrc); + if (error != NULL) + _AddDeclarationMoreInfo(); + } + + customAttribute = customAttributes->Get(mCompiler->mErrorAttributeTypeDef); + if ((customAttribute != NULL) && (!customAttribute->mCtorArgs.IsEmpty())) + { + String err; + if (methodInstance != NULL) + StrFormat("Method error: '", MethodToString(methodInstance).c_str()); + else + StrFormat("Type error: '", TypeToString(typeInstance, BfTypeNameFlag_UseUnspecializedGenericParamNames).c_str()); + String* str = GetStringPoolString(customAttribute->mCtorArgs[0], constHolder); + if (str != NULL) + err += *str; + err += "'"; + if (Fail(err, targetSrc) != NULL) + _AddDeclarationMoreInfo(); + } + + customAttribute = customAttributes->Get(mCompiler->mWarnAttributeTypeDef); + if ((customAttribute != NULL) && (!customAttribute->mCtorArgs.IsEmpty())) + { + String err; + if (methodInstance != NULL) + StrFormat("Method warning: '", MethodToString(methodInstance).c_str()); + else + StrFormat("Type warning: '", TypeToString(typeInstance, BfTypeNameFlag_UseUnspecializedGenericParamNames).c_str()); + String* str = GetStringPoolString(customAttribute->mCtorArgs[0], constHolder); + if (str != NULL) + err += *str; + err += "'"; + if (Warn(0, err, targetSrc) != NULL) + _AddDeclarationMoreInfo(); + } +} + void BfModule::CheckRangeError(BfType* type, BfAstNode* refNode) { if (mBfIRBuilder->mOpFailed) @@ -9351,6 +9443,7 @@ static String GetAttributesTargetListString(BfAttributeTargets attrTarget) AddAttributeTargetName(flagsLeft, BfAttributeTargets_Invocation, resultStr, "invocations"); AddAttributeTargetName(flagsLeft, BfAttributeTargets_MemberAccess, resultStr, "member access"); AddAttributeTargetName(flagsLeft, BfAttributeTargets_Alloc, resultStr, "allocations"); + AddAttributeTargetName(flagsLeft, BfAttributeTargets_Alias, resultStr, "aliases"); if (resultStr.IsEmpty()) return ""; return resultStr; diff --git a/IDEHelper/Compiler/BfModule.h b/IDEHelper/Compiler/BfModule.h index 300d0d6d..82f14cb2 100644 --- a/IDEHelper/Compiler/BfModule.h +++ b/IDEHelper/Compiler/BfModule.h @@ -1413,6 +1413,7 @@ public: BfError* FailInternal(const StringImpl& error, BfAstNode* refNode = NULL); BfError* FailAfter(const StringImpl& error, BfAstNode* refNode); BfError* Warn(int warningNum, const StringImpl& warning, BfAstNode* refNode = NULL, bool isPersistent = false); + void CheckErrorAttributes(BfTypeInstance* typeInstance, BfMethodInstance* methodInstance, BfCustomAttributes* customAttributes, BfAstNode* targetSrc); void CheckRangeError(BfType* type, BfAstNode* refNode); bool CheckCircularDataError(); BfFileInstance* GetFileFromNode(BfAstNode* astNode); diff --git a/IDEHelper/Compiler/BfModuleTypeUtils.cpp b/IDEHelper/Compiler/BfModuleTypeUtils.cpp index 9206d1f3..1f30b74e 100644 --- a/IDEHelper/Compiler/BfModuleTypeUtils.cpp +++ b/IDEHelper/Compiler/BfModuleTypeUtils.cpp @@ -949,6 +949,7 @@ bool BfModule::PopulateType(BfType* resolvedTypeRef, BfPopulateType populateType } resolvedTypeRef->mDefineState = BfTypeDefineState_DefinedAndMethodsSlotted; resolvedTypeRef->mRebuildFlags = BfTypeRebuildFlag_None; + typeAlias->mCustomAttributes = GetCustomAttributes(typeDef->mTypeDeclaration->mAttributes, BfAttributeTargets_Alias); return true; } @@ -6046,10 +6047,9 @@ BfType* BfModule::ResolveTypeResult(BfTypeReference* typeRef, BfType* resolvedTy } } - BfGenericTypeInstance* genericTypeInstance = NULL; - if (resolvedTypeRef != NULL) - genericTypeInstance = resolvedTypeRef->ToGenericTypeInstance(); - + BfTypeInstance* typeInstance = resolvedTypeRef->ToTypeInstance(); + BfGenericTypeInstance* genericTypeInstance = resolvedTypeRef->ToGenericTypeInstance(); + bool hadError = false; hadError = !PopulateType(resolvedTypeRef, populateType); @@ -6064,13 +6064,25 @@ BfType* BfModule::ResolveTypeResult(BfTypeReference* typeRef, BfType* resolvedTy if (populateType != BfPopulateType_IdentityNoRemapAlias) { while ((resolvedTypeRef != NULL) && (resolvedTypeRef->IsTypeAlias())) - { + { if (mCurTypeInstance != NULL) AddDependency(resolvedTypeRef, mCurTypeInstance, BfDependencyMap::DependencyFlag_NameReference); + if ((typeInstance->mCustomAttributes != NULL) && (!typeRef->IsTemporary())) + CheckErrorAttributes(typeInstance, NULL, typeInstance->mCustomAttributes, typeRef); resolvedTypeRef = resolvedTypeRef->GetUnderlyingType(); + if (resolvedTypeRef != NULL) + typeInstance = resolvedTypeRef->ToTypeInstance(); + else + typeInstance = NULL; } } + if (typeInstance != NULL) + { + if ((typeInstance->mCustomAttributes != NULL) && (!typeRef->IsTemporary())) + CheckErrorAttributes(typeInstance, NULL, typeInstance->mCustomAttributes, typeRef); + } + return resolvedTypeRef; } @@ -10416,6 +10428,12 @@ void BfModule::DoTypeToString(StringImpl& str, BfType* resolvedType, BfTypeNameF // We don't want the param names, just the commas (this is an unspecialized type reference) if (i > prevGenericParamCount) str += ','; + + if ((typeNameFlags & BfTypeNameFlag_UseUnspecializedGenericParamNames) != 0) + { + str += checkTypeDef->mGenericParamDefs[i]->mName; + } + continue; } } diff --git a/IDEHelper/Compiler/BfResolvedTypeUtils.h b/IDEHelper/Compiler/BfResolvedTypeUtils.h index fb9d55f4..21d129a2 100644 --- a/IDEHelper/Compiler/BfResolvedTypeUtils.h +++ b/IDEHelper/Compiler/BfResolvedTypeUtils.h @@ -20,14 +20,15 @@ enum BfTypeNameFlags : uint16 { BfTypeNameFlags_None = 0, BfTypeNameFlag_ResolveGenericParamNames = 1, - BfTypeNameFlag_OmitNamespace = 2, - BfTypeNameFlag_OmitOuterType = 4, - BfTypeNameFlag_ReduceName = 8, - BfTypeNameFlag_UseArrayImplType = 0x10, - BfTypeNameFlag_DisambiguateDups = 0x20, // Add a disambiguation if mDupDetectedRevision is set - BfTypeNameFlag_AddGlobalContainerName = 0x40, - BfTypeNameFlag_InternalName = 0x80, // Use special delimiters to remove ambiguities (ie: '+' for inner types) - BfTypeNameFlag_HideGlobalName = 0x100 + BfTypeNameFlag_UseUnspecializedGenericParamNames = 2, + BfTypeNameFlag_OmitNamespace = 4, + BfTypeNameFlag_OmitOuterType = 8, + BfTypeNameFlag_ReduceName = 0x10, + BfTypeNameFlag_UseArrayImplType = 0x20, + BfTypeNameFlag_DisambiguateDups = 0x40, // Add a disambiguation if mDupDetectedRevision is set + BfTypeNameFlag_AddGlobalContainerName = 0x80, + BfTypeNameFlag_InternalName = 0x100, // Use special delimiters to remove ambiguities (ie: '+' for inner types) + BfTypeNameFlag_HideGlobalName = 0x200, }; enum BfMethodNameFlags : uint8 @@ -1401,28 +1402,29 @@ enum BfAttributeTargets : int32 { BfAttributeTargets_SkipValidate = -1, - BfAttributeTargets_None = 0, - BfAttributeTargets_Assembly = 0x0001, - BfAttributeTargets_Module = 0x0002, - BfAttributeTargets_Class = 0x0004, - BfAttributeTargets_Struct = 0x0008, - BfAttributeTargets_Enum = 0x0010, - BfAttributeTargets_Constructor = 0x0020, - BfAttributeTargets_Method = 0x0040, - BfAttributeTargets_Property = 0x0080, - BfAttributeTargets_Field = 0x0100, - BfAttributeTargets_StaticField = 0x0200, - BfAttributeTargets_Interface = 0x0400, - BfAttributeTargets_Parameter = 0x0800, - BfAttributeTargets_Delegate = 0x1000, - BfAttributeTargets_Function = 0x2000, - BfAttributeTargets_ReturnValue = 0x4000, + BfAttributeTargets_None = 0, + BfAttributeTargets_Assembly = 0x0001, + BfAttributeTargets_Module = 0x0002, + BfAttributeTargets_Class = 0x0004, + BfAttributeTargets_Struct = 0x0008, + BfAttributeTargets_Enum = 0x0010, + BfAttributeTargets_Constructor = 0x0020, + BfAttributeTargets_Method = 0x0040, + BfAttributeTargets_Property = 0x0080, + BfAttributeTargets_Field = 0x0100, + BfAttributeTargets_StaticField = 0x0200, + BfAttributeTargets_Interface = 0x0400, + BfAttributeTargets_Parameter = 0x0800, + BfAttributeTargets_Delegate = 0x1000, + BfAttributeTargets_Function = 0x2000, + BfAttributeTargets_ReturnValue = 0x4000, BfAttributeTargets_GenericParameter = 0x8000, - BfAttributeTargets_Invocation = 0x10000, + BfAttributeTargets_Invocation = 0x10000, BfAttributeTargets_MemberAccess = 0x20000, - BfAttributeTargets_Alloc = 0x40000, - BfAttributeTargets_Delete = 0x80000, - BfAttributeTargets_All = 0xFFFFF + BfAttributeTargets_Alloc = 0x40000, + BfAttributeTargets_Delete = 0x80000, + BfAttributeTargets_Alias = 0x100000, + BfAttributeTargets_All = 0x1FFFFF }; class BfAttributeData