diff --git a/include/vast/Dialect/ABI/ABI.td b/include/vast/Dialect/ABI/ABI.td index 4358b19e97..315b3f3392 100644 --- a/include/vast/Dialect/ABI/ABI.td +++ b/include/vast/Dialect/ABI/ABI.td @@ -8,7 +8,6 @@ include "mlir/IR/OpAsmInterface.td" include "mlir/IR/SymbolInterfaces.td" include "mlir/Interfaces/SideEffectInterfaces.td" include "mlir/Interfaces/InferTypeOpInterface.td" -include "mlir/IR/RegionKindInterface.td" include "vast/Dialect/Core/Interfaces/SymbolInterface.td" diff --git a/include/vast/Dialect/Builtin/Builtin.td b/include/vast/Dialect/Builtin/Builtin.td index 91918019ad..baf2804e71 100644 --- a/include/vast/Dialect/Builtin/Builtin.td +++ b/include/vast/Dialect/Builtin/Builtin.td @@ -8,7 +8,6 @@ include "mlir/IR/OpAsmInterface.td" include "mlir/IR/SymbolInterfaces.td" include "mlir/Interfaces/SideEffectInterfaces.td" include "mlir/Interfaces/InferTypeOpInterface.td" -include "mlir/IR/RegionKindInterface.td" include "mlir/IR/BuiltinAttributeInterfaces.td" def HLBuiltin_Dialect : Dialect { diff --git a/include/vast/Dialect/Core/CoreOps.td b/include/vast/Dialect/Core/CoreOps.td index 7b780bfe38..47636950d2 100644 --- a/include/vast/Dialect/Core/CoreOps.td +++ b/include/vast/Dialect/Core/CoreOps.td @@ -7,7 +7,6 @@ include "mlir/IR/OpBase.td" include "mlir/Dialect/DLTI/DLTIBase.td" include "mlir/Interfaces/DataLayoutInterfaces.td" -include "mlir/IR/RegionKindInterface.td" include "vast/Dialect/Core/CoreTraits.td" include "vast/Dialect/Core/Interfaces/SymbolTableInterface.td" @@ -77,8 +76,7 @@ def Core_ScopeOp : Core_Op< "scope", [ NoTerminator, Core_ScopeLikeTrait, Core_ShadowingSymbolTable< [ [Core_VarSymbol, Core_TypeSymbol], [Core_ElaboratedTypeSymbol] - ] >, - DeclareOpInterfaceMethods + ] > ] > { let summary = "VAST scope declaration"; let description = [{ diff --git a/include/vast/Dialect/Core/Func.td b/include/vast/Dialect/Core/Func.td index 7ddf0526cb..33ec007e56 100644 --- a/include/vast/Dialect/Core/Func.td +++ b/include/vast/Dialect/Core/Func.td @@ -4,7 +4,6 @@ #define VAST_DIALECT_CORE_FUNC include "mlir/IR/OpBase.td" -include "mlir/IR/RegionKindInterface.td" include "mlir/Interfaces/CallInterfaces.td" include "mlir/Interfaces/FunctionInterfaces.td" @@ -38,8 +37,7 @@ class Core_FuncBaseOp< Dialect dialect, string mnemonic, list< Trait > traits = FunctionOpInterface, IsolatedFromAbove, Core_FuncSymbol, - NoTerminator, - DeclareOpInterfaceMethods< RegionKindInterface > + NoTerminator ]) > { let summary = "VAST function template"; diff --git a/include/vast/Dialect/HighLevel/HighLevel.td b/include/vast/Dialect/HighLevel/HighLevel.td index 49a9b822fe..3117464202 100644 --- a/include/vast/Dialect/HighLevel/HighLevel.td +++ b/include/vast/Dialect/HighLevel/HighLevel.td @@ -8,7 +8,6 @@ include "mlir/IR/OpAsmInterface.td" include "mlir/IR/SymbolInterfaces.td" include "mlir/Interfaces/SideEffectInterfaces.td" include "mlir/Interfaces/InferTypeOpInterface.td" -include "mlir/IR/RegionKindInterface.td" include "mlir/IR/BuiltinAttributeInterfaces.td" include "vast/Dialect/Core/Interfaces/SymbolInterface.td" diff --git a/include/vast/Dialect/HighLevel/HighLevelCF.td b/include/vast/Dialect/HighLevel/HighLevelCF.td index 8b79c65131..fef8bb7320 100644 --- a/include/vast/Dialect/HighLevel/HighLevelCF.td +++ b/include/vast/Dialect/HighLevel/HighLevelCF.td @@ -10,7 +10,7 @@ include "vast/Dialect/Core/Interfaces/SymbolInterface.td" class HighLevel_ControlFlowOp< string mnemonic, list< Trait > traits = [] > : HighLevel_Op< mnemonic, !listconcat(traits, - [NoTerminator, NoRegionArguments, DeclareOpInterfaceMethods] + [NoTerminator, NoRegionArguments] ) > { let summary = "VAST control flow operation"; @@ -254,7 +254,7 @@ def HighLevel_ChooseExprOp : HighLevel_ControlFlowOp< "choose_expr" > def HighLevel_BinaryCondOp : HighLevel_Op< "binary_cond", - [NoTerminator, DeclareOpInterfaceMethods] + [NoTerminator] > , Results<(outs AnyType:$result)> { diff --git a/include/vast/Dialect/HighLevel/HighLevelOps.td b/include/vast/Dialect/HighLevel/HighLevelOps.td index 995337970b..2c6550737e 100644 --- a/include/vast/Dialect/HighLevel/HighLevelOps.td +++ b/include/vast/Dialect/HighLevel/HighLevelOps.td @@ -1472,7 +1472,7 @@ def HighLevel_OffsetOfExprOp } def HighLevel_StmtExprOp - : HighLevel_Op< "stmt.expr", [SingleBlock, DeclareOpInterfaceMethods] > + : HighLevel_Op< "stmt.expr", [SingleBlock] > , Results<(outs AnyType:$result)> { let summary = "VAST statement expression"; diff --git a/include/vast/Dialect/LowLevel/LowLevel.td b/include/vast/Dialect/LowLevel/LowLevel.td index 0d4f327405..4b6af4307e 100644 --- a/include/vast/Dialect/LowLevel/LowLevel.td +++ b/include/vast/Dialect/LowLevel/LowLevel.td @@ -8,7 +8,6 @@ include "mlir/IR/OpAsmInterface.td" include "mlir/IR/SymbolInterfaces.td" include "mlir/Interfaces/SideEffectInterfaces.td" include "mlir/Interfaces/InferTypeOpInterface.td" -include "mlir/IR/RegionKindInterface.td" include "vast/Dialect/Core/Interfaces/SymbolInterface.td" diff --git a/include/vast/Dialect/LowLevel/LowLevelOps.td b/include/vast/Dialect/LowLevel/LowLevelOps.td index da339e0b64..522f2ef0db 100644 --- a/include/vast/Dialect/LowLevel/LowLevelOps.td +++ b/include/vast/Dialect/LowLevel/LowLevelOps.td @@ -324,37 +324,6 @@ def LowLevel_ReturnOp let assemblyFormat = "($result^ `:` type($result))? attr-dict"; } -def LowLevel_Scope - : LowLevel_Op< "scope", [ - NoRegionArguments, - NoTerminator, - Core_ScopeLikeTrait, - Core_ShadowingSymbolTable< [ - [Core_VarSymbol, Core_TypeSymbol], [Core_ElaboratedTypeSymbol] - ] > - ] > -{ - let summary = "Scope, holds one region."; - let description = [{ Scope that holds one region, each block should be terminated - with either branch, scope return or their conditional variants. }]; - - let regions = (region AnyRegion:$body); - - let extraClassDeclaration = [{ - mlir::Block *start_block() - { - auto size = std::distance(getBody().begin(), getBody().end()); - if (size < 2) - return nullptr; - return &*std::next(getBody().begin()); - } - }]; - - let assemblyFormat = [{ - $body attr-dict - }]; -} - def LowLevel_InlineScope : LowLevel_Op< "inline_scope", [NoRegionArguments] > { diff --git a/include/vast/Dialect/Meta/Meta.td b/include/vast/Dialect/Meta/Meta.td index 7b85a959fb..441285c8f0 100644 --- a/include/vast/Dialect/Meta/Meta.td +++ b/include/vast/Dialect/Meta/Meta.td @@ -8,7 +8,6 @@ include "mlir/IR/OpAsmInterface.td" include "mlir/IR/SymbolInterfaces.td" include "mlir/Interfaces/SideEffectInterfaces.td" include "mlir/Interfaces/InferTypeOpInterface.td" -include "mlir/IR/RegionKindInterface.td" include "vast/Dialect/Core/Interfaces/SymbolInterface.td" diff --git a/include/vast/Util/Dialect.hpp b/include/vast/Util/Dialect.hpp deleted file mode 100644 index 2e51e20026..0000000000 --- a/include/vast/Util/Dialect.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2023-present, Trail of Bits, Inc. - -#define GRAPH_REGION_OP( op ) mlir::RegionKind op::getRegionKind(unsigned index) { \ - return mlir::RegionKind::Graph; \ - } - -#define SSACFG_REGION_OP( op ) mlir::RegionKind op::getRegionKind(unsigned index) { \ - return mlir::RegionKind::SSACFG; \ - } diff --git a/lib/vast/Conversion/FromHL/ToLLCF.cpp b/lib/vast/Conversion/FromHL/ToLLCF.cpp index 4f609a9565..6ee7d805da 100644 --- a/lib/vast/Conversion/FromHL/ToLLCF.cpp +++ b/lib/vast/Conversion/FromHL/ToLLCF.cpp @@ -313,7 +313,7 @@ namespace vast::conv { auto &&finish_control_flow ) const { auto bld = rewriter_wrapper_t(rewriter); - auto scope = rewriter.create< ll::Scope >(op.getLoc()); + auto scope = rewriter.create< core::ScopeOp >(op.getLoc()); auto scope_entry = rewriter.createBlock(&scope.getBody()); auto &cond_region = op.getCondRegion(); @@ -401,7 +401,7 @@ namespace vast::conv { op_t op, typename op_t::Adaptor ops, conversion_rewriter &rewriter ) const override { auto bld = rewriter_wrapper_t(rewriter); - auto scope = rewriter.create< ll::Scope >(op.getLoc()); + auto scope = rewriter.create< core::ScopeOp >(op.getLoc()); auto scope_entry = rewriter.createBlock(&scope.getBody()); auto make_inline_region = [&](auto &®) { @@ -466,33 +466,9 @@ namespace vast::conv { } }; - template< typename op_t, typename trg_t > - struct replace_scope : base_pattern< op_t > - { - using parent_t = base_pattern< op_t >; - using parent_t::parent_t; - - mlir::LogicalResult matchAndRewrite( - op_t op, typename op_t::Adaptor ops, conversion_rewriter &rewriter - ) const override { - auto new_scope = rewriter.create< trg_t >(op.getLoc(), ops.getOperands()); - auto &front_block = new_scope.getBody().emplaceBlock(); - rewriter.inlineRegionBefore(op.getBody(), &front_block); - - rewriter.replaceOp(op, new_scope); - return mlir::success(); - } - - static void legalize(conversion_target &trg) { - trg.addIllegalOp< op_t >(); - trg.addLegalOp< trg_t >(); - } - }; - using cf_patterns = util::make_list< if_op, while_op, for_op, do_op, replace< hl::ReturnOp, ll::ReturnOp >, - replace< core::ImplicitReturnOp, ll::ReturnOp >, - replace_scope< core::ScopeOp, ll::Scope > + replace< core::ImplicitReturnOp, ll::ReturnOp > >; } // namespace pattern @@ -522,7 +498,7 @@ namespace vast::conv { } void run_after_conversion() { - auto clean_scopes = [&](ll::Scope scope) { + auto clean_scopes = [&](core::ScopeOp scope) { mlir::IRRewriter rewriter{ &this->getContext() }; // We really don't care if anything was removed or not. std::ignore = mlir::eraseUnreachableBlocks(rewriter, scope.getBody()); diff --git a/lib/vast/Conversion/ToLLVM/IRsToLLVM.cpp b/lib/vast/Conversion/ToLLVM/IRsToLLVM.cpp index 99141c59b9..a24d6d942f 100644 --- a/lib/vast/Conversion/ToLLVM/IRsToLLVM.cpp +++ b/lib/vast/Conversion/ToLLVM/IRsToLLVM.cpp @@ -291,7 +291,7 @@ namespace vast::conv::irstollvm }; using label_stmt = hl_scopelike< hl::LabelStmt >; - using scope_op = hl_scopelike< ll::Scope >; + using scope_op = hl_scopelike< core::ScopeOp >; using label_patterns = util::type_list< erase_pattern< hl::LabelDeclOp >, label_stmt >; diff --git a/lib/vast/Dialect/ABI/ABIOps.cpp b/lib/vast/Dialect/ABI/ABIOps.cpp index e720e2f8b8..db64a1c437 100644 --- a/lib/vast/Dialect/ABI/ABIOps.cpp +++ b/lib/vast/Dialect/ABI/ABIOps.cpp @@ -11,8 +11,6 @@ VAST_RELAX_WARNINGS #include VAST_UNRELAX_WARNINGS -#include "vast/Util/Dialect.hpp" - #include "vast/Dialect/Core/Func.hpp" namespace vast::abi @@ -112,8 +110,6 @@ namespace vast::abi setOperand(0, callee.get< mlir_value >()); } - SSACFG_REGION_OP( FuncOp ); - logical_result FuncOp::verify() { return core::verifyFuncOp(*this); } diff --git a/lib/vast/Dialect/Core/CoreOps.cpp b/lib/vast/Dialect/Core/CoreOps.cpp index 5937a8857c..4a13144d3c 100644 --- a/lib/vast/Dialect/Core/CoreOps.cpp +++ b/lib/vast/Dialect/Core/CoreOps.cpp @@ -6,7 +6,6 @@ #include "vast/Dialect/Core/CoreAttributes.hpp" #include "vast/Util/Common.hpp" -#include "vast/Util/Dialect.hpp" #include #include @@ -25,8 +24,6 @@ namespace vast::core { - GRAPH_REGION_OP(ScopeOp); - // // ModuleOp // diff --git a/lib/vast/Dialect/Core/Func.cpp b/lib/vast/Dialect/Core/Func.cpp index 16daba5ac5..7ce19bc2d3 100644 --- a/lib/vast/Dialect/Core/Func.cpp +++ b/lib/vast/Dialect/Core/Func.cpp @@ -18,7 +18,6 @@ VAST_UNRELAX_WARNINGS #include "vast/Dialect/Core/Linkage.hpp" #include "vast/Util/Common.hpp" -#include "vast/Util/Dialect.hpp" #include "vast/Util/Region.hpp" namespace vast::core diff --git a/lib/vast/Dialect/HighLevel/HighLevelOps.cpp b/lib/vast/Dialect/HighLevel/HighLevelOps.cpp index 2eb3bc6a4e..139c0c2f6f 100644 --- a/lib/vast/Dialect/HighLevel/HighLevelOps.cpp +++ b/lib/vast/Dialect/HighLevel/HighLevelOps.cpp @@ -33,7 +33,6 @@ VAST_UNRELAX_WARNINGS #include "vast/Dialect/Core/SymbolTable.hpp" #include "vast/Util/Common.hpp" -#include "vast/Util/Dialect.hpp" #include "vast/Util/Region.hpp" #include "vast/Util/TypeUtils.hpp" #include "vast/Util/Enum.hpp" @@ -846,23 +845,6 @@ namespace vast::hl st.addTypes(type); } - GRAPH_REGION_OP(FuncOp); - GRAPH_REGION_OP(StmtExprOp); - - GRAPH_REGION_OP(IfOp); - GRAPH_REGION_OP(WhileOp); - GRAPH_REGION_OP(ForOp); - GRAPH_REGION_OP(DoOp); - GRAPH_REGION_OP(SwitchOp); - GRAPH_REGION_OP(CaseOp); - GRAPH_REGION_OP(DefaultOp); - GRAPH_REGION_OP(LabelStmt); - GRAPH_REGION_OP(BreakOp); - GRAPH_REGION_OP(CondOp); - GRAPH_REGION_OP(ChooseExprOp); - GRAPH_REGION_OP(BinaryCondOp); - GRAPH_REGION_OP(ContinueOp); - std::size_t handle_size_of(auto op, mlir_type type) { auto eval = [op] (mlir_type ty) -> std::size_t { // sizeof(void), sizeof(function) = 1 as a gcc extension diff --git a/lib/vast/Dialect/LowLevel/LowLevelOps.cpp b/lib/vast/Dialect/LowLevel/LowLevelOps.cpp index ab192fa47e..96a594148f 100644 --- a/lib/vast/Dialect/LowLevel/LowLevelOps.cpp +++ b/lib/vast/Dialect/LowLevel/LowLevelOps.cpp @@ -13,7 +13,6 @@ VAST_RELAX_WARNINGS #include VAST_UNRELAX_WARNINGS -#include "vast/Util/Dialect.hpp" #include "vast/Util/Region.hpp" namespace vast::ll @@ -49,8 +48,6 @@ namespace vast::ll return core::printFunctionSignatureAndBodyImpl(printer, op, function_type, dict_attr, body); } - SSACFG_REGION_OP( FuncOp ); - } // namespace vast::ll #define GET_OP_CLASSES diff --git a/test/vast/Conversion/do-while-a.c b/test/vast/Conversion/do-while-a.c index b6e5b31dd6..4608f31470 100644 --- a/test/vast/Conversion/do-while-a.c +++ b/test/vast/Conversion/do-while-a.c @@ -3,9 +3,9 @@ // LL_CF: ll.func @fn external ([[ARG0:%.*]]: !hl.lvalue) -> none // LL_CF: hl.param @a -// LL_CF: ll.scope { +// LL_CF: core.scope { // LL_CF: hl.var @sum -// LL_CF: ll.scope { +// LL_CF: core.scope { // LL_CF: ll.br ^bb2 // LL_CF: ^bb1: // pred: ^bb2 // LL_CF: [[V8:%[0-9]+]] = hl.ref @a : !hl.lvalue diff --git a/test/vast/Conversion/do-while-b.c b/test/vast/Conversion/do-while-b.c index c633cc4b33..93b7bfc4de 100644 --- a/test/vast/Conversion/do-while-b.c +++ b/test/vast/Conversion/do-while-b.c @@ -3,9 +3,9 @@ // LL_CF: ll.func @fn external ([[ARG0:%.*]]: !hl.lvalue) -> none { // LL_CF: hl.param @a -// LL_CF: ll.scope { +// LL_CF: core.scope { // LL_CF: hl.var @sum -// LL_CF: ll.scope { +// LL_CF: core.scope { // LL_CF: ll.br ^bb2 // LL_CF: ^bb1: // pred: ^bb4 // LL_CF: [[B1V6:%[0-9]+]] = hl.const #core.integer<0> : si32 diff --git a/test/vast/Conversion/for-a.c b/test/vast/Conversion/for-a.c index 38fb08e88f..0929a7743b 100644 --- a/test/vast/Conversion/for-a.c +++ b/test/vast/Conversion/for-a.c @@ -1,7 +1,7 @@ // RUN: %check-hl-to-ll-cf %s | %file-check %s -check-prefix=LL_CF -// LL_CF: ll.scope { -// LL_CF: ll.scope { +// LL_CF: core.scope { +// LL_CF: core.scope { // LL_CF-NEXT: ll.br ^bb1 // LL_CF: ^bb1: // pred: ^bb0 diff --git a/test/vast/Conversion/for-b.c b/test/vast/Conversion/for-b.c index 342ab95529..68cbfbb9d8 100644 --- a/test/vast/Conversion/for-b.c +++ b/test/vast/Conversion/for-b.c @@ -1,6 +1,6 @@ // RUN: %check-hl-to-ll-cf %s | %file-check %s -check-prefix=LL_CF -// LL_CF: ll.scope { +// LL_CF: core.scope { // LL_CF: ll.br ^bb2 // LL_CF: ^bb1: // pred: ^bb4 // LL_CF: ll.br ^bb2 diff --git a/test/vast/Conversion/loops-a.c b/test/vast/Conversion/loops-a.c index 437a8bffa2..ae1398c2ad 100644 --- a/test/vast/Conversion/loops-a.c +++ b/test/vast/Conversion/loops-a.c @@ -1,7 +1,7 @@ // RUN: %check-hl-to-ll-cf %s | %file-check %s -check-prefix=LL_CF // RUN: %check-core-to-llvm %s | %file-check %s -check-prefix=C_LLVM -// LL_CF: ll.scope { +// LL_CF: core.scope { // LL_CF: ll.br ^bb1 // LL_CF: ^bb1: // 2 preds: ^bb0, ^bb2 // LL_CF: [[W1:%[0-9]+]] = hl.const #core.integer<0> : si32 @@ -27,7 +27,7 @@ void fn_while() { while (0) {} } -// LL_CF: ll.scope { +// LL_CF: core.scope { // LL_CF: ll.br ^bb2 // LL_CF: ^bb1: // pred: ^bb2 // LL_CF: [[DW1:%[0-9]+]] = hl.const #core.integer<0> : si32 @@ -53,7 +53,7 @@ void fn_do_while() { do {} while(0); } -// LL_CF: ll.scope { +// LL_CF: core.scope { // LL_CF: ll.br ^bb2 // LL_CF: ^bb1: // pred: ^bb3 // LL_CF: ll.br ^bb2 diff --git a/test/vast/Conversion/scope-a.c b/test/vast/Conversion/scope-a.c index 4e1add0cd8..7011d05353 100644 --- a/test/vast/Conversion/scope-a.c +++ b/test/vast/Conversion/scope-a.c @@ -3,9 +3,9 @@ void fn(int arg) { - // LL_CF: ll.scope { + // LL_CF: core.scope { // LL_CF: hl.var @a - // LL_CF: ll.scope { + // LL_CF: core.scope { // LL_CF: ll.cond_br {{.*}} : i1, ^bb1, ^bb2 // LL_CF: ^bb1: // pred: ^bb0 // LL_CF: hl.ref @a diff --git a/test/vast/Conversion/while-a.c b/test/vast/Conversion/while-a.c index 8a13ed72d6..2034e24be0 100644 --- a/test/vast/Conversion/while-a.c +++ b/test/vast/Conversion/while-a.c @@ -1,6 +1,6 @@ // RUN: %check-hl-to-ll-cf %s | %file-check %s -check-prefix=LL_CF -// LL_CF: ll.scope { +// LL_CF: core.scope { // LL_CF: ll.br ^bb1 // LL_CF: ^bb1: // 2 preds: ^bb0, ^bb2 // LL_CF: ll.cond_scope_ret {{.*}} : i1, ^bb2 diff --git a/test/vast/Conversion/while-b.c b/test/vast/Conversion/while-b.c index 806cb0b66b..9a34c083f2 100644 --- a/test/vast/Conversion/while-b.c +++ b/test/vast/Conversion/while-b.c @@ -1,6 +1,6 @@ // RUN: %check-hl-to-ll-cf %s | %file-check %s -check-prefix=LL_CF -// LL_CF: ll.scope { +// LL_CF: core.scope { // LL_CF: ll.br ^bb1 // LL_CF: ^bb1: // 2 preds: ^bb0, ^bb4 // LL_CF: ll.cond_scope_ret {{.*}} : i1, ^bb2 diff --git a/test/vast/Dialect/HighLevel/vars-c.c b/test/vast/Dialect/HighLevel/vars-c.c index 313e065ce8..86aa8a9322 100644 --- a/test/vast/Dialect/HighLevel/vars-c.c +++ b/test/vast/Dialect/HighLevel/vars-c.c @@ -1,38 +1,38 @@ // RUN: %vast-front -vast-emit-mlir=hl -o - %s | %file-check %s -// REQUIRES: non-graph-regions +// REQUIRES: loop-init-section #include int main() { - // CHECK: hl.var @y : !hl.lvalue> + // CHECK: hl.var [[Y:@y]] : !hl.lvalue> // CHECK: hl.sizeof.expr // CHECK: hl.ref [[Y]] int *y = malloc(sizeof(*y)); if(1) { - // CHECK: hl.var @x : !hl.lvalue> + // CHECK: hl.var [[X:@x]] : !hl.lvalue> // CHECK: hl.sizeof.expr // CHECK: hl.ref [[X]] int *x = malloc(sizeof(*x)); } while(1) { - // CHECK: hl.var @x : !hl.lvalue> + // CHECK: hl.var [[X:@x]] : !hl.lvalue> // CHECK: hl.sizeof.expr // CHECK: hl.ref [[X]] int *x = malloc(sizeof(*x)); } do{ - // CHECK: hl.var @x : !hl.lvalue> + // CHECK: hl.var [[X:@x]] : !hl.lvalue> // CHECK: hl.sizeof.expr // CHECK: hl.ref [[X]] int *x = malloc(sizeof(*x)); }while(0); // CHECK: core.scope - // CHECK-NEXT: hl.var @x : !hl.lvalue> + // CHECK-NEXT: hl.var [[X:@x]] : !hl.lvalue> // CHECK: hl.sizeof.expr // CHECK: hl.ref [[X]] for(int *x = malloc(sizeof(*x)); *x<100; *x++) { // CHECK: do - // CHECK-NEXT: hl.var @f : !hl.lvalue> + // CHECK-NEXT: hl.var [[F:@f]] : !hl.lvalue> // CHECK: hl.sizeof.expr // CHECK: hl.ref [[F]] int *f = malloc(sizeof(*f)); @@ -43,7 +43,7 @@ int main() { if (*y) { case 2: case 3: case 5: case 7: { // CHECK: hl.case - // CHECK: hl.var @x : !hl.lvalue> + // CHECK: hl.var [[X:@x]] : !hl.lvalue> // CHECK: hl.sizeof.expr // CHECK: hl.ref [[X]] int *x = malloc(sizeof(*x)); @@ -57,13 +57,13 @@ int main() { case 1: default: { // CHECK: hl.default - // CHECK: hl.var @z : !hl.lvalue> + // CHECK: hl.var [[Z:@z]] : !hl.lvalue> // CHECK: hl.sizeof.expr // CHECK: hl.ref [[Z]] int *z = malloc(sizeof(*z)); } } - // CHECK: hl.var @g : !hl.lvalue> + // CHECK: hl.var [[G:@g]] : !hl.lvalue> // CHECK: hl.cond // CHECK: ? // CHECK: hl.sizeof.expr @@ -73,7 +73,7 @@ int main() { int *g = y ? malloc(sizeof(*g)) : y ; ({ // CHECK: hl.stmt.expr - // CHECK: hl.var @z : !hl.lvalue> + // CHECK: hl.var [[Z:@z]] : !hl.lvalue> // CHECK: hl.sizeof.expr // CHECK: hl.ref [[Z]] int *z = malloc(sizeof(*z));