clang 22.0.0git
MissingFeatures.h
Go to the documentation of this file.
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
18namespace 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.
27 // Address space related
28 static bool addressSpace() { return false; }
29
30 // Unhandled global/linkage information.
31 static bool opGlobalThreadLocal() { return false; }
32 static bool opGlobalConstant() { return false; }
33 static bool opGlobalWeakRef() { return false; }
34 static bool opGlobalUnnamedAddr() { return false; }
35 static bool opGlobalSection() { return false; }
36 static bool opGlobalVisibility() { return false; }
37 static bool opGlobalDLLImportExport() { return false; }
38 static bool opGlobalPartition() { return false; }
39 static bool opGlobalUsedOrCompilerUsed() { return false; }
40
41 static bool supportIFuncAttr() { return false; }
42 static bool supportVisibility() { return false; }
43 static bool hiddenVisibility() { return false; }
44 static bool protectedVisibility() { return false; }
45 static bool defaultVisibility() { return false; }
46
47 // Load/store attributes
48 static bool opLoadStoreThreadLocal() { return false; }
49 static bool opLoadEmitScalarRangeCheck() { return false; }
50 static bool opLoadStoreNontemporal() { return false; }
51 static bool opLoadStoreTbaa() { return false; }
52 static bool opLoadStoreAtomic() { return false; }
53 static bool opLoadStoreObjC() { return false; }
54
55 // AllocaOp handling
56 static bool opAllocaStaticLocal() { return false; }
57 static bool opAllocaNonGC() { return false; }
58 static bool opAllocaImpreciseLifetime() { return false; }
59 static bool opAllocaPreciseLifetime() { return false; }
60 static bool opAllocaTLS() { return false; }
61 static bool opAllocaOpenMPThreadPrivate() { return false; }
62 static bool opAllocaEscapeByReference() { return false; }
63 static bool opAllocaReference() { return false; }
64 static bool opAllocaAnnotations() { return false; }
65 static bool opAllocaDynAllocSize() { return false; }
66 static bool opAllocaCaptureByInit() { return false; }
67
68 // FuncOp handling
69 static bool opFuncOpenCLKernelMetadata() { return false; }
70 static bool opFuncAstDeclAttr() { return false; }
71 static bool opFuncAttributesForDefinition() { return false; }
72 static bool opFuncCallingConv() { return false; }
73 static bool opFuncCPUAndFeaturesAttributes() { return false; }
74 static bool opFuncExceptions() { return false; }
75 static bool opFuncExtraAttrs() { return false; }
76 static bool opFuncMaybeHandleStaticInExternC() { return false; }
77 static bool opFuncMultipleReturnVals() { return false; }
78 static bool opFuncOperandBundles() { return false; }
79 static bool opFuncParameterAttributes() { return false; }
80 static bool opFuncSection() { return false; }
81 static bool setLLVMFunctionFEnvAttributes() { return false; }
82 static bool setFunctionAttributes() { return false; }
83
84 // CallOp handling
85 static bool opCallAggregateArgs() { return false; }
86 static bool opCallPaddingArgs() { return false; }
87 static bool opCallABIExtendArg() { return false; }
88 static bool opCallABIIndirectArg() { return false; }
89 static bool opCallWidenArg() { return false; }
90 static bool opCallBitcastArg() { return false; }
91 static bool opCallImplicitObjectSizeArgs() { return false; }
92 static bool opCallReturn() { return false; }
93 static bool opCallArgEvaluationOrder() { return false; }
94 static bool opCallCallConv() { return false; }
95 static bool opCallSideEffect() { return false; }
96 static bool opCallMustTail() { return false; }
97 static bool opCallInAlloca() { return false; }
98 static bool opCallAttrs() { return false; }
99 static bool opCallSurroundingTry() { return false; }
100 static bool opCallASTAttr() { return false; }
101 static bool opCallObjCMethod() { return false; }
102 static bool opCallExtParameterInfo() { return false; }
103 static bool opCallCIRGenFuncInfoParamInfo() { return false; }
104 static bool opCallCIRGenFuncInfoExtParamInfo() { return false; }
105 static bool opCallLandingPad() { return false; }
106 static bool opCallContinueBlock() { return false; }
107 static bool opCallChain() { return false; }
108
109 // CXXNewExpr
110 static bool exprNewNullCheck() { return false; }
111
112 // FnInfoOpts -- This is used to track whether calls are chain calls or
113 // instance methods. Classic codegen uses chain call to track and extra free
114 // register for x86 and uses instance method as a condition for a thunk
115 // generation special case. It's not clear that we need either of these in
116 // pre-lowering CIR codegen.
117 static bool opCallFnInfoOpts() { return false; }
118
119 // ScopeOp handling
120 static bool opScopeCleanupRegion() { return false; }
121
122 // Unary operator handling
123 static bool opUnaryPromotionType() { return false; }
124
125 // SwitchOp handling
126 static bool foldRangeCase() { return false; }
127
128 // Clang early optimizations or things defered to LLVM lowering.
129 static bool mayHaveIntegerOverflow() { return false; }
130 static bool shouldReverseUnaryCondOnBoolExpr() { return false; }
131
132 // RecordType
133 static bool skippedLayout() { return false; }
134 static bool astRecordDeclAttr() { return false; }
135 static bool cxxSupport() { return false; }
136 static bool recordZeroInit() { return false; }
137 static bool zeroSizeRecordMembers() { return false; }
138 static bool recordLayoutVirtualBases() { return false; }
139
140 // Various handling of deferred processing in CIRGenModule.
141 static bool cgmRelease() { return false; }
142 static bool deferredVtables() { return false; }
143 static bool deferredFuncDecls() { return false; }
144
145 // CXXABI
146 static bool cxxABI() { return false; }
147 static bool cxxabiThisAlignment() { return false; }
148 static bool cxxabiUseARMMethodPtrABI() { return false; }
149 static bool cxxabiUseARMGuardVarABI() { return false; }
150 static bool cxxabiAppleARM64CXXABI() { return false; }
151 static bool cxxabiStructorImplicitParam() { return false; }
152 static bool isDiscreteBitFieldABI() { return false; }
153
154 // Address class
155 static bool addressOffset() { return false; }
156 static bool addressIsKnownNonNull() { return false; }
157 static bool addressPointerAuthInfo() { return false; }
158
159 // Atomic
160 static bool atomicExpr() { return false; }
161 static bool atomicInfo() { return false; }
162 static bool atomicInfoGetAtomicPointer() { return false; }
163 static bool atomicInfoGetAtomicAddress() { return false; }
164 static bool atomicUseLibCall() { return false; }
165 static bool atomicScope() { return false; }
166 static bool atomicSyncScopeID() { return false; }
167
168 // Misc
169 static bool abiArgInfo() { return false; }
170 static bool addHeapAllocSiteMetadata() { return false; }
171 static bool aggValueSlot() { return false; }
172 static bool aggValueSlotAlias() { return false; }
173 static bool aggValueSlotDestructedFlag() { return false; }
174 static bool aggValueSlotGC() { return false; }
175 static bool aggValueSlotMayOverlap() { return false; }
176 static bool aggValueSlotVolatile() { return false; }
177 static bool alignCXXRecordDecl() { return false; }
178 static bool armComputeVolatileBitfields() { return false; }
179 static bool asmGoto() { return false; }
180 static bool asmInputOperands() { return false; }
181 static bool asmLabelAttr() { return false; }
182 static bool asmMemoryEffects() { return false; }
183 static bool asmOutputOperands() { return false; }
184 static bool asmUnwindClobber() { return false; }
185 static bool assignMemcpyizer() { return false; }
186 static bool astVarDeclInterface() { return false; }
187 static bool attributeBuiltin() { return false; }
188 static bool attributeNoBuiltin() { return false; }
189 static bool bitfields() { return false; }
190 static bool builtinCall() { return false; }
191 static bool builtinCallF128() { return false; }
192 static bool builtinCallMathErrno() { return false; }
193 static bool builtinCheckKind() { return false; }
194 static bool cgFPOptionsRAII() { return false; }
195 static bool cirgenABIInfo() { return false; }
196 static bool cleanupAfterErrorDiags() { return false; }
197 static bool cleanupsToDeactivate() { return false; }
198 static bool constEmitterAggILE() { return false; }
199 static bool constEmitterArrayILE() { return false; }
200 static bool constEmitterVectorILE() { return false; }
201 static bool constantFoldSwitchStatement() { return false; }
202 static bool constructABIArgDirectExtend() { return false; }
203 static bool coverageMapping() { return false; }
204 static bool createInvariantGroup() { return false; }
205 static bool createProfileWeightsForLoop() { return false; }
206 static bool ctorMemcpyizer() { return false; }
207 static bool cudaSupport() { return false; }
208 static bool cxxRecordStaticMembers() { return false; }
209 static bool dataLayoutTypeIsSized() { return false; }
210 static bool dataLayoutTypeAllocSize() { return false; }
211 static bool dataLayoutTypeStoreSize() { return false; }
212 static bool deferredCXXGlobalInit() { return false; }
213 static bool devirtualizeMemberFunction() { return false; }
214 static bool ehCleanupFlags() { return false; }
215 static bool ehCleanupScope() { return false; }
216 static bool ehCleanupScopeRequiresEHCleanup() { return false; }
217 static bool ehCleanupBranchFixups() { return false; }
218 static bool ehstackBranches() { return false; }
219 static bool emitCheckedInBoundsGEP() { return false; }
220 static bool emitCondLikelihoodViaExpectIntrinsic() { return false; }
221 static bool emitLifetimeMarkers() { return false; }
222 static bool emitLValueAlignmentAssumption() { return false; }
223 static bool emitNullabilityCheck() { return false; }
224 static bool emitTypeCheck() { return false; }
225 static bool emitTypeMetadataCodeForVCall() { return false; }
226 static bool fastMathFlags() { return false; }
227 static bool fpConstraints() { return false; }
228 static bool generateDebugInfo() { return false; }
229 static bool globalViewIndices() { return false; }
230 static bool globalViewIntLowering() { return false; }
231 static bool hip() { return false; }
232 static bool implicitConstructorArgs() { return false; }
233 static bool incrementProfileCounter() { return false; }
234 static bool innermostEHScope() { return false; }
235 static bool insertBuiltinUnpredictable() { return false; }
236 static bool instrumentation() { return false; }
237 static bool intrinsics() { return false; }
238 static bool isMemcpyEquivalentSpecialMember() { return false; }
239 static bool isTrivialCtorOrDtor() { return false; }
240 static bool lambdaCaptures() { return false; }
241 static bool lambdaFieldToName() { return false; }
242 static bool loopInfoStack() { return false; }
243 static bool lowerAggregateLoadStore() { return false; }
244 static bool lowerModeOptLevel() { return false; }
245 static bool maybeHandleStaticInExternC() { return false; }
246 static bool mergeAllConstants() { return false; }
247 static bool metaDataNode() { return false; }
248 static bool moduleNameHash() { return false; }
249 static bool msabi() { return false; }
250 static bool needsGlobalCtorDtor() { return false; }
251 static bool objCBlocks() { return false; }
252 static bool objCGC() { return false; }
253 static bool objCLifetime() { return false; }
254 static bool openCL() { return false; }
255 static bool openMP() { return false; }
256 static bool opTBAA() { return false; }
257 static bool peepholeProtection() { return false; }
258 static bool pgoUse() { return false; }
259 static bool pointerOverflowSanitizer() { return false; }
260 static bool preservedAccessIndexRegion() { return false; }
261 static bool requiresCleanups() { return false; }
262 static bool runCleanupsScope() { return false; }
263 static bool sanitizers() { return false; }
264 static bool setDLLStorageClass() { return false; }
265 static bool setNonGC() { return false; }
266 static bool setObjCGCLValueClass() { return false; }
267 static bool setTargetAttributes() { return false; }
268 static bool sourceLanguageCases() { return false; }
269 static bool stackBase() { return false; }
270 static bool stackSaveOp() { return false; }
271 static bool targetCIRGenInfoArch() { return false; }
272 static bool targetCIRGenInfoOS() { return false; }
273 static bool targetCodeGenInfoGetNullPointer() { return false; }
274 static bool thunks() { return false; }
275 static bool tryEmitAsConstant() { return false; }
276 static bool typeChecks() { return false; }
277 static bool weakRefReference() { return false; }
278 static bool writebacks() { return false; }
279 static bool appleKext() { return false; }
280 static bool dtorCleanups() { return false; }
281 static bool vtableInitialization() { return false; }
282 static bool vtableEmitMetadata() { return false; }
283 static bool vtableRelativeLayout() { return false; }
284 static bool msvcBuiltins() { return false; }
285 static bool vaArgABILowering() { return false; }
286 static bool vlas() { return false; }
287
288 // Missing types
289 static bool dataMemberType() { return false; }
290 static bool matrixType() { return false; }
291 static bool methodType() { return false; }
292 static bool scalableVectors() { return false; }
293 static bool unsizedTypes() { return false; }
294 static bool vectorType() { return false; }
295 static bool complexType() { return false; }
296 static bool fixedPointType() { return false; }
297 static bool stringTypeWithDifferentArraySize() { return false; }
298
299 // Future CIR operations
300 static bool awaitOp() { return false; }
301 static bool callOp() { return false; }
302 static bool complexImagOp() { return false; }
303 static bool complexRealOp() { return false; }
304 static bool ifOp() { return false; }
305 static bool invokeOp() { return false; }
306 static bool labelOp() { return false; }
307 static bool ptrDiffOp() { return false; }
308 static bool ptrStrideOp() { return false; }
309 static bool switchOp() { return false; }
310 static bool throwOp() { return false; }
311 static bool tryOp() { return false; }
312 static bool vecTernaryOp() { return false; }
313 static bool zextOp() { return false; }
314
315 // Future CIR attributes
316 static bool optInfoAttr() { return false; }
317};
318
319} // namespace cir
320
321#endif // CLANG_CIR_MISSINGFEATURES_H
Definition: ABIArgInfo.h:22
static bool alignCXXRecordDecl()
static bool opCallBitcastArg()
static bool metaDataNode()
static bool builtinCheckKind()
static bool vectorType()
static bool opCallCIRGenFuncInfoExtParamInfo()
static bool implicitConstructorArgs()
static bool weakRefReference()
static bool instrumentation()
static bool atomicInfoGetAtomicPointer()
static bool opGlobalSection()
static bool dataMemberType()
static bool armComputeVolatileBitfields()
static bool asmMemoryEffects()
static bool supportVisibility()
static bool opGlobalConstant()
static bool objCLifetime()
static bool emitLifetimeMarkers()
static bool opLoadEmitScalarRangeCheck()
static bool addressSpace()
static bool opGlobalUnnamedAddr()
static bool writebacks()
static bool atomicExpr()
static bool vtableEmitMetadata()
static bool opLoadStoreThreadLocal()
static bool needsGlobalCtorDtor()
static bool emitNullabilityCheck()
static bool asmLabelAttr()
static bool opAllocaNonGC()
static bool aggValueSlotDestructedFlag()
static bool msvcBuiltins()
static bool ehCleanupFlags()
static bool cgmRelease()
static bool vtableInitialization()
static bool opCallAggregateArgs()
static bool isDiscreteBitFieldABI()
static bool ehCleanupScope()
static bool fixedPointType()
static bool opGlobalThreadLocal()
static bool aggValueSlotGC()
static bool aggValueSlotAlias()
static bool globalViewIntLowering()
static bool createProfileWeightsForLoop()
static bool opAllocaAnnotations()
static bool atomicInfo()
static bool dataLayoutTypeStoreSize()
static bool targetCodeGenInfoGetNullPointer()
static bool foldRangeCase()
static bool aggValueSlotMayOverlap()
static bool opAllocaOpenMPThreadPrivate()
static bool stackBase()
static bool sourceLanguageCases()
static bool lowerAggregateLoadStore()
static bool emitTypeMetadataCodeForVCall()
static bool cxxRecordStaticMembers()
static bool constructABIArgDirectExtend()
static bool opFuncAstDeclAttr()
static bool opCallSurroundingTry()
static bool atomicScope()
static bool addressPointerAuthInfo()
static bool preservedAccessIndexRegion()
static bool devirtualizeMemberFunction()
static bool cxxabiStructorImplicitParam()
static bool opCallABIIndirectArg()
static bool mergeAllConstants()
static bool opLoadStoreAtomic()
static bool vecTernaryOp()
static bool zeroSizeRecordMembers()
static bool opGlobalUsedOrCompilerUsed()
static bool opLoadStoreTbaa()
static bool cgFPOptionsRAII()
static bool complexType()
static bool opCallChain()
static bool sanitizers()
static bool opAllocaImpreciseLifetime()
static bool asmOutputOperands()
static bool typeChecks()
static bool moduleNameHash()
static bool opCallReturn()
static bool isMemcpyEquivalentSpecialMember()
static bool opGlobalVisibility()
static bool opAllocaStaticLocal()
static bool setFunctionAttributes()
static bool constEmitterArrayILE()
static bool setDLLStorageClass()
static bool unsizedTypes()
static bool opFuncParameterAttributes()
static bool matrixType()
static bool hiddenVisibility()
static bool targetCIRGenInfoArch()
static bool ptrDiffOp()
static bool opCallASTAttr()
static bool ehCleanupScopeRequiresEHCleanup()
static bool optInfoAttr()
static bool dtorCleanups()
static bool aggValueSlot()
static bool builtinCallF128()
static bool opCallSideEffect()
static bool cxxabiAppleARM64CXXABI()
static bool appleKext()
static bool asmInputOperands()
static bool opAllocaTLS()
static bool opFuncExtraAttrs()
static bool opCallPaddingArgs()
static bool complexRealOp()
static bool globalViewIndices()
static bool cleanupsToDeactivate()
static bool opFuncSection()
static bool opCallWidenArg()
static bool runCleanupsScope()
static bool atomicUseLibCall()
static bool emitCheckedInBoundsGEP()
static bool opCallExtParameterInfo()
static bool opCallLandingPad()
static bool loopInfoStack()
static bool dataLayoutTypeAllocSize()
static bool attributeNoBuiltin()
static bool addressOffset()
static bool opFuncOpenCLKernelMetadata()
static bool vaArgABILowering()
static bool opFuncAttributesForDefinition()
static bool lambdaFieldToName()
static bool opGlobalDLLImportExport()
static bool fpConstraints()
static bool coverageMapping()
static bool emitTypeCheck()
static bool emitCondLikelihoodViaExpectIntrinsic()
static bool opUnaryPromotionType()
static bool constEmitterVectorILE()
static bool opGlobalPartition()
static bool skippedLayout()
static bool invokeOp()
static bool opCallObjCMethod()
static bool complexImagOp()
static bool addHeapAllocSiteMetadata()
static bool setObjCGCLValueClass()
static bool cirgenABIInfo()
static bool stackSaveOp()
static bool opLoadStoreObjC()
static bool lowerModeOptLevel()
static bool opCallABIExtendArg()
static bool abiArgInfo()
static bool opCallArgEvaluationOrder()
static bool opGlobalWeakRef()
static bool opAllocaReference()
static bool peepholeProtection()
static bool opCallInAlloca()
static bool setTargetAttributes()
static bool deferredCXXGlobalInit()
static bool createInvariantGroup()
static bool mayHaveIntegerOverflow()
static bool opFuncOperandBundles()
static bool isTrivialCtorOrDtor()
static bool objCBlocks()
static bool cleanupAfterErrorDiags()
static bool opCallCallConv()
static bool constantFoldSwitchStatement()
static bool recordLayoutVirtualBases()
static bool ptrStrideOp()
static bool lambdaCaptures()
static bool astRecordDeclAttr()
static bool opFuncCallingConv()
static bool dataLayoutTypeIsSized()
static bool asmUnwindClobber()
static bool insertBuiltinUnpredictable()
static bool ehstackBranches()
static bool opCallAttrs()
static bool pointerOverflowSanitizer()
static bool builtinCallMathErrno()
static bool aggValueSlotVolatile()
static bool opCallImplicitObjectSizeArgs()
static bool opAllocaCaptureByInit()
static bool opCallMustTail()
static bool fastMathFlags()
static bool innermostEHScope()
static bool shouldReverseUnaryCondOnBoolExpr()
static bool tryEmitAsConstant()
static bool opScopeCleanupRegion()
static bool opCallContinueBlock()
static bool defaultVisibility()
static bool constEmitterAggILE()
static bool assignMemcpyizer()
static bool bitfields()
static bool intrinsics()
static bool addressIsKnownNonNull()
static bool opFuncExceptions()
static bool protectedVisibility()
static bool switchOp()
static bool deferredVtables()
static bool cxxabiUseARMGuardVarABI()
static bool stringTypeWithDifferentArraySize()
static bool ctorMemcpyizer()
static bool astVarDeclInterface()
static bool builtinCall()
static bool cxxabiUseARMMethodPtrABI()
static bool exprNewNullCheck()
static bool opAllocaPreciseLifetime()
static bool attributeBuiltin()
static bool cudaSupport()
static bool scalableVectors()
static bool supportIFuncAttr()
static bool recordZeroInit()
static bool opFuncMaybeHandleStaticInExternC()
static bool ehCleanupBranchFixups()
static bool requiresCleanups()
static bool opAllocaEscapeByReference()
static bool opLoadStoreNontemporal()
static bool opCallFnInfoOpts()
static bool atomicSyncScopeID()
static bool generateDebugInfo()
static bool targetCIRGenInfoOS()
static bool cxxSupport()
static bool vtableRelativeLayout()
static bool deferredFuncDecls()
static bool setNonGC()
static bool emitLValueAlignmentAssumption()
static bool opFuncMultipleReturnVals()
static bool opCallCIRGenFuncInfoParamInfo()
static bool methodType()
static bool opAllocaDynAllocSize()
static bool opFuncCPUAndFeaturesAttributes()
static bool maybeHandleStaticInExternC()
static bool cxxabiThisAlignment()
static bool setLLVMFunctionFEnvAttributes()
static bool atomicInfoGetAtomicAddress()
static bool incrementProfileCounter()