| 1 | //
|
|---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
|
|---|
| 3 | //
|
|---|
| 4 | // The contents of this file are covered under the licence agreement in the
|
|---|
| 5 | // file "LICENCE" distributed with Cforall.
|
|---|
| 6 | //
|
|---|
| 7 | // Inspect.hpp -- Helpers to get information from the AST.
|
|---|
| 8 | //
|
|---|
| 9 | // Author : Thierry Delisle
|
|---|
| 10 | // Created On : Fri Jun 24 13:16:31 2022
|
|---|
| 11 | // Last Modified By : Andrew Beach
|
|---|
| 12 | // Last Modified On : Thr Sep 22 13:44:00 2022
|
|---|
| 13 | // Update Count : 2
|
|---|
| 14 | //
|
|---|
| 15 |
|
|---|
| 16 | #include "AST/Fwd.hpp"
|
|---|
| 17 |
|
|---|
| 18 | namespace ast {
|
|---|
| 19 |
|
|---|
| 20 | /// Returns the base type of an pointer/array/reference type,
|
|---|
| 21 | /// if the argument is not one of those types, return null.
|
|---|
| 22 | const Type * getPointerBase( const Type * );
|
|---|
| 23 |
|
|---|
| 24 | /// Get the declaration of the function called (ApplicationExpr or UntypedExpr).
|
|---|
| 25 | const DeclWithType * getFunction( const Expr * expr );
|
|---|
| 26 |
|
|---|
| 27 | /// Get the name of the function being called.
|
|---|
| 28 | std::string getFunctionName( const Expr * expr );
|
|---|
| 29 |
|
|---|
| 30 | /// Returns the argument to a call expression in position N, indexed from 0.
|
|---|
| 31 | const Expr * getCallArg( const Expr * call, unsigned pos );
|
|---|
| 32 |
|
|---|
| 33 | /// Does the structure end in a flexable array declaration?
|
|---|
| 34 | bool structHasFlexibleArray( const StructDecl * );
|
|---|
| 35 |
|
|---|
| 36 | /// If the expression is an application whose target function is an
|
|---|
| 37 | /// intrinsic, then returns a pointer to that application.
|
|---|
| 38 | const ApplicationExpr * isIntrinsicCallExpr( const Expr * expr );
|
|---|
| 39 |
|
|---|
| 40 | }
|
|---|