clang
24.0.0git
lib
Sema
SemaProxy.cpp
Go to the documentation of this file.
1
//=== SemaProxy.cpp - Sema proxy for effectual constant evaluation --------===//
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 implements a proxy to the Sema class that can be provided to the
10
// constant evaluator, thereby facilitating evaluations capable of acting on and
11
// querying the AST.
12
//
13
//===----------------------------------------------------------------------===//
14
15
#include "
clang/Sema/SemaProxy.h
"
16
#include "
clang/AST/Decl.h
"
17
#include "
clang/Sema/Sema.h
"
18
19
namespace
clang
{
20
namespace
sema
{
21
22
void
EvalProxy::instantiateFunctionDefinition
(
23
SourceLocation
PointOfInstantiation,
FunctionDecl
*
Function
) {
24
// If the function is a specialization of a member function template which has
25
// been declared a friend by another class, 'Function' might be a Decl marked
26
// as an explicit specialization. Walking to the most recent Decl seems to
27
// find a node that is understood to be implicitly instantiable.
28
Function
=
Function
->getMostRecentDecl();
29
30
SemaRef.InstantiateFunctionDefinition(
31
PointOfInstantiation,
Function
,
/*Recursive=*/
true
,
32
/*DefinitionRequired=*/
true
,
/*AtEndOfTU=*/
false
);
33
}
34
35
}
// namespace sema
36
}
// namespace clang
Decl.h
SemaProxy.h
Sema.h
clang::FunctionDecl
Represents a function declaration or definition.
Definition
Decl.h:2071
clang::SourceLocation
Encodes a location in the source.
Definition
SourceLocation.h:98
clang::sema::EvalProxy::instantiateFunctionDefinition
void instantiateFunctionDefinition(SourceLocation PointOfInstantiation, FunctionDecl *Function) override
Definition
SemaProxy.cpp:22
clang::sema
Definition
AnalysisBasedWarnings.h:29
clang
Top level wrappers for InstallAPI frontend operations.
Definition
CalledOnceCheck.h:17
clang::PredefinedIdentKind::Function
@ Function
Definition
Expr.h:2060
Generated on
for clang by
1.14.0