clang 20.0.0git
SelectorLocationsKind.h
Go to the documentation of this file.
1//===--- SelectorLocationsKind.h - Kind of selector locations ---*- 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// Describes whether the identifier locations for a selector are "standard"
10// or not.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_AST_SELECTORLOCATIONSKIND_H
15#define LLVM_CLANG_AST_SELECTORLOCATIONSKIND_H
16
17#include "clang/Basic/LLVM.h"
18
19namespace clang {
20 class Selector;
21 class SourceLocation;
22 class Expr;
23 class ParmVarDecl;
24
25/// Whether all locations of the selector identifiers are in a
26/// "standard" position.
28 /// Non-standard.
30
31 /// For nullary selectors, immediately before the end:
32 /// "[foo release]" / "-(void)release;"
33 /// Or immediately before the arguments:
34 /// "[foo first:1 second:2]" / "-(id)first:(int)x second:(int)y;
36
37 /// For nullary selectors, immediately before the end:
38 /// "[foo release]" / "-(void)release;"
39 /// Or with a space between the arguments:
40 /// "[foo first: 1 second: 2]" / "-(id)first: (int)x second: (int)y;
42};
43
44/// Returns true if all \p SelLocs are in a "standard" location.
46 ArrayRef<SourceLocation> SelLocs,
47 ArrayRef<Expr *> Args,
48 SourceLocation EndLoc);
49
50/// Get the "standard" location of a selector identifier, e.g:
51/// For nullary selectors, immediately before ']': "[foo release]"
52///
53/// \param WithArgSpace if true the standard location is with a space apart
54/// before arguments: "[foo first: 1 second: 2]"
55/// If false: "[foo first:1 second:2]"
56SourceLocation getStandardSelectorLoc(unsigned Index,
57 Selector Sel,
58 bool WithArgSpace,
59 ArrayRef<Expr *> Args,
60 SourceLocation EndLoc);
61
62/// Returns true if all \p SelLocs are in a "standard" location.
64 ArrayRef<SourceLocation> SelLocs,
65 ArrayRef<ParmVarDecl *> Args,
66 SourceLocation EndLoc);
67
68/// Get the "standard" location of a selector identifier, e.g:
69/// For nullary selectors, immediately before ']': "[foo release]"
70///
71/// \param WithArgSpace if true the standard location is with a space apart
72/// before arguments: "-(id)first: (int)x second: (int)y;"
73/// If false: "-(id)first:(int)x second:(int)y;"
74SourceLocation getStandardSelectorLoc(unsigned Index,
75 Selector Sel,
76 bool WithArgSpace,
77 ArrayRef<ParmVarDecl *> Args,
78 SourceLocation EndLoc);
79
80} // end namespace clang
81
82#endif
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
The JSON file list parser is used to communicate input to InstallAPI.
SelectorLocationsKind
Whether all locations of the selector identifiers are in a "standard" position.
@ SelLoc_StandardWithSpace
For nullary selectors, immediately before the end: "[foo release]" / "-(void)release;" Or with a spac...
@ SelLoc_NonStandard
Non-standard.
@ SelLoc_StandardNoSpace
For nullary selectors, immediately before the end: "[foo release]" / "-(void)release;" Or immediately...
SelectorLocationsKind hasStandardSelectorLocs(Selector Sel, ArrayRef< SourceLocation > SelLocs, ArrayRef< Expr * > Args, SourceLocation EndLoc)
Returns true if all SelLocs are in a "standard" location.
SourceLocation getStandardSelectorLoc(unsigned Index, Selector Sel, bool WithArgSpace, ArrayRef< Expr * > Args, SourceLocation EndLoc)
Get the "standard" location of a selector identifier, e.g: For nullary selectors, immediately before ...