|
| const IR::Constant * | convertBoolLiteral (const IR::BoolLiteral *lit) |
| |
|
cstring | dbp (const INode *node) |
| |
|
bool | equal (const INode *a, const INode *b) |
| |
|
bool | equal (const Node *a, const Node *b) |
| |
|
bool | equiv (const INode *a, const INode *b) |
| |
|
bool | equiv (const Node *a, const Node *b) |
| |
| std::vector< const Expression * > | flattenListExpression (const BaseListExpression *listExpr) |
| |
| std::vector< const Expression * > | flattenListOrStructExpression (const Expression *listLikeExpr) |
| |
| std::vector< const Expression * > | flattenStructExpression (const StructExpression *structExpr) |
| |
|
template<class T, class U> |
| const T * | get (const IR::Vector< T > &vec, U name) |
| |
|
template<class T, class U> |
| const T * | get (const IR::Vector< T > *vec, U name) |
| |
| big_int | getBigIntFromLiteral (const Literal *l) |
| |
| const Type_Bits * | getBitTypeToFit (int value) |
| | Utility functions for generating IR nodes.
|
| |
|
const IR::Expression * | getDefaultValue (const IR::Type *type, const Util::SourceInfo &srcInfo, bool valueRequired) |
| |
| const IR::Expression * | getDefaultValue (const Type *type, const Util::SourceInfo &srcInfo={}, bool valueRequired=false) |
| |
| int | getIntFromLiteral (const Literal *l) |
| |
| big_int | getMaxBvVal (const Type *t) |
| |
| big_int | getMaxBvVal (int bitWidth) |
| |
| const IR::Constant * | getMaxValueConstant (const Type *t, const Util::SourceInfo &srcInfo) |
| |
| big_int | getMinBvVal (const Type *t) |
| |
|
const IR::Node * | inlineBlock (const Transform &t, const IR::IndexedVector< IR::StatOrDecl > &stmts) |
| |
|
const IR::Node * | inlineBlock (const Transform &t, IR::IndexedVector< IR::StatOrDecl > &&stmts) |
| |
| const IR::Node * | inlineBlock (const Transform &t, std::initializer_list< const IR::StatOrDecl * > stmts) |
| |
|
template<typename Stmts> |
| const IR::Node * | inlineBlockImpl (const Transform &t, Stmts &&stmts) |
| |
Copyright (C) 2024 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
| const IR::Node * P4::IR::inlineBlock |
( |
const Transform & | , |
|
|
std::initializer_list< const IR::StatOrDecl * > | ) |
A helper useful when returning multiple statements out of a Transform's function that should return a statement. While an IR::BlockStatement can accept a vector of statements for each of its child statements, some other places (namely IR::IfStatmenent, IR::SwitchStatement / IR::SwitchCase) only accept a statement. In these case, the visitor will fail with a BUG if the returned value is not IR::StatOrDecl. Passing the arguments through this function (or one of its overloads) works around this by wrapping the statements into a BlockStatement if the parent node cannot accept them directly.
This would be usually used as follows const IR::Node *preorder(IR::SomeStatement *stmt) { ... return IR::inlineBlock(*this, {a, b, c}); }
- Returns
- IR::IndexedVector<IR::StatOrDecl> * containing the values if the parent is IR::BlockStatement, and IR::BlockStatement * containing the values otherwise. As a special case, returns the sole statement if there is just one passed to the function.