clang 8.0.0

SelectorLocationsKind.h
Go to the documentation of this file.
1 //===--- SelectorLocationsKind.h - Kind of selector locations ---*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Describes whether the identifier locations for a selector are "standard"
11 // or not.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CLANG_AST_SELECTORLOCATIONSKIND_H
16 #define LLVM_CLANG_AST_SELECTORLOCATIONSKIND_H
17
18 #include "clang/Basic/LLVM.h"
19
20 namespace clang {
21 class Selector;
22 class SourceLocation;
23 class Expr;
24 class ParmVarDecl;
25
26 /// Whether all locations of the selector identifiers are in a
27 /// "standard" position.
28 enum SelectorLocationsKind {
29 /// Non-standard.
30 SelLoc_NonStandard = 0,
31
32 /// For nullary selectors, immediately before the end:
33 /// "[foo release]" / "-(void)release;"
34 /// Or immediately before the arguments:
35 /// "[foo first:1 second:2]" / "-(id)first:(int)x second:(int)y;
36 SelLoc_StandardNoSpace = 1,
37
38 /// For nullary selectors, immediately before the end:
39 /// "[foo release]" / "-(void)release;"
40 /// Or with a space between the arguments:
41 /// "[foo first: 1 second: 2]" / "-(id)first: (int)x second: (int)y;
42 SelLoc_StandardWithSpace = 2
43 };
44
45 /// Returns true if all \p SelLocs are in a "standard" location.
46 SelectorLocationsKind hasStandardSelectorLocs(Selector Sel,
47 ArrayRef<SourceLocation> SelLocs,
48 ArrayRef<Expr *> Args,
49 SourceLocation EndLoc);
50
51 /// Get the "standard" location of a selector identifier, e.g:
52 /// For nullary selectors, immediately before ']': "[foo release]"
53 ///
54 /// \param WithArgSpace if true the standard location is with a space apart
55 /// before arguments: "[foo first: 1 second: 2]"
56 /// If false: "[foo first:1 second:2]"
57 SourceLocation getStandardSelectorLoc(unsigned Index,
58 Selector Sel,
59 bool WithArgSpace,
60 ArrayRef<Expr *> Args,
61 SourceLocation EndLoc);
62
63 /// Returns true if all \p SelLocs are in a "standard" location.
64 SelectorLocationsKind hasStandardSelectorLocs(Selector Sel,
65 ArrayRef<SourceLocation> SelLocs,
66 ArrayRef<ParmVarDecl *> Args,
67 SourceLocation EndLoc);
68
69 /// Get the "standard" location of a selector identifier, e.g:
70 /// For nullary selectors, immediately before ']': "[foo release]"
71 ///
72 /// \param WithArgSpace if true the standard location is with a space apart
73 /// before arguments: "-(id)first: (int)x second: (int)y;"
74 /// If false: "-(id)first:(int)x second:(int)y;"
75 SourceLocation getStandardSelectorLoc(unsigned Index,
76 Selector Sel,
77 bool WithArgSpace,
78 ArrayRef<ParmVarDecl *> Args,
79 SourceLocation EndLoc);
80
81 } // end namespace clang
82
83 #endif
clang::SelLoc_StandardWithSpace
For nullary selectors, immediately before the end: "[foo release]" / "-(void)release;" Or with a spac...
Definition: SelectorLocationsKind.h:42
clang::Selector
Smart pointer class that efficiently represents Objective-C method names.
Definition: IdentifierTable.h:673
clang::SelLoc_NonStandard
Non-standard.
Definition: SelectorLocationsKind.h:30
clang::SelectorLocationsKind
SelectorLocationsKind
Whether all locations of the selector identifiers are in a "standard" position.
Definition: SelectorLocationsKind.h:28
LLVM.h
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
llvm::ArrayRef
Definition: LLVM.h:32
clang::getStandardSelectorLoc
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 ...
Definition: SelectorLocationsKind.cpp:104
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:88
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::SelLoc_StandardNoSpace
For nullary selectors, immediately before the end: "[foo release]" / "-(void)release;" Or immediately...
Definition: SelectorLocationsKind.h:36
clang::hasStandardSelectorLocs
SelectorLocationsKind hasStandardSelectorLocs(Selector Sel, ArrayRef< SourceLocation > SelLocs, ArrayRef< Expr *> Args, SourceLocation EndLoc)
Returns true if all SelLocs are in a "standard" location.
Definition: SelectorLocationsKind.cpp:97