clang 23.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 opGlobalWeakRef() { return false; }
33 static bool opGlobalUnnamedAddr() { return false; }
34 static bool opGlobalVisibility() { return false; }
35 static bool opGlobalDLLImportExport() { return false; }
36 static bool opGlobalPartition() { return false; }
37 static bool opGlobalPragmaClangSection() { return false; }
38 static bool opGlobalAnnotations() { return false; }
39 static bool opGlobalCtorPriority() { return false; }
40 static bool emitNVVMMetadata() { return false; }
41 static bool setDSOLocal() { return false; }
42
43 static bool supportIFuncAttr() { return false; }
44 static bool hiddenVisibility() { return false; }
45 static bool protectedVisibility() { return false; }
46 static bool defaultVisibility() { return false; }
47
48 // Load/store attributes
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 opAllocaAnnotations() { return false; }
64 static bool opAllocaCaptureByInit() { return false; }
65
66 // FuncOp handling
67 static bool opFuncArmNewAttr() { return false; }
68 static bool opFuncArmStreamingAttr() { return false; }
69 static bool opFuncAstDeclAttr() { return false; }
70 static bool opFuncColdHotAttr() { return false; }
71 static bool opFuncExceptions() { return false; }
72 static bool opFuncExtraAttrs() { return false; }
73 static bool opFuncCallingConv() { return false; }
74 static bool opFuncMaybeHandleStaticInExternC() { return false; }
75 static bool opFuncMinSizeAttr() { return false; }
76 static bool opFuncMultipleReturnVals() { return false; }
77 static bool opFuncMultiVersioning() { return false; }
78 static bool opFuncNakedAttr() { return false; }
79 static bool opFuncNoDuplicateAttr() { return false; }
80 static bool opFuncOperandBundles() { return false; }
81 static bool opFuncOptNoneAttr() { return false; }
82 static bool opFuncParameterAttributes() { return false; }
83 static bool opFuncReadOnly() { return false; }
84 static bool opFuncUnwindTablesAttr() { return false; }
85 static bool opFuncWillReturn() { return false; }
86 static bool handleCUDALaunchBoundsAttr() { return false; }
87 static bool setLLVMFunctionFEnvAttributes() { return false; }
88
89 // CallOp handling
90 static bool opCallPaddingArgs() { return false; }
91 static bool opCallBitcastArg() { return false; }
92 static bool opCallReturn() { return false; }
93 static bool opCallArgEvaluationOrder() { return false; }
94 static bool opCallCallConv() { return false; }
95 static bool opCallMustTail() { return false; }
96 static bool opCallInAlloca() { return false; }
97 static bool opCallAttrs() { return false; }
98 static bool opCallSurroundingTry() { return false; }
99 static bool opCallObjCMethod() { return false; }
100 static bool opCallExtParameterInfo() { return false; }
101 static bool opCallCIRGenFuncInfoParamInfo() { return false; }
102 static bool opCallCIRGenFuncInfoExtParamInfo() { return false; }
103 static bool opCallChain() { return false; }
104
105 // FnInfoOpts -- This is used to track whether calls are chain calls or
106 // instance methods. Classic codegen uses chain call to track and extra free
107 // register for x86 and uses instance method as a condition for a thunk
108 // generation special case. It's not clear that we need either of these in
109 // pre-lowering CIR codegen.
110 static bool opCallFnInfoOpts() { return false; }
111
112 // ScopeOp handling
113 static bool opScopeCleanupRegion() { return false; }
114
115 // SwitchOp handling
116 static bool foldRangeCase() { return false; }
117
118 // Clang early optimizations or things defered to LLVM lowering.
119 static bool mayHaveIntegerOverflow() { return false; }
120 static bool shouldReverseUnaryCondOnBoolExpr() { return false; }
121
122 // RecordType
123 static bool astRecordDeclAttr() { return false; }
124 static bool zeroSizeRecordMembers() { return false; }
125
126 // Coroutines
127 static bool coroOutsideFrameMD() { return false; }
128
129 // Various handling of deferred processing in CIRGenModule.
130 static bool cgmRelease() { return false; }
131 static bool checkAliases() { return false; }
132 static bool shouldSkipAliasEmission() { return false; }
133
134 // CXXABI
135 static bool cxxABI() { return false; }
136 static bool cxxabiThisAlignment() { return false; }
137 static bool cxxabiUseARMMethodPtrABI() { return false; }
138 static bool cxxabiUseARMGuardVarABI() { return false; }
139 static bool cxxabiAppleARM64CXXABI() { return false; }
140
141 // Address class
142 static bool addressOffset() { return false; }
143 static bool addressIsKnownNonNull() { return false; }
144 static bool addressPointerAuthInfo() { return false; }
145
146 // Atomic
147 static bool atomicExpr() { return false; }
148 static bool atomicInfo() { return false; }
149 static bool atomicInfoGetAtomicPointer() { return false; }
150 static bool atomicInfoGetAtomicAddress() { return false; }
151 static bool atomicSyncScopeID() { return false; }
152 static bool atomicTypes() { return false; }
153 static bool atomicUseLibCall() { return false; }
154 static bool atomicMicrosoftVolatile() { return false; }
155 static bool atomicOpenMP() { return false; }
156
157 // Global ctor handling
158 static bool globalCtorLexOrder() { return false; }
159 static bool globalCtorAssociatedData() { return false; }
160
161 // LowerModule handling
162 static bool lowerModuleCodeGenOpts() { return false; }
163 static bool lowerModuleLangOpts() { return false; }
164 static bool targetLoweringInfo() { return false; }
165
166 // Extra checks for lowerGetMethod in ItaniumCXXABI
167 static bool emitCFICheck() { return false; }
168 static bool emitVFEInfo() { return false; }
169 static bool emitWPDInfo() { return false; }
170
171 // Misc
172 static bool aarch64SIMDIntrinsics() { return false; }
173 static bool aarch64SMEIntrinsics() { return false; }
174 static bool aarch64SVEIntrinsics() { return false; }
175 static bool aarch64TblBuiltinExpr() { return false; }
176 static bool abiArgInfo() { return false; }
177 static bool addAutoInitAnnotation() { return false; }
178 static bool addHeapAllocSiteMetadata() { return false; }
179 static bool aggEmitFinalDestCopyRValue() { return false; }
180 static bool aggValueSlot() { return false; }
181 static bool aggValueSlotAlias() { return false; }
182 static bool aggValueSlotDestructedFlag() { return false; }
183 static bool aggValueSlotGC() { return false; }
184 static bool aggValueSlotMayOverlap() { return false; }
185 static bool aggValueSlotVolatile() { return false; }
186 static bool allocToken() { return false; }
187 static bool appleArm64CXXABI() { return false; }
188 static bool appleKext() { return false; }
189 static bool asmGoto() { return false; }
190 static bool asmLabelAttr() { return false; }
191 static bool asmLLVMAssume() { return false; }
192 static bool asmMemoryEffects() { return false; }
193 static bool asmUnwindClobber() { return false; }
194 static bool asmVectorType() { return false; }
195 static bool assignMemcpyizer() { return false; }
196 static bool astVarDeclInterface() { return false; }
197 static bool attributeNoBuiltin() { return false; }
198 static bool builtinCall() { return false; }
199 static bool builtinCallF128() { return false; }
200 static bool builtinBitCountExpr() { return false; }
201 static bool builtinCheckKind() { return false; }
202 static bool cgCapturedStmtInfo() { return false; }
203 static bool countedBySize() { return false; }
204 static bool checkBitfieldClipping() { return false; }
205 static bool cirgenABIInfo() { return false; }
206 static bool cleanupAfterErrorDiags() { return false; }
207 static bool cleanupDeactivationScope() { return false; }
208 static bool cleanupsToDeactivate() { return false; }
209 static bool constEmitterArrayILE() { return false; }
210 static bool constEmitterVectorILE() { return false; }
211 static bool constantFoldSwitchStatement() { return false; }
212 static bool constructABIArgDirectExtend() { return false; }
213 static bool coverageMapping() { return false; }
214 static bool createInvariantGroup() { return false; }
215 static bool createProfileWeightsForLoop() { return false; }
216 static bool ctorConstLvalueToRvalueConversion() { return false; }
217 static bool ctorMemcpyizer() { return false; }
218 static bool cudaSupport() { return false; }
219 static bool hipModuleCtor() { return false; }
220 static bool dataLayoutTypeAllocSize() { return false; }
221 static bool dataLayoutPtrHandlingBasedOnLangAS() { return false; }
222 static bool deferredCXXGlobalInit() { return false; }
223 static bool deleteArray() { return false; }
224 static bool devirtualizeDestructor() { return false; }
225 static bool dtorCleanups() { return false; }
226 static bool ehCleanupScope() { return false; }
227 static bool emitCheckedInBoundsGEP() { return false; }
228 static bool emitCondLikelihoodViaExpectIntrinsic() { return false; }
229 static bool emitConstrainedFPCall() { return false; }
230 static bool emitLifetimeMarkers() { return false; }
231 static bool emitLValueAlignmentAssumption() { return false; }
232 static bool emitNullCheckForDeleteCalls() { return false; }
233 static bool emitNullabilityCheck() { return false; }
234 static bool emitTypeCheck() { return false; }
235 static bool emitTypeMetadataCodeForVCall() { return false; }
236 static bool isPPC_FP128Ty() { return false; }
237
238 // Fast math.
239 static bool fastMathGuard() { return false; }
240 // Should be implemented with a moduleOp level attribute and directly
241 // mapped to LLVM - those can be set directly for every relevant LLVM IR
242 // dialect operation (log10, ...).
243 static bool fastMathFlags() { return false; }
244 static bool fastMathFuncAttributes() { return false; }
245
246 static bool fpConstraints() { return false; }
247 static bool generateDebugInfo() { return false; }
248 static bool getRuntimeFunctionDecl() { return false; }
249 static bool globalViewIntLowering() { return false; }
250 static bool guardAbortOnException() { return false; }
251 static bool handleBuiltinICEArguments() { return false; }
252 static bool hip() { return false; }
253 static bool incrementProfileCounter() { return false; }
254 static bool insertBuiltinUnpredictable() { return false; }
255 static bool instrumentation() { return false; }
256 static bool intrinsicElementTypeSupport() { return false; }
257 static bool isTrivialCtorOrDtor() { return false; }
258 static bool loopInfoStack() { return false; }
259 static bool lowerAggregateLoadStore() { return false; }
260 static bool lowerModeOptLevel() { return false; }
261 static bool makeTripleAlwaysPresent() { return false; }
262 static bool maybeHandleStaticInExternC() { return false; }
263 static bool mergeAllConstants() { return false; }
264 static bool memberFuncPtrAuthInfo() { return false; }
265 static bool memberFuncPtrCast() { return false; }
266 static bool metaDataNode() { return false; }
267 static bool moduleNameHash() { return false; }
268 static bool msabi() { return false; }
269 static bool objCBlocks() { return false; }
270 static bool objCGC() { return false; }
271 static bool objCLifetime() { return false; }
272 static bool hlsl() { return false; }
273 static bool msvcBuiltins() { return false; }
274 static bool openCL() { return false; }
275 static bool openMP() { return false; }
276 static bool sycl() { return false; }
277 static bool opTBAA() { return false; }
278 static bool peepholeProtection() { return false; }
279 static bool pgoUse() { return false; }
280 static bool pointerAuthentication() { return false; }
281 static bool preservedAccessIndexRegion() { return false; }
282 static bool loopSpecificCleanupHandling() { return false; }
283 static bool returnValueSlotFeatures() { return false; }
284 static bool runCleanupsScope() { return false; }
285 static bool sanitizers() { return false; }
286 static bool setDLLStorageClass() { return false; }
287 static bool setNonGC() { return false; }
288 static bool setObjCGCLValueClass() { return false; }
289 static bool shouldSplitConstantStore() { return false; }
290 static bool shouldUseBZeroPlusStoresToInitialize() { return false; }
291 static bool shouldUseMemSetToInitialize() { return false; }
292 static bool sourceLanguageCases() { return false; }
293 static bool stackBase() { return false; }
294 static bool stackSaveOp() { return false; }
295 static bool stackProtector() { return false; }
296 static bool targetCIRGenInfoArch() { return false; }
297 static bool targetCIRGenInfoOS() { return false; }
298 static bool targetCodeGenInfoGetNullPointer() { return false; }
299 static bool thunks() { return false; }
300 static bool tryEmitAsConstant() { return false; }
301 static bool typeAwareAllocation() { return false; }
302 static bool typeChecks() { return false; }
303 static bool useEHCleanupForArray() { return false; }
304 static bool vaArgABILowering() { return false; }
305 static bool vectorConstants() { return false; }
306 static bool vlas() { return false; }
307 static bool vtableInitialization() { return false; }
308 static bool vtableEmitMetadata() { return false; }
309 static bool vtableRelativeLayout() { return false; }
310 static bool weakRefReference() { return false; }
311 static bool writebacks() { return false; }
312 static bool msvcCXXPersonality() { return false; }
313 static bool functionUsesSEHTry() { return false; }
314 static bool nothrowAttr() { return false; }
315
316 // Missing types
317 static bool dataMemberType() { return false; }
318 static bool matrixType() { return false; }
319 static bool methodType() { return false; }
320 static bool scalableVectors() { return false; }
321 static bool unsizedTypes() { return false; }
322 static bool vectorType() { return false; }
323 static bool fixedPointType() { return false; }
324 static bool stringTypeWithDifferentArraySize() { return false; }
325
326 // Future CIR operations
327 static bool callOp() { return false; }
328 static bool llvmLoweringPtrDiffConsidersPointee() { return false; }
329 static bool tryOp() { return false; }
330 static bool vecTernaryOp() { return false; }
331 static bool zextOp() { return false; }
332
333 // Future CIR attributes
334 static bool optInfoAttr() { return false; }
335
336 // Maybe only needed for Windows exception handling
337 static bool currentFuncletPad() { return false; }
338 static bool sizeOfUnwindException() { return false; }
339};
340
341} // namespace cir
342
343#endif // CLANG_CIR_MISSINGFEATURES_H
static bool globalCtorLexOrder()
static bool opCallBitcastArg()
static bool opFuncArmNewAttr()
static bool metaDataNode()
static bool builtinCheckKind()
static bool fastMathFuncAttributes()
static bool getRuntimeFunctionDecl()
static bool opCallCIRGenFuncInfoExtParamInfo()
static bool weakRefReference()
static bool functionUsesSEHTry()
static bool instrumentation()
static bool atomicInfoGetAtomicPointer()
static bool opFuncOptNoneAttr()
static bool ctorConstLvalueToRvalueConversion()
static bool dataMemberType()
static bool asmMemoryEffects()
static bool objCLifetime()
static bool memberFuncPtrCast()
static bool emitLifetimeMarkers()
static bool opLoadEmitScalarRangeCheck()
static bool addAutoInitAnnotation()
static bool addressSpace()
static bool opFuncMinSizeAttr()
static bool opGlobalUnnamedAddr()
static bool vtableEmitMetadata()
static bool emitNVVMMetadata()
static bool emitNullabilityCheck()
static bool asmLabelAttr()
static bool opAllocaNonGC()
static bool aggValueSlotDestructedFlag()
static bool msvcBuiltins()
static bool vtableInitialization()
static bool ehCleanupScope()
static bool fixedPointType()
static bool useEHCleanupForArray()
static bool handleBuiltinICEArguments()
static bool opGlobalThreadLocal()
static bool devirtualizeDestructor()
static bool aggValueSlotGC()
static bool hipModuleCtor()
static bool aggValueSlotAlias()
static bool globalViewIntLowering()
static bool createProfileWeightsForLoop()
static bool vectorConstants()
static bool opAllocaAnnotations()
static bool opFuncMultiVersioning()
static bool targetCodeGenInfoGetNullPointer()
static bool handleCUDALaunchBoundsAttr()
static bool foldRangeCase()
static bool aggValueSlotMayOverlap()
static bool opAllocaOpenMPThreadPrivate()
static bool sourceLanguageCases()
static bool guardAbortOnException()
static bool lowerAggregateLoadStore()
static bool emitTypeMetadataCodeForVCall()
static bool opFuncReadOnly()
static bool shouldSkipAliasEmission()
static bool constructABIArgDirectExtend()
static bool appleArm64CXXABI()
static bool opFuncAstDeclAttr()
static bool opCallSurroundingTry()
static bool asmVectorType()
static bool addressPointerAuthInfo()
static bool preservedAccessIndexRegion()
static bool opFuncNoDuplicateAttr()
static bool opGlobalAnnotations()
static bool opGlobalCtorPriority()
static bool mergeAllConstants()
static bool opLoadStoreAtomic()
static bool deleteArray()
static bool vecTernaryOp()
static bool zeroSizeRecordMembers()
static bool opLoadStoreTbaa()
static bool aarch64SIMDIntrinsics()
static bool checkBitfieldClipping()
static bool shouldSplitConstantStore()
static bool currentFuncletPad()
static bool opCallChain()
static bool opAllocaImpreciseLifetime()
static bool shouldUseMemSetToInitialize()
static bool nothrowAttr()
static bool stackProtector()
static bool moduleNameHash()
static bool aggEmitFinalDestCopyRValue()
static bool emitCFICheck()
static bool opCallReturn()
static bool aarch64SVEIntrinsics()
static bool emitVFEInfo()
static bool opGlobalVisibility()
static bool opAllocaStaticLocal()
static bool constEmitterArrayILE()
static bool setDLLStorageClass()
static bool opFuncUnwindTablesAttr()
static bool unsizedTypes()
static bool opFuncParameterAttributes()
static bool hiddenVisibility()
static bool targetCIRGenInfoArch()
static bool optInfoAttr()
static bool dtorCleanups()
static bool aggValueSlot()
static bool dataLayoutPtrHandlingBasedOnLangAS()
static bool builtinCallF128()
static bool cxxabiAppleARM64CXXABI()
static bool opAllocaTLS()
static bool opFuncExtraAttrs()
static bool emitWPDInfo()
static bool opCallPaddingArgs()
static bool opFuncNakedAttr()
static bool cleanupsToDeactivate()
static bool shouldUseBZeroPlusStoresToInitialize()
static bool lowerModuleLangOpts()
static bool isPPC_FP128Ty()
static bool runCleanupsScope()
static bool atomicUseLibCall()
static bool emitCheckedInBoundsGEP()
static bool opCallExtParameterInfo()
static bool loopInfoStack()
static bool emitConstrainedFPCall()
static bool atomicOpenMP()
static bool dataLayoutTypeAllocSize()
static bool attributeNoBuiltin()
static bool addressOffset()
static bool vaArgABILowering()
static bool opGlobalDLLImportExport()
static bool fpConstraints()
static bool coverageMapping()
static bool emitTypeCheck()
static bool emitCondLikelihoodViaExpectIntrinsic()
static bool constEmitterVectorILE()
static bool cleanupDeactivationScope()
static bool fastMathGuard()
static bool opGlobalPartition()
static bool opCallObjCMethod()
static bool intrinsicElementTypeSupport()
static bool addHeapAllocSiteMetadata()
static bool setObjCGCLValueClass()
static bool cirgenABIInfo()
static bool stackSaveOp()
static bool opLoadStoreObjC()
static bool lowerModeOptLevel()
static bool opGlobalPragmaClangSection()
static bool opCallArgEvaluationOrder()
static bool opGlobalWeakRef()
static bool peepholeProtection()
static bool opCallInAlloca()
static bool aarch64SMEIntrinsics()
static bool deferredCXXGlobalInit()
static bool createInvariantGroup()
static bool mayHaveIntegerOverflow()
static bool opFuncOperandBundles()
static bool isTrivialCtorOrDtor()
static bool pointerAuthentication()
static bool cleanupAfterErrorDiags()
static bool opCallCallConv()
static bool constantFoldSwitchStatement()
static bool astRecordDeclAttr()
static bool opFuncCallingConv()
static bool asmUnwindClobber()
static bool insertBuiltinUnpredictable()
static bool opCallAttrs()
static bool aarch64TblBuiltinExpr()
static bool countedBySize()
static bool aggValueSlotVolatile()
static bool opAllocaCaptureByInit()
static bool opCallMustTail()
static bool fastMathFlags()
static bool globalCtorAssociatedData()
static bool shouldReverseUnaryCondOnBoolExpr()
static bool tryEmitAsConstant()
static bool opScopeCleanupRegion()
static bool asmLLVMAssume()
static bool defaultVisibility()
static bool returnValueSlotFeatures()
static bool assignMemcpyizer()
static bool typeAwareAllocation()
static bool opFuncWillReturn()
static bool addressIsKnownNonNull()
static bool opFuncColdHotAttr()
static bool lowerModuleCodeGenOpts()
static bool opFuncExceptions()
static bool opFuncArmStreamingAttr()
static bool builtinBitCountExpr()
static bool protectedVisibility()
static bool llvmLoweringPtrDiffConsidersPointee()
static bool atomicMicrosoftVolatile()
static bool sizeOfUnwindException()
static bool cxxabiUseARMGuardVarABI()
static bool stringTypeWithDifferentArraySize()
static bool atomicTypes()
static bool ctorMemcpyizer()
static bool astVarDeclInterface()
static bool builtinCall()
static bool cxxabiUseARMMethodPtrABI()
static bool cgCapturedStmtInfo()
static bool opAllocaPreciseLifetime()
static bool cudaSupport()
static bool scalableVectors()
static bool supportIFuncAttr()
static bool opFuncMaybeHandleStaticInExternC()
static bool coroOutsideFrameMD()
static bool opAllocaEscapeByReference()
static bool opLoadStoreNontemporal()
static bool makeTripleAlwaysPresent()
static bool emitNullCheckForDeleteCalls()
static bool checkAliases()
static bool opCallFnInfoOpts()
static bool atomicSyncScopeID()
static bool memberFuncPtrAuthInfo()
static bool msvcCXXPersonality()
static bool generateDebugInfo()
static bool setDSOLocal()
static bool targetCIRGenInfoOS()
static bool vtableRelativeLayout()
static bool loopSpecificCleanupHandling()
static bool emitLValueAlignmentAssumption()
static bool opFuncMultipleReturnVals()
static bool opCallCIRGenFuncInfoParamInfo()
static bool targetLoweringInfo()
static bool maybeHandleStaticInExternC()
static bool cxxabiThisAlignment()
static bool setLLVMFunctionFEnvAttributes()
static bool atomicInfoGetAtomicAddress()
static bool incrementProfileCounter()