Biohazrd
Biohazrd copied to clipboard
Clang type classes meta issue
We only handle a handful of the possible Type
variants exposed by ClangSharp. Below is a list of all of them, we need to eventually investigate all of the unchecked ones to determine what they are and whether we need to handle them:
- [ ]
AdjustedType
- [ ]
DecayedType
- [ ]
- [ ]
ArrayType
- [x]
ConstantArrayType
- [x] Parameters
- [x] Fields
- [ ]
DependentSizedArrayType
- These are arrays sized by a template parameter - [x]
IncompleteArrayType
- Unsized arrays (IE:int x[]
)- [x] Parameters
- [ ] Can these appear in other places?
- [ ]
VariableArrayType
- [x]
- [ ]
AtomicType
- [x]
AttributedType
https://github.com/InfectedLibraries/Biohazrd/issues/124 - [ ]
BlockPointerType
- [x]
BuiltinType
--BuiltinType
is not handled in any one location, and not all types are supported. We do use it to filter, but we have to useType.Kind
to get the actual builtin type. See https://github.com/InfectedLibraries/Biohazrd/issues/46 for details. - [ ]
ComplexType
- [x]
DecltypeType
--decltype(T)
- [ ]
DeducedType
- [x]
AutoType
-- The magicauto
type - [ ]
DeducedTemplateSpecializationType
- [x]
- [ ]
DependentAddressSpaceType
- [ ]
DependentSizedExtVectorType
- [ ]
DependentVectorType
- [ ]
ExtVectorType
- [ ]
FunctionType
- [ ]
FunctionNoProtoType
- [x]
FunctionProtoType
- [ ]
- [ ]
InjectedClassNameType
- [ ]
MacroQualifiedType
- [ ]
MemberPointerType
- [x] ~~
ObjCObjectPointerType
~~ Out of scope: Objective C - [x] ~~
ObjCObjectType
~~ Out of scope: Objective C- [x] ~~
ObjCInterfaceType
~~ Out of scope: Objective C
- [x] ~~
- [x] ~~
ObjCTypeParamType
~~ Out of scope: Objective C - [ ]
PackExpansionType
- [ ]
ParenType
- [ ]
PipeType
- [x]
PointerType
- [x]
ReferenceType
- [x]
LValueReferenceType
- [ ]
RValueReferenceType
-- 😕 We handle these the same asLValueReferenceType
, but I'm not sure that's actually correct so a warning is emitted as well. ~~What are these? None are present in the codebases I've tested Biohazrd with.~~ Finally found one in the wild in OpenCV. Here's a blog about them from when they were introduced. Still need to look into them more.
- [x]
- [ ]
SubstTemplateTypeParmPackType
- [ ]
SubstTemplateTypeParmType
- [ ]
TagType
- [x]
EnumType
- [x]
RecordType
- [x]
- [ ]
TemplateSpecializationType
- [ ]
TemplateTypeParmType
- [x]
TypedefType
-- If the Clang decl is attached to a TranslatedDeclaration, we translate as a type reference. Otherwise we ignore the typedef and translate as the canonical type. - [ ]
TypeOfExprType
- [ ]
TypeOfType
- [ ]
TypeWithKeyword
- [ ]
DependentNameType
- [ ]
DependentTemplateSpecializationType
- [x]
ElaboratedType
- These are namespace-qualified types (likephysx::PxU32
)
- [ ]
- [ ]
UnaryTransformType
- [ ]
UnresolvedUsingType
- [ ]
VectorType
I suspect many of them probably can't even appear in declaration contexts, but we should check for sure and explicitly error if they appear.