clang
24.0.0git
include
clang
CodeGenUtils
ExprUtils.h
Go to the documentation of this file.
1
//===--- ExprUtils.h - Shared expression emission queries -------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file holds the AST queries about expressions that both classic CodeGen
10
// and CIR CodeGen need while emitting scalar, aggregate and lvalue
11
// expressions.
12
//
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_CLANG_CODEGENUTILS_EXPRUTILS_H
16
#define LLVM_CLANG_CODEGENUTILS_EXPRUTILS_H
17
18
#include "
clang/AST/ASTContext.h
"
19
20
namespace
clang::CodeGenUtils
{
21
22
/// Strip off the variably-modified array types wrapping \p VLA and return the
23
/// first element type that has a fixed size.
24
QualType
getFixedSizeElementType
(
const
ASTContext &Ctx,
25
const
VariableArrayType *VLA);
26
27
/// Check whether the value of \p E is possibly a reference to or into a
28
/// __block variable.
29
bool
isBlockVarRef
(
const
Expr *E);
30
31
/// Check whether \p E is cheap enough and side-effect-free enough to evaluate
32
/// unconditionally instead of conditionally. This is used to convert control
33
/// flow into selects in some cases.
34
bool
isCheapEnoughToEvaluateUnconditionally
(
const
Expr *E,
35
const
ASTContext &Ctx);
36
37
/// Check whether \p E is a trivial array filler, that is, one that is
38
/// equivalent to zero-initialization.
39
bool
isTrivialFiller
(
const
Expr *E);
40
41
/// Detect the unusual situation where an inline version of a builtin is
42
/// shadowed by a non-inline version. In that case we should pick the external
43
/// one everywhere. That's GCC behavior too.
44
bool
onlyHasInlineBuiltinDeclaration
(
const
FunctionDecl *FD);
45
46
}
// namespace clang::CodeGenUtils
47
48
#endif
// LLVM_CLANG_CODEGENUTILS_EXPRUTILS_H
ASTContext.h
Defines the clang::ASTContext interface.
clang::CodeGenUtils
Definition
CallUtils.h:21
clang::CodeGenUtils::getFixedSizeElementType
QualType getFixedSizeElementType(const ASTContext &Ctx, const VariableArrayType *VLA)
Strip off the variably-modified array types wrapping VLA and return the first element type that has a...
Definition
ExprUtils.cpp:15
clang::CodeGenUtils::isTrivialFiller
bool isTrivialFiller(const Expr *E)
Check whether E is a trivial array filler, that is, one that is equivalent to zero-initialization.
Definition
ExprUtils.cpp:100
clang::CodeGenUtils::isCheapEnoughToEvaluateUnconditionally
bool isCheapEnoughToEvaluateUnconditionally(const Expr *E, const ASTContext &Ctx)
Check whether E is cheap enough and side-effect-free enough to evaluate unconditionally instead of co...
Definition
ExprUtils.cpp:87
clang::CodeGenUtils::isBlockVarRef
bool isBlockVarRef(const Expr *E)
Check whether the value of E is possibly a reference to or into a __block variable.
Definition
ExprUtils.cpp:24
clang::CodeGenUtils::onlyHasInlineBuiltinDeclaration
bool onlyHasInlineBuiltinDeclaration(const FunctionDecl *FD)
Detect the unusual situation where an inline version of a builtin is shadowed by a non-inline version...
Definition
ExprUtils.cpp:121
Generated on
for clang by
1.14.0