xref: /freebsd/contrib/llvm-project/clang/include/clang/CIR/MissingFeatures.h (revision 700637cbb5e582861067a11aaca4d053546871d2)
1 //===---- MissingFeatures.h - Checks for unimplemented features -*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file introduces some helper classes to guard against features that
10 // CIR dialect supports that we do not have and also do not have great ways to
11 // assert against.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef CLANG_CIR_MISSINGFEATURES_H
16 #define CLANG_CIR_MISSINGFEATURES_H
17 
18 namespace cir {
19 
20 // As a way to track features that haven't yet been implemented this class
21 // explicitly contains a list of static fns that will return false that you
22 // can guard against. If and when a feature becomes implemented simply changing
23 // this return to true will cause compilation to fail at all the points in which
24 // we noted that we needed to address. This is a much more explicit way to
25 // handle "TODO"s.
26 struct MissingFeatures {
27   // Address space related
addressSpaceMissingFeatures28   static bool addressSpace() { return false; }
29 
30   // CIRGenFunction implementation details
cgfSymbolTableMissingFeatures31   static bool cgfSymbolTable() { return false; }
32 
33   // Unhandled global/linkage information.
opGlobalThreadLocalMissingFeatures34   static bool opGlobalThreadLocal() { return false; }
opGlobalConstantMissingFeatures35   static bool opGlobalConstant() { return false; }
opGlobalWeakRefMissingFeatures36   static bool opGlobalWeakRef() { return false; }
opGlobalUnnamedAddrMissingFeatures37   static bool opGlobalUnnamedAddr() { return false; }
opGlobalSectionMissingFeatures38   static bool opGlobalSection() { return false; }
opGlobalVisibilityMissingFeatures39   static bool opGlobalVisibility() { return false; }
opGlobalDLLImportExportMissingFeatures40   static bool opGlobalDLLImportExport() { return false; }
opGlobalPartitionMissingFeatures41   static bool opGlobalPartition() { return false; }
opGlobalUsedOrCompilerUsedMissingFeatures42   static bool opGlobalUsedOrCompilerUsed() { return false; }
43 
supportIFuncAttrMissingFeatures44   static bool supportIFuncAttr() { return false; }
supportVisibilityMissingFeatures45   static bool supportVisibility() { return false; }
hiddenVisibilityMissingFeatures46   static bool hiddenVisibility() { return false; }
protectedVisibilityMissingFeatures47   static bool protectedVisibility() { return false; }
defaultVisibilityMissingFeatures48   static bool defaultVisibility() { return false; }
49 
50   // Load/store attributes
opLoadStoreThreadLocalMissingFeatures51   static bool opLoadStoreThreadLocal() { return false; }
opLoadEmitScalarRangeCheckMissingFeatures52   static bool opLoadEmitScalarRangeCheck() { return false; }
opLoadBooleanRepresentationMissingFeatures53   static bool opLoadBooleanRepresentation() { return false; }
opLoadStoreTbaaMissingFeatures54   static bool opLoadStoreTbaa() { return false; }
opLoadStoreMemOrderMissingFeatures55   static bool opLoadStoreMemOrder() { return false; }
opLoadStoreVolatileMissingFeatures56   static bool opLoadStoreVolatile() { return false; }
opLoadStoreAtomicMissingFeatures57   static bool opLoadStoreAtomic() { return false; }
opLoadStoreObjCMissingFeatures58   static bool opLoadStoreObjC() { return false; }
59 
60   // AllocaOp handling
opAllocaStaticLocalMissingFeatures61   static bool opAllocaStaticLocal() { return false; }
opAllocaNonGCMissingFeatures62   static bool opAllocaNonGC() { return false; }
opAllocaImpreciseLifetimeMissingFeatures63   static bool opAllocaImpreciseLifetime() { return false; }
opAllocaPreciseLifetimeMissingFeatures64   static bool opAllocaPreciseLifetime() { return false; }
opAllocaTLSMissingFeatures65   static bool opAllocaTLS() { return false; }
opAllocaOpenMPThreadPrivateMissingFeatures66   static bool opAllocaOpenMPThreadPrivate() { return false; }
opAllocaEscapeByReferenceMissingFeatures67   static bool opAllocaEscapeByReference() { return false; }
opAllocaReferenceMissingFeatures68   static bool opAllocaReference() { return false; }
opAllocaAnnotationsMissingFeatures69   static bool opAllocaAnnotations() { return false; }
opAllocaDynAllocSizeMissingFeatures70   static bool opAllocaDynAllocSize() { return false; }
opAllocaCaptureByInitMissingFeatures71   static bool opAllocaCaptureByInit() { return false; }
72 
73   // FuncOp handling
opFuncOpenCLKernelMetadataMissingFeatures74   static bool opFuncOpenCLKernelMetadata() { return false; }
opFuncAstDeclAttrMissingFeatures75   static bool opFuncAstDeclAttr() { return false; }
opFuncCallingConvMissingFeatures76   static bool opFuncCallingConv() { return false; }
opFuncExtraAttrsMissingFeatures77   static bool opFuncExtraAttrs() { return false; }
opFuncNoProtoMissingFeatures78   static bool opFuncNoProto() { return false; }
opFuncCPUAndFeaturesAttributesMissingFeatures79   static bool opFuncCPUAndFeaturesAttributes() { return false; }
opFuncSectionMissingFeatures80   static bool opFuncSection() { return false; }
opFuncMultipleReturnValsMissingFeatures81   static bool opFuncMultipleReturnVals() { return false; }
opFuncAttributesForDefinitionMissingFeatures82   static bool opFuncAttributesForDefinition() { return false; }
opFuncMaybeHandleStaticInExternCMissingFeatures83   static bool opFuncMaybeHandleStaticInExternC() { return false; }
setLLVMFunctionFEnvAttributesMissingFeatures84   static bool setLLVMFunctionFEnvAttributes() { return false; }
setFunctionAttributesMissingFeatures85   static bool setFunctionAttributes() { return false; }
86 
87   // CallOp handling
opCallPseudoDtorMissingFeatures88   static bool opCallPseudoDtor() { return false; }
opCallAggregateArgsMissingFeatures89   static bool opCallAggregateArgs() { return false; }
opCallPaddingArgsMissingFeatures90   static bool opCallPaddingArgs() { return false; }
opCallABIExtendArgMissingFeatures91   static bool opCallABIExtendArg() { return false; }
opCallABIIndirectArgMissingFeatures92   static bool opCallABIIndirectArg() { return false; }
opCallWidenArgMissingFeatures93   static bool opCallWidenArg() { return false; }
opCallBitcastArgMissingFeatures94   static bool opCallBitcastArg() { return false; }
opCallImplicitObjectSizeArgsMissingFeatures95   static bool opCallImplicitObjectSizeArgs() { return false; }
opCallReturnMissingFeatures96   static bool opCallReturn() { return false; }
opCallArgEvaluationOrderMissingFeatures97   static bool opCallArgEvaluationOrder() { return false; }
opCallCallConvMissingFeatures98   static bool opCallCallConv() { return false; }
opCallNoPrototypeFuncMissingFeatures99   static bool opCallNoPrototypeFunc() { return false; }
opCallMustTailMissingFeatures100   static bool opCallMustTail() { return false; }
opCallVirtualMissingFeatures101   static bool opCallVirtual() { return false; }
opCallInAllocaMissingFeatures102   static bool opCallInAlloca() { return false; }
opCallAttrsMissingFeatures103   static bool opCallAttrs() { return false; }
opCallSurroundingTryMissingFeatures104   static bool opCallSurroundingTry() { return false; }
opCallASTAttrMissingFeatures105   static bool opCallASTAttr() { return false; }
opCallObjCMethodMissingFeatures106   static bool opCallObjCMethod() { return false; }
opCallExtParameterInfoMissingFeatures107   static bool opCallExtParameterInfo() { return false; }
opCallCIRGenFuncInfoParamInfoMissingFeatures108   static bool opCallCIRGenFuncInfoParamInfo() { return false; }
opCallCIRGenFuncInfoExtParamInfoMissingFeatures109   static bool opCallCIRGenFuncInfoExtParamInfo() { return false; }
opCallLandingPadMissingFeatures110   static bool opCallLandingPad() { return false; }
opCallContinueBlockMissingFeatures111   static bool opCallContinueBlock() { return false; }
112 
113   // CXXNewExpr
exprNewNullCheckMissingFeatures114   static bool exprNewNullCheck() { return false; }
115 
116   // FnInfoOpts -- This is used to track whether calls are chain calls or
117   // instance methods. Classic codegen uses chain call to track and extra free
118   // register for x86 and uses instance method as a condition for a thunk
119   // generation special case. It's not clear that we need either of these in
120   // pre-lowering CIR codegen.
opCallFnInfoOptsMissingFeatures121   static bool opCallFnInfoOpts() { return false; }
122 
123   // ScopeOp handling
opScopeCleanupRegionMissingFeatures124   static bool opScopeCleanupRegion() { return false; }
125 
126   // Unary operator handling
opUnaryPromotionTypeMissingFeatures127   static bool opUnaryPromotionType() { return false; }
128 
129   // SwitchOp handling
foldRangeCaseMissingFeatures130   static bool foldRangeCase() { return false; }
131 
132   // Clang early optimizations or things defered to LLVM lowering.
mayHaveIntegerOverflowMissingFeatures133   static bool mayHaveIntegerOverflow() { return false; }
shouldReverseUnaryCondOnBoolExprMissingFeatures134   static bool shouldReverseUnaryCondOnBoolExpr() { return false; }
135 
136   // RecordType
skippedLayoutMissingFeatures137   static bool skippedLayout() { return false; }
astRecordDeclAttrMissingFeatures138   static bool astRecordDeclAttr() { return false; }
cxxSupportMissingFeatures139   static bool cxxSupport() { return false; }
recordZeroInitMissingFeatures140   static bool recordZeroInit() { return false; }
zeroSizeRecordMembersMissingFeatures141   static bool zeroSizeRecordMembers() { return false; }
recordLayoutVirtualBasesMissingFeatures142   static bool recordLayoutVirtualBases() { return false; }
143 
144   // Various handling of deferred processing in CIRGenModule.
cgmReleaseMissingFeatures145   static bool cgmRelease() { return false; }
deferredVtablesMissingFeatures146   static bool deferredVtables() { return false; }
deferredFuncDeclsMissingFeatures147   static bool deferredFuncDecls() { return false; }
148 
149   // CXXABI
cxxABIMissingFeatures150   static bool cxxABI() { return false; }
cxxabiThisAlignmentMissingFeatures151   static bool cxxabiThisAlignment() { return false; }
cxxabiUseARMMethodPtrABIMissingFeatures152   static bool cxxabiUseARMMethodPtrABI() { return false; }
cxxabiUseARMGuardVarABIMissingFeatures153   static bool cxxabiUseARMGuardVarABI() { return false; }
cxxabiAppleARM64CXXABIMissingFeatures154   static bool cxxabiAppleARM64CXXABI() { return false; }
cxxabiStructorImplicitParamMissingFeatures155   static bool cxxabiStructorImplicitParam() { return false; }
isDiscreteBitFieldABIMissingFeatures156   static bool isDiscreteBitFieldABI() { return false; }
157 
158   // Address class
addressOffsetMissingFeatures159   static bool addressOffset() { return false; }
addressIsKnownNonNullMissingFeatures160   static bool addressIsKnownNonNull() { return false; }
addressPointerAuthInfoMissingFeatures161   static bool addressPointerAuthInfo() { return false; }
162 
163   // Misc
abiArgInfoMissingFeatures164   static bool abiArgInfo() { return false; }
addHeapAllocSiteMetadataMissingFeatures165   static bool addHeapAllocSiteMetadata() { return false; }
aggValueSlotMissingFeatures166   static bool aggValueSlot() { return false; }
aggValueSlotAliasMissingFeatures167   static bool aggValueSlotAlias() { return false; }
aggValueSlotDestructedFlagMissingFeatures168   static bool aggValueSlotDestructedFlag() { return false; }
aggValueSlotGCMissingFeatures169   static bool aggValueSlotGC() { return false; }
aggValueSlotMayOverlapMissingFeatures170   static bool aggValueSlotMayOverlap() { return false; }
aggValueSlotVolatileMissingFeatures171   static bool aggValueSlotVolatile() { return false; }
alignCXXRecordDeclMissingFeatures172   static bool alignCXXRecordDecl() { return false; }
armComputeVolatileBitfieldsMissingFeatures173   static bool armComputeVolatileBitfields() { return false; }
asmLabelAttrMissingFeatures174   static bool asmLabelAttr() { return false; }
assignMemcpyizerMissingFeatures175   static bool assignMemcpyizer() { return false; }
astVarDeclInterfaceMissingFeatures176   static bool astVarDeclInterface() { return false; }
attributeBuiltinMissingFeatures177   static bool attributeBuiltin() { return false; }
attributeNoBuiltinMissingFeatures178   static bool attributeNoBuiltin() { return false; }
bitfieldsMissingFeatures179   static bool bitfields() { return false; }
builtinCallMissingFeatures180   static bool builtinCall() { return false; }
builtinCallF128MissingFeatures181   static bool builtinCallF128() { return false; }
builtinCallMathErrnoMissingFeatures182   static bool builtinCallMathErrno() { return false; }
builtinCheckKindMissingFeatures183   static bool builtinCheckKind() { return false; }
cgFPOptionsRAIIMissingFeatures184   static bool cgFPOptionsRAII() { return false; }
cirgenABIInfoMissingFeatures185   static bool cirgenABIInfo() { return false; }
cleanupAfterErrorDiagsMissingFeatures186   static bool cleanupAfterErrorDiags() { return false; }
cleanupsToDeactivateMissingFeatures187   static bool cleanupsToDeactivate() { return false; }
constEmitterArrayILEMissingFeatures188   static bool constEmitterArrayILE() { return false; }
constEmitterVectorILEMissingFeatures189   static bool constEmitterVectorILE() { return false; }
constantFoldSwitchStatementMissingFeatures190   static bool constantFoldSwitchStatement() { return false; }
constructABIArgDirectExtendMissingFeatures191   static bool constructABIArgDirectExtend() { return false; }
coverageMappingMissingFeatures192   static bool coverageMapping() { return false; }
createProfileWeightsForLoopMissingFeatures193   static bool createProfileWeightsForLoop() { return false; }
ctorMemcpyizerMissingFeatures194   static bool ctorMemcpyizer() { return false; }
cudaSupportMissingFeatures195   static bool cudaSupport() { return false; }
cxxRecordStaticMembersMissingFeatures196   static bool cxxRecordStaticMembers() { return false; }
dataLayoutTypeAllocSizeMissingFeatures197   static bool dataLayoutTypeAllocSize() { return false; }
deferredCXXGlobalInitMissingFeatures198   static bool deferredCXXGlobalInit() { return false; }
emitCheckedInBoundsGEPMissingFeatures199   static bool emitCheckedInBoundsGEP() { return false; }
emitCondLikelihoodViaExpectIntrinsicMissingFeatures200   static bool emitCondLikelihoodViaExpectIntrinsic() { return false; }
emitLifetimeMarkersMissingFeatures201   static bool emitLifetimeMarkers() { return false; }
emitLValueAlignmentAssumptionMissingFeatures202   static bool emitLValueAlignmentAssumption() { return false; }
emitNullabilityCheckMissingFeatures203   static bool emitNullabilityCheck() { return false; }
emitTypeCheckMissingFeatures204   static bool emitTypeCheck() { return false; }
fastMathFlagsMissingFeatures205   static bool fastMathFlags() { return false; }
fpConstraintsMissingFeatures206   static bool fpConstraints() { return false; }
generateDebugInfoMissingFeatures207   static bool generateDebugInfo() { return false; }
hipMissingFeatures208   static bool hip() { return false; }
implicitConstructorArgsMissingFeatures209   static bool implicitConstructorArgs() { return false; }
incrementProfileCounterMissingFeatures210   static bool incrementProfileCounter() { return false; }
insertBuiltinUnpredictableMissingFeatures211   static bool insertBuiltinUnpredictable() { return false; }
instrumentationMissingFeatures212   static bool instrumentation() { return false; }
intrinsicsMissingFeatures213   static bool intrinsics() { return false; }
isMemcpyEquivalentSpecialMemberMissingFeatures214   static bool isMemcpyEquivalentSpecialMember() { return false; }
isTrivialCtorOrDtorMissingFeatures215   static bool isTrivialCtorOrDtor() { return false; }
lambdaFieldToNameMissingFeatures216   static bool lambdaFieldToName() { return false; }
loopInfoStackMissingFeatures217   static bool loopInfoStack() { return false; }
lowerAggregateLoadStoreMissingFeatures218   static bool lowerAggregateLoadStore() { return false; }
lowerModeOptLevelMissingFeatures219   static bool lowerModeOptLevel() { return false; }
maybeHandleStaticInExternCMissingFeatures220   static bool maybeHandleStaticInExternC() { return false; }
metaDataNodeMissingFeatures221   static bool metaDataNode() { return false; }
moduleNameHashMissingFeatures222   static bool moduleNameHash() { return false; }
msabiMissingFeatures223   static bool msabi() { return false; }
needsGlobalCtorDtorMissingFeatures224   static bool needsGlobalCtorDtor() { return false; }
nonFineGrainedBitfieldsMissingFeatures225   static bool nonFineGrainedBitfields() { return false; }
objCBlocksMissingFeatures226   static bool objCBlocks() { return false; }
objCGCMissingFeatures227   static bool objCGC() { return false; }
objCLifetimeMissingFeatures228   static bool objCLifetime() { return false; }
openMPMissingFeatures229   static bool openMP() { return false; }
opGlobalViewAttrMissingFeatures230   static bool opGlobalViewAttr() { return false; }
opTBAAMissingFeatures231   static bool opTBAA() { return false; }
peepholeProtectionMissingFeatures232   static bool peepholeProtection() { return false; }
pgoUseMissingFeatures233   static bool pgoUse() { return false; }
pointerOverflowSanitizerMissingFeatures234   static bool pointerOverflowSanitizer() { return false; }
preservedAccessIndexRegionMissingFeatures235   static bool preservedAccessIndexRegion() { return false; }
requiresCleanupsMissingFeatures236   static bool requiresCleanups() { return false; }
runCleanupsScopeMissingFeatures237   static bool runCleanupsScope() { return false; }
sanitizersMissingFeatures238   static bool sanitizers() { return false; }
setDLLStorageClassMissingFeatures239   static bool setDLLStorageClass() { return false; }
setNonGCMissingFeatures240   static bool setNonGC() { return false; }
setObjCGCLValueClassMissingFeatures241   static bool setObjCGCLValueClass() { return false; }
setTargetAttributesMissingFeatures242   static bool setTargetAttributes() { return false; }
stackBaseMissingFeatures243   static bool stackBase() { return false; }
stackSaveOpMissingFeatures244   static bool stackSaveOp() { return false; }
targetCIRGenInfoArchMissingFeatures245   static bool targetCIRGenInfoArch() { return false; }
targetCIRGenInfoOSMissingFeatures246   static bool targetCIRGenInfoOS() { return false; }
targetCodeGenInfoGetNullPointerMissingFeatures247   static bool targetCodeGenInfoGetNullPointer() { return false; }
thunksMissingFeatures248   static bool thunks() { return false; }
tryEmitAsConstantMissingFeatures249   static bool tryEmitAsConstant() { return false; }
typeChecksMissingFeatures250   static bool typeChecks() { return false; }
weakRefReferenceMissingFeatures251   static bool weakRefReference() { return false; }
writebacksMissingFeatures252   static bool writebacks() { return false; }
appleKextMissingFeatures253   static bool appleKext() { return false; }
dtorCleanupsMissingFeatures254   static bool dtorCleanups() { return false; }
completeDtorsMissingFeatures255   static bool completeDtors() { return false; }
vtableInitializationMissingFeatures256   static bool vtableInitialization() { return false; }
257 
258   // Missing types
dataMemberTypeMissingFeatures259   static bool dataMemberType() { return false; }
matrixTypeMissingFeatures260   static bool matrixType() { return false; }
methodTypeMissingFeatures261   static bool methodType() { return false; }
scalableVectorsMissingFeatures262   static bool scalableVectors() { return false; }
unsizedTypesMissingFeatures263   static bool unsizedTypes() { return false; }
vectorTypeMissingFeatures264   static bool vectorType() { return false; }
complexTypeMissingFeatures265   static bool complexType() { return false; }
fixedPointTypeMissingFeatures266   static bool fixedPointType() { return false; }
stringTypeWithDifferentArraySizeMissingFeatures267   static bool stringTypeWithDifferentArraySize() { return false; }
268 
269   // Future CIR operations
awaitOpMissingFeatures270   static bool awaitOp() { return false; }
callOpMissingFeatures271   static bool callOp() { return false; }
complexImagOpMissingFeatures272   static bool complexImagOp() { return false; }
complexRealOpMissingFeatures273   static bool complexRealOp() { return false; }
ifOpMissingFeatures274   static bool ifOp() { return false; }
invokeOpMissingFeatures275   static bool invokeOp() { return false; }
labelOpMissingFeatures276   static bool labelOp() { return false; }
ptrDiffOpMissingFeatures277   static bool ptrDiffOp() { return false; }
ptrStrideOpMissingFeatures278   static bool ptrStrideOp() { return false; }
switchOpMissingFeatures279   static bool switchOp() { return false; }
throwOpMissingFeatures280   static bool throwOp() { return false; }
tryOpMissingFeatures281   static bool tryOp() { return false; }
vecTernaryOpMissingFeatures282   static bool vecTernaryOp() { return false; }
zextOpMissingFeatures283   static bool zextOp() { return false; }
284 
285   // Future CIR attributes
optInfoAttrMissingFeatures286   static bool optInfoAttr() { return false; }
287 };
288 
289 } // namespace cir
290 
291 #endif // CLANG_CIR_MISSINGFEATURES_H
292