File tree Expand file tree Collapse file tree 3 files changed +1
-52
lines changed 
include/clang/CIR/Dialect/IR Expand file tree Collapse file tree 3 files changed +1
-52
lines changed Original file line number Diff line number Diff line change 3333#include  " clang/CIR/Interfaces/CIROpInterfaces.h" 
3434#include  " clang/CIR/MissingFeatures.h" 
3535
36- namespace  mlir  {
37- namespace  OpTrait  {
38- 
39- namespace  impl  {
40- //  These functions are out-of-line implementations of the methods in the
41- //  corresponding trait classes.  This avoids them being template
42- //  instantiated/duplicated.
43- LogicalResult verifySameFirstOperandAndResultType (Operation *op);
44- } //  namespace impl
45- 
46- // / This class provides verification for ops that are known to have the same
47- // / first operand and result type.
48- // /
49- template  <typename  ConcreteType>
50- class  SameFirstOperandAndResultType 
51-     : public TraitBase<ConcreteType, SameFirstOperandAndResultType> {
52- public: 
53-   static  llvm::LogicalResult verifyTrait (Operation *op) {
54-     return  impl::verifySameFirstOperandAndResultType (op);
55-   }
56- };
57- 
58- } //  namespace OpTrait
59- } //  namespace mlir
60- 
6136using  BuilderCallbackRef =
6237    llvm::function_ref<void (mlir::OpBuilder &, mlir::Location)>;
6338using  BuilderOpStateCallbackRef = llvm::function_ref<void (
Original file line number Diff line number Diff line change @@ -80,13 +80,6 @@ class LLVMLoweringInfo {
8080class CIR_Op<string mnemonic, list<Trait> traits = []> :
8181    Op<CIR_Dialect, mnemonic, traits>, LLVMLoweringInfo;
8282
83- //===----------------------------------------------------------------------===//
84- // CIR Op Traits
85- //===----------------------------------------------------------------------===//
86- 
87- def SameFirstOperandAndResultType :
88-   NativeOpTrait<"SameFirstOperandAndResultType">;
89- 
9083//===----------------------------------------------------------------------===//
9184// CastOp
9285//===----------------------------------------------------------------------===//
@@ -243,7 +236,7 @@ def CastOp : CIR_Op<"cast",
243236//===----------------------------------------------------------------------===//
244237
245238def PtrStrideOp : CIR_Op<"ptr_stride",
246-                          [Pure, SameFirstOperandAndResultType ]> {
239+                          [Pure, AllTypesMatch<["base", "result"]> ]> {
247240  let summary = "Pointer access with stride";
248241  let description = [{
249242    Given a base pointer as first operand, provides a new pointer after applying
Original file line number Diff line number Diff line change @@ -1374,25 +1374,6 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
13741374  }
13751375}
13761376
1377- // ===----------------------------------------------------------------------===//
1378- //  CIR defined traits
1379- // ===----------------------------------------------------------------------===//
1380- 
1381- LogicalResult
1382- mlir::OpTrait::impl::verifySameFirstOperandAndResultType (Operation *op) {
1383-   if  (failed (verifyAtLeastNOperands (op, 1 )) || failed (verifyOneResult (op)))
1384-     return  failure ();
1385- 
1386-   const  Type type = op->getResult (0 ).getType ();
1387-   const  Type opType = op->getOperand (0 ).getType ();
1388- 
1389-   if  (type != opType)
1390-     return  op->emitOpError ()
1391-            << " requires the same type for first operand and result"  ;
1392- 
1393-   return  success ();
1394- }
1395- 
13961377//  TODO(CIR): The properties of functions that require verification haven't
13971378//  been implemented yet.
13981379mlir::LogicalResult cir::FuncOp::verify () { return  success (); }
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments