clang 24.0.0git
DynamicAllocationArgumentsCXX.h
Go to the documentation of this file.
1//===- DynamicAllocationArgumentsCXX.h - operator new/delete args ---------===//
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 defines the argument candidate and resolution types for operators
10// new and new[] overload resolution.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_SEMA_DYNAMICALLOCATIONARGUMENTSCXX_H
15#define LLVM_CLANG_SEMA_DYNAMICALLOCATIONARGUMENTSCXX_H
16
17#include "clang/AST/ExprCXX.h"
18#include "llvm/ADT/ArrayRef.h"
19#include "llvm/ADT/SmallVector.h"
20
21namespace clang {
22
23class LookupResult;
24class Sema;
25
26struct ImplicitAllocationArguments {
27 friend Sema;
28
30 return ArrayRef(ImplicitArguments, ArgumentCount);
31 }
32
35 return ImplicitArguments[ArgumentCount - 1];
36 return nullptr;
37 }
38
39 const LookupResult &
41 std::optional<LookupResult> &) const;
45
46private:
47 ImplicitAllocationArguments(Sema &SemaRef, Expr *TypeIdentityArg,
48 Expr *SizeArg, Expr *AlignArg,
50
51 // Type-identity, size, and alignment
52 static constexpr unsigned MaxImplicitArguments = 3;
53 unsigned ArgumentCount;
54 Expr *ImplicitArguments[MaxImplicitArguments];
55};
56
61 // type-identity, size, alignment, nothrow or other single placement
62 // parameter
64};
65
66} // namespace clang
67
68#endif // LLVM_CLANG_SEMA_DYNAMICALLOCATIONARGUMENTSCXX_H
Defines the clang::Expr interface and subclasses for C++ expressions.
This represents one expression.
Definition Expr.h:112
Represents a function declaration or definition.
Definition Decl.h:2029
Represents the results of name lookup.
Definition Lookup.h:147
Sema - This implements semantic analysis and AST building for C.
Definition Sema.h:875
The JSON file list parser is used to communicate input to InstallAPI.
AlignedAllocationMode
Definition ExprCXX.h:2266
TypeAwareAllocationMode
Definition ExprCXX.h:2254
const LookupResult & updateLookupForMSVCCompatibility(Sema &, const LookupResult &, std::optional< LookupResult > &) const
ImplicitAllocationParameters IAP