|
clang 24.0.0git
|
#include "clang/CIR/Dialect/IR/CIRDialect.h"#include "clang/CIR/Dialect/IR/CIRAttrs.h"#include "clang/CIR/Dialect/IR/CIROpsEnums.h"#include "clang/CIR/Dialect/IR/CIRTypes.h"#include "mlir/IR/Attributes.h"#include "mlir/IR/BuiltinOps.h"#include "mlir/IR/BuiltinTypes.h"#include "mlir/IR/DialectImplementation.h"#include "mlir/IR/PatternMatch.h"#include "mlir/IR/Value.h"#include "mlir/Interfaces/ControlFlowInterfaces.h"#include "mlir/Interfaces/FunctionImplementation.h"#include "mlir/Support/LLVM.h"#include "clang/CIR/Dialect/IR/CIROpsDialect.cpp.inc"#include "clang/CIR/Dialect/IR/CIROpsEnums.cpp.inc"#include "clang/CIR/MissingFeatures.h"#include "llvm/ADT/SetOperations.h"#include "llvm/ADT/SmallSet.h"#include "llvm/ADT/TypeSwitch.h"#include "llvm/Support/Casting.h"#include "llvm/Support/LogicalResult.h"#include "CIRDialectBytecode.h"#include "clang/CIR/Dialect/IR/CIROps.cpp.inc"Go to the source code of this file.
Macros | |
| #define | GET_OP_LIST |
| #define | REGISTER_ENUM_TYPE(Ty) |
| #define | GET_OP_CLASSES |
Functions | |
| static bool | isOpenCLVersionAttrName (StringRef attrName) |
| static LogicalResult | verifyOpenCLVersionAttrPlacement (Operation *op, NamedAttribute attr) |
| static bool | areOpenCLVersionsCompatible (cir::OpenCLVersionAttr openCLVersion, cir::OpenCLVersionAttr cxxVersion) |
| static LogicalResult | verifyOpenCLCXXVersion (ModuleOp module, cir::OpenCLVersionAttr cxxVersion) |
| static LogicalResult | verifyOpenCLVersionAttr (Operation *op, NamedAttribute attr) |
| static LogicalResult | verifyOffloadKind (mlir::ModuleOp module, cir::OffloadKind expected) |
| static LogicalResult | verifyOffloadContainer (mlir::Operation *op) |
| static int | parseOptionalKeywordAlternative (AsmParser &parser, ArrayRef< llvm::StringRef > keywords) |
| template<typename EnumTy, typename RetTy = EnumTy> | |
| static RetTy | parseOptionalCIRKeyword (AsmParser &parser, EnumTy defaultValue) |
| Parse an enum from the keyword, or default to the provided default value. | |
| template<typename EnumTy, typename RetTy = EnumTy> | |
| static ParseResult | parseCIRKeyword (AsmParser &parser, RetTy &result) |
| Parse an enum from the keyword, return failure if the keyword is not found. | |
| static LogicalResult | ensureRegionTerm (OpAsmParser &parser, Region ®ion, SMLoc errLoc) |
| static bool | omitRegionTerm (mlir::Region &r) |
| template<typename ExpectedProducerOp> | |
| static LogicalResult | verifyProducedBy (Operation *op, Value operand, StringRef operandName) |
| ParseResult | parseInlineKindAttr (OpAsmParser &parser, cir::InlineKindAttr &inlineKindAttr) |
| void | printInlineKindAttr (OpAsmPrinter &p, cir::InlineKindAttr inlineKindAttr) |
| static mlir::ParseResult | parseOmittedTerminatorRegion (mlir::OpAsmParser &parser, mlir::Region ®ion) |
| static void | printOmittedTerminatorRegion (mlir::OpAsmPrinter &printer, cir::ScopeOp &op, mlir::Region ®ion) |
| mlir::OptionalParseResult | parseGlobalMemorySpace (mlir::AsmParser &p, mlir::ptr::MemorySpaceAttrInterface &attr) |
| void | printGlobalMemorySpace (mlir::AsmPrinter &printer, cir::GlobalOp op, mlir::ptr::MemorySpaceAttrInterface attr) |
| template<typename Op> | |
| static LogicalResult | verifyArrayCtorDtor (Op op) |
| static void | printAssumeBundle (OpAsmPrinter &p, cir::AssumeOp op, cir::AssumeBundleKindAttr kindAttr, OperandRange bundleArgs, TypeRange bundleArgTypes) |
| static ParseResult | parseAssumeBundle (OpAsmParser &p, cir::AssumeBundleKindAttr &bundleKindAttr, llvm::SmallVector< mlir::OpAsmParser::UnresolvedOperand, 4 > &bundleArgs, llvm::SmallVector< mlir::Type, 1 > &bundleArgTypes) |
| static bool | isInVarCtorRegion (mlir::Operation *op) |
Returns true if op is nested in the ctor region of a cir.global or cir.local_init without crossing a cir.func or a cir.register_exit_dtor. | |
| template<typename LoopOpTy> | |
| static LogicalResult | verifyLoopCleanup (LoopOpTy op) |
| static LogicalResult | checkConstantTypes (mlir::Operation *op, mlir::Type opType, mlir::Attribute attrType) |
| static bool | isFloatingPointCastKind (cir::CastKind kind) |
| static bool | isIntOrBoolCast (cir::CastOp op) |
| static bool | isCirFunctionPointerType (mlir::Type ty) |
| static Value | tryFoldCastChain (cir::CastOp op) |
| static mlir::ParseResult | parseTryCallDestinations (mlir::OpAsmParser &parser, mlir::OperationState &result) |
| static ParseResult | checkEffectAttrKinds (mlir::OpAsmParser &parser, llvm::SMLoc loc, const mlir::NamedAttrList &attrs) |
| Reject an attribute in an explicit attribute dictionary whose value is not the attribute class expected for its name. | |
| static mlir::ParseResult | parseCallCommon (mlir::OpAsmParser &parser, mlir::OperationState &result, bool hasDestinationBlocks=false) |
| static void | printCallCommon (mlir::Operation *op, mlir::FlatSymbolRefAttr calleeSym, mlir::Value indirectCallee, mlir::OpAsmPrinter &printer, bool isNothrow, ArrayAttr argAttrs, ArrayAttr resAttrs, mlir::Block *normalDest=nullptr, mlir::Block *unwindDest=nullptr) |
| static LogicalResult | verifyCallCommInSymbolUses (mlir::Operation *op, SymbolTableCollection &symbolTable) |
| static mlir::LogicalResult | checkReturnAndFunction (cir::ReturnOp op, cir::FuncOp function) |
| static bool | isRedundantBeforeReturn (mlir::Region &cleanupRegion) |
| ParseResult | parseIndirectBrOpSucessors (OpAsmParser &parser, Type &flagType, SmallVectorImpl< Block * > &succOperandBlocks, SmallVectorImpl< SmallVector< OpAsmParser::UnresolvedOperand > > &succOperands, SmallVectorImpl< SmallVector< Type > > &succOperandsTypes) |
| void | printIndirectBrOpSucessors (OpAsmPrinter &p, cir::IndirectBrOp op, Type flagType, SuccessorRange succs, OperandRangeRange succOperands, const TypeRangeRange &succOperandsTypes) |
| static ParseResult | parseSwitchFlatOpCases (OpAsmParser &parser, Type flagType, mlir::ArrayAttr &caseValues, SmallVectorImpl< Block * > &caseDestinations, SmallVectorImpl< llvm::SmallVector< OpAsmParser::UnresolvedOperand > > &caseOperands, SmallVectorImpl< llvm::SmallVector< Type > > &caseOperandTypes) |
| <cases> ::= [ (case (, case )* )? | |
| static void | printSwitchFlatOpCases (OpAsmPrinter &p, cir::SwitchFlatOp op, Type flagType, mlir::ArrayAttr caseValues, SuccessorRange caseDestinations, OperandRangeRange caseOperands, const TypeRangeRange &caseOperandTypes) |
| static ParseResult | parseConstantValue (OpAsmParser &parser, mlir::Attribute &valueAttr) |
| static void | printConstant (OpAsmPrinter &p, Attribute value) |
| static void | printComdatName (OpAsmPrinter &p, StringAttr comdat) |
| static void | printComdatName (OpAsmPrinter &p, cir::GlobalOp op, StringAttr comdat) |
| static ParseResult | parseComdatName (OpAsmParser &parser, StringAttr &comdatAttr) |
| static void | printGlobalOpTypeAndInitialValue (OpAsmPrinter &p, cir::GlobalOp op, TypeAttr type, Attribute initAttr, mlir::Region &ctorRegion, mlir::Region &dtorRegion) |
| static ParseResult | parseGlobalOpTypeAndInitialValue (OpAsmParser &parser, TypeAttr &typeAttr, Attribute &initialValueAttr, mlir::Region &ctorRegion, mlir::Region &dtorRegion) |
| static llvm::StringRef | getLinkageAttrNameString () |
| Returns the name used for the linkage attribute. | |
| static bool | isFuncAttrInDict (llvm::StringRef name) |
| Declared cir.func attributes with no dedicated syntax, which print in and parse from the attribute dictionary instead. | |
| static LogicalResult | verifyMemberPtrCast (Operation *op, mlir::Value src, mlir::Type resultTy) |
| static void | printCopyTypes (mlir::OpAsmPrinter &printer, mlir::Operation *, mlir::Type srcType, mlir::Type dstType) |
| static mlir::ParseResult | parseCopyTypes (mlir::OpAsmParser &parser, mlir::Type &srcType, mlir::Type &dstType) |
| static mlir::Type | memberPointeeType (cir::RecordType recordTy, unsigned idx) |
| static OpFoldResult | foldUnaryBitOp (mlir::Attribute inputAttr, llvm::function_ref< llvm::APInt(const llvm::APInt &)> func, bool poisonZero=false) |
| template<typename ThrowOpTy> | |
| static mlir::LogicalResult | verifyThrowOpImpl (ThrowOpTy op) |
| static LogicalResult | verifyCatchParamPairing (mlir::Region &handlerRegion, cir::ConstructCatchParamOp constructOp) |
Verify that each cir.init_catch_param in handlerRegion, outside any nested cir.try, agrees with the handler's leading cir.construct_catch_param constructOp, which may be null. | |
| static void | printTryHandlerRegions (mlir::OpAsmPrinter &printer, cir::TryOp op, mlir::MutableArrayRef< mlir::Region > handlerRegions, mlir::ArrayAttr handlerTypes) |
| static mlir::ParseResult | parseTryHandlerRegions (mlir::OpAsmParser &parser, llvm::SmallVectorImpl< std::unique_ptr< mlir::Region > > &handlerRegions, mlir::ArrayAttr &handlerTypes) |
| static std::optional< unsigned > | getRecordedIntegerWidth (mlir::Attribute attr) |
| Reads a fundamental integer width from a signless i32 attribute. | |
| static LogicalResult | verifyCatchParamAddr (mlir::Operation *op, cir::InitCatchKind kind, cir::PointerType paramAddrType) |
For the reference_to_pointer and reference_to_record_pointer kinds, emit an error on op unless paramAddrType is the type of the address of a reference to a pointer. | |
| static ParseResult | parseEhDispatchDestinations (OpAsmParser &parser, mlir::ArrayAttr &catchTypes, SmallVectorImpl< Block * > &catchDestinations, Block *&defaultDestination, mlir::UnitAttr &defaultIsCatchAll) |
| static void | printEhDispatchDestinations (OpAsmPrinter &p, cir::EhDispatchOp op, mlir::ArrayAttr catchTypes, SuccessorRange catchDestinations, Block *defaultDestination, mlir::UnitAttr defaultIsCatchAll) |
| #define GET_OP_CLASSES |
Definition at line 5819 of file CIRDialect.cpp.
| #define GET_OP_LIST |
| #define REGISTER_ENUM_TYPE | ( | Ty | ) |
Definition at line 326 of file CIRDialect.cpp.
|
static |
Definition at line 134 of file CIRDialect.cpp.
Referenced by verifyOpenCLCXXVersion().
|
static |
Definition at line 828 of file CIRDialect.cpp.
|
static |
Reject an attribute in an explicit attribute dictionary whose value is not the attribute class expected for its name.
Where an op declares the attribute it is stored as a property, so a value of the wrong class would be dropped without a diagnostic.
Definition at line 1398 of file CIRDialect.cpp.
Referenced by parseCallCommon().
|
static |
Definition at line 1792 of file CIRDialect.cpp.
|
static |
Definition at line 370 of file CIRDialect.cpp.
Referenced by parseGlobalOpTypeAndInitialValue(), and parseOmittedTerminatorRegion().
|
static |
Definition at line 4694 of file CIRDialect.cpp.
|
static |
Returns the name used for the linkage attribute.
This must correspond to the name of the attribute in ODS.
Definition at line 2822 of file CIRDialect.cpp.
|
static |
Reads a fundamental integer width from a signless i32 attribute.
Definition at line 5477 of file CIRDialect.cpp.
References cir::isValidFundamentalIntWidth().
|
static |
Definition at line 1179 of file CIRDialect.cpp.
Referenced by tryFoldCastChain().
|
static |
Definition at line 902 of file CIRDialect.cpp.
References kind.
|
static |
Declared cir.func attributes with no dedicated syntax, which print in and parse from the attribute dictionary instead.
Definition at line 2826 of file CIRDialect.cpp.
|
static |
|
static |
Returns true if op is nested in the ctor region of a cir.global or cir.local_init without crossing a cir.func or a cir.register_exit_dtor.
Definition at line 702 of file CIRDialect.cpp.
|
static |
Definition at line 118 of file CIRDialect.cpp.
|
static |
Definition at line 2006 of file CIRDialect.cpp.
|
static |
Definition at line 4106 of file CIRDialect.cpp.
References cir::RecordType::getMembers(), and cir::memberStorageType().
|
static |
Definition at line 397 of file CIRDialect.cpp.
Referenced by printOmittedTerminatorRegion().
|
static |
Definition at line 614 of file CIRDialect.cpp.
|
static |
Definition at line 1432 of file CIRDialect.cpp.
References checkEffectAttrKinds(), parseCIRKeyword(), and parseTryCallDestinations().
|
static |
Parse an enum from the keyword, return failure if the keyword is not found.
Definition at line 356 of file CIRDialect.cpp.
References parseOptionalKeywordAlternative().
Referenced by parseCallCommon().
|
static |
Definition at line 2595 of file CIRDialect.cpp.
|
static |
Definition at line 2444 of file CIRDialect.cpp.
Referenced by parseGlobalOpTypeAndInitialValue().
|
static |
Definition at line 3987 of file CIRDialect.cpp.
|
static |
Definition at line 5617 of file CIRDialect.cpp.
| mlir::OptionalParseResult parseGlobalMemorySpace | ( | mlir::AsmParser & | p, |
| mlir::ptr::MemorySpaceAttrInterface & | attr ) |
Definition at line 1749 of file CIRTypes.cpp.
References parseMemorySpace().
|
static |
Definition at line 2640 of file CIRDialect.cpp.
References ensureRegionTerm(), and parseConstantValue().
| ParseResult parseIndirectBrOpSucessors | ( | OpAsmParser & | parser, |
| Type & | flagType, | ||
| SmallVectorImpl< Block * > & | succOperandBlocks, | ||
| SmallVectorImpl< SmallVector< OpAsmParser::UnresolvedOperand > > & | succOperands, | ||
| SmallVectorImpl< SmallVector< Type > > & | succOperandsTypes ) |
Definition at line 2198 of file CIRDialect.cpp.
| ParseResult parseInlineKindAttr | ( | OpAsmParser & | parser, |
| cir::InlineKindAttr & | inlineKindAttr ) |
Definition at line 423 of file CIRDialect.cpp.
|
static |
Definition at line 459 of file CIRDialect.cpp.
References ensureRegionTerm().
|
static |
Parse an enum from the keyword, or default to the provided default value.
The return type is the enum type by default, unless overriden with the second template argument.
Definition at line 343 of file CIRDialect.cpp.
References parseOptionalKeywordAlternative().
|
static |
Definition at line 314 of file CIRDialect.cpp.
Referenced by parseCIRKeyword(), and parseOptionalCIRKeyword().
|
static |
<cases> ::= [ (case (, case )* )?
] <case> ::= integer : bb-id (( ssa-use-and-type-list ))?
Definition at line 2367 of file CIRDialect.cpp.
|
static |
Definition at line 1376 of file CIRDialect.cpp.
Referenced by parseCallCommon().
|
static |
Definition at line 5317 of file CIRDialect.cpp.
|
static |
Definition at line 595 of file CIRDialect.cpp.
References kind.
|
static |
Definition at line 1554 of file CIRDialect.cpp.
|
static |
Definition at line 2590 of file CIRDialect.cpp.
References printComdatName().
|
static |
Definition at line 2582 of file CIRDialect.cpp.
Referenced by printComdatName().
|
static |
Definition at line 2450 of file CIRDialect.cpp.
Referenced by printGlobalOpTypeAndInitialValue().
|
static |
Definition at line 3978 of file CIRDialect.cpp.
|
static |
Definition at line 5756 of file CIRDialect.cpp.
| void printGlobalMemorySpace | ( | mlir::AsmPrinter & | printer, |
| cir::GlobalOp | op, | ||
| mlir::ptr::MemorySpaceAttrInterface | attr ) |
Definition at line 1758 of file CIRTypes.cpp.
References printMemorySpace().
|
static |
Definition at line 2609 of file CIRDialect.cpp.
References printConstant().
| void printIndirectBrOpSucessors | ( | OpAsmPrinter & | p, |
| cir::IndirectBrOp | op, | ||
| Type | flagType, | ||
| SuccessorRange | succs, | ||
| OperandRangeRange | succOperands, | ||
| const TypeRangeRange & | succOperandsTypes ) |
Definition at line 2230 of file CIRDialect.cpp.
| void printInlineKindAttr | ( | OpAsmPrinter & | p, |
| cir::InlineKindAttr | inlineKindAttr ) |
Definition at line 449 of file CIRDialect.cpp.
|
static |
Definition at line 469 of file CIRDialect.cpp.
References omitRegionTerm().
|
static |
Definition at line 2410 of file CIRDialect.cpp.
|
static |
Definition at line 5275 of file CIRDialect.cpp.
|
static |
Definition at line 1184 of file CIRDialect.cpp.
References isCirFunctionPointerType(), and isIntOrBoolCast().
|
static |
Definition at line 513 of file CIRDialect.cpp.
|
static |
Definition at line 1661 of file CIRDialect.cpp.
References cir::MissingFeatures::opCallCallConv().
|
static |
For the reference_to_pointer and reference_to_record_pointer kinds, emit an error on op unless paramAddrType is the type of the address of a reference to a pointer.
Any other kind is accepted.
Definition at line 5527 of file CIRDialect.cpp.
References kind.
|
static |
Verify that each cir.init_catch_param in handlerRegion, outside any nested cir.try, agrees with the handler's leading cir.construct_catch_param constructOp, which may be null.
A cir.init_catch_param of kind reference_to_pointer or non_trivial_copy needs constructOp on its parameter, and a cir.init_catch_param on the parameter of constructOp must have the kind of constructOp.
Definition at line 5131 of file CIRDialect.cpp.
References kind.
|
static |
Definition at line 801 of file CIRDialect.cpp.
|
static |
Definition at line 3631 of file CIRDialect.cpp.
References cir::MissingFeatures::memberFuncPtrCast().
|
static |
Definition at line 221 of file CIRDialect.cpp.
References verifyOffloadKind().
|
static |
Definition at line 202 of file CIRDialect.cpp.
Referenced by verifyOffloadContainer().
|
static |
Definition at line 142 of file CIRDialect.cpp.
References areOpenCLVersionsCompatible().
Referenced by verifyOpenCLVersionAttr().
|
static |
Definition at line 162 of file CIRDialect.cpp.
References verifyOpenCLCXXVersion(), and verifyOpenCLVersionAttrPlacement().
|
static |
Definition at line 124 of file CIRDialect.cpp.
Referenced by verifyOpenCLVersionAttr().
|
static |
Definition at line 409 of file CIRDialect.cpp.
|
static |
Definition at line 5041 of file CIRDialect.cpp.