source: src/AST/Inspect.hpp @ 221c542e

Last change on this file since 221c542e was fb4dc28, checked in by Andrew Beach <ajbeach@…>, 19 months ago

Moved new ast code out of one of the old files. The new file may have to change if SymTab? is removed entirely, but for now at least, there is a lot less template code in headers.

  • Property mode set to 100644
File size: 1.4 KB
Line 
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 : Fri Apr 14 15:09:00 2023
13// Update Count     : 3
14//
15
16#include "AST/Fwd.hpp"
17
18namespace 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.
22const Type * getPointerBase( const Type * );
23
24/// Get the declaration of the function called (ApplicationExpr or UntypedExpr).
25const DeclWithType * getFunction( const Expr * expr );
26
27/// Get the name of the function being called.
28std::string getFunctionName( const Expr * expr );
29
30/// Returns the argument to a call expression in position N, indexed from 0.
31const Expr * getCallArg( const Expr * call, unsigned pos );
32
33/// Does the structure end in a flexable array declaration?
34bool 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.
38const ApplicationExpr * isIntrinsicCallExpr( const Expr * expr );
39
40/// Returns true if obj's name is the empty string and it has a bitfield width.
41bool isUnnamedBitfield( const ObjectDecl * obj );
42
43}
Note: See TracBrowser for help on using the repository browser.