22
22
#include " clang/Basic/LLVM.h"
23
23
#include " clang/Basic/SourceLocation.h"
24
24
#include " clang/Basic/Specifiers.h"
25
+ #include " clang/Support/Compiler.h"
25
26
#include " llvm/ADT/ArrayRef.h"
26
27
#include " llvm/Support/Casting.h"
27
28
#include " llvm/Support/Compiler.h"
@@ -122,11 +123,11 @@ class TypeLoc {
122
123
explicit operator bool () const { return Ty; }
123
124
124
125
// / Returns the size of type source info data block for the given type.
125
- static unsigned getFullDataSizeForType (QualType Ty);
126
+ CLANG_ABI static unsigned getFullDataSizeForType (QualType Ty);
126
127
127
128
// / Returns the alignment of type source info data block for
128
129
// / the given type.
129
- static unsigned getLocalAlignmentForType (QualType Ty);
130
+ CLANG_ABI static unsigned getLocalAlignmentForType (QualType Ty);
130
131
131
132
// / Get the type for which this source info wrapper provides
132
133
// / information.
@@ -144,10 +145,10 @@ class TypeLoc {
144
145
}
145
146
146
147
// / Get the begin source location.
147
- SourceLocation getBeginLoc () const ;
148
+ CLANG_ABI SourceLocation getBeginLoc () const ;
148
149
149
150
// / Get the end source location.
150
- SourceLocation getEndLoc () const ;
151
+ CLANG_ABI SourceLocation getEndLoc () const ;
151
152
152
153
// / Get the full source range.
153
154
SourceRange getSourceRange () const LLVM_READONLY {
@@ -182,15 +183,15 @@ class TypeLoc {
182
183
// / QualifiedTypeLoc
183
184
// / AtomicTypeLoc
184
185
// / AttributedTypeLoc, for those type attributes that behave as qualifiers
185
- TypeLoc findExplicitQualifierLoc () const ;
186
+ CLANG_ABI TypeLoc findExplicitQualifierLoc () const ;
186
187
187
188
// / Get the typeloc of an AutoType whose type will be deduced for a variable
188
189
// / with an initializer of this type. This looks through declarators like
189
190
// / pointer types, but not through decltype or typedefs.
190
- AutoTypeLoc getContainedAutoTypeLoc () const ;
191
+ CLANG_ABI AutoTypeLoc getContainedAutoTypeLoc () const ;
191
192
192
193
// / Get the SourceLocation of the template keyword (if any).
193
- SourceLocation getTemplateKeywordLoc () const ;
194
+ CLANG_ABI SourceLocation getTemplateKeywordLoc () const ;
194
195
195
196
// / Initializes this to state that every location in this
196
197
// / type is the given location.
@@ -218,7 +219,7 @@ class TypeLoc {
218
219
}
219
220
220
221
// / Copies the other type loc into this one.
221
- void copy (TypeLoc other);
222
+ CLANG_ABI void copy (TypeLoc other);
222
223
223
224
friend bool operator ==(const TypeLoc &LHS, const TypeLoc &RHS) {
224
225
return LHS.Ty == RHS.Ty && LHS.Data == RHS.Data ;
@@ -230,21 +231,21 @@ class TypeLoc {
230
231
231
232
// / Find the location of the nullability specifier (__nonnull,
232
233
// / __nullable, or __null_unspecifier), if there is one.
233
- SourceLocation findNullabilityLoc () const ;
234
+ CLANG_ABI SourceLocation findNullabilityLoc () const ;
234
235
235
- void dump () const ;
236
- void dump (llvm::raw_ostream &, const ASTContext &) const ;
236
+ CLANG_ABI void dump () const ;
237
+ CLANG_ABI void dump (llvm::raw_ostream &, const ASTContext &) const ;
237
238
238
239
private:
239
240
static bool isKind (const TypeLoc&) {
240
241
return true ;
241
242
}
242
243
243
- static void initializeImpl (ASTContext &Context, TypeLoc TL,
244
+ CLANG_ABI static void initializeImpl (ASTContext &Context, TypeLoc TL,
244
245
SourceLocation Loc);
245
- static TypeLoc getNextTypeLocImpl (TypeLoc TL);
246
- static TypeLoc IgnoreParensImpl (TypeLoc TL);
247
- static SourceRange getLocalSourceRangeImpl (TypeLoc TL);
246
+ CLANG_ABI static TypeLoc getNextTypeLocImpl (TypeLoc TL);
247
+ CLANG_ABI static TypeLoc IgnoreParensImpl (TypeLoc TL);
248
+ CLANG_ABI static SourceRange getLocalSourceRangeImpl (TypeLoc TL);
248
249
};
249
250
250
251
inline TypeSourceInfo::TypeSourceInfo (QualType ty, size_t DataSize) : Ty(ty) {
@@ -551,7 +552,7 @@ class TypeSpecTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
551
552
private:
552
553
friend class TypeLoc ;
553
554
554
- static bool isKind (const TypeLoc &TL);
555
+ CLANG_ABI static bool isKind (const TypeLoc &TL);
555
556
};
556
557
557
558
struct BuiltinLocInfo {
@@ -642,7 +643,7 @@ class BuiltinTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
642
643
getWrittenBuiltinSpecs ().Width = static_cast <unsigned >(written);
643
644
}
644
645
645
- TypeSpecifierType getWrittenTypeSpec () const ;
646
+ CLANG_ABI TypeSpecifierType getWrittenTypeSpec () const ;
646
647
647
648
bool hasWrittenTypeSpec () const {
648
649
return getWrittenTypeSpec () != TST_unspecified;
@@ -732,7 +733,7 @@ class TagTypeLoc : public InheritingConcreteTypeLoc<TypeSpecTypeLoc,
732
733
TagDecl *getDecl () const { return getTypePtr ()->getDecl (); }
733
734
734
735
// / True if the tag was defined in this type specifier.
735
- bool isDefinition () const ;
736
+ CLANG_ABI bool isDefinition () const ;
736
737
};
737
738
738
739
// / Wrapper for source info for record types.
@@ -829,7 +830,7 @@ class ObjCTypeParamTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
829
830
return llvm::ArrayRef (getProtocolLocArray (), getNumProtocols ());
830
831
}
831
832
832
- void initializeLocal (ASTContext &Context, SourceLocation Loc);
833
+ CLANG_ABI void initializeLocal (ASTContext &Context, SourceLocation Loc);
833
834
834
835
unsigned getExtraLocalDataSize () const {
835
836
if (!this ->getNumProtocols ()) return 0 ;
@@ -906,7 +907,7 @@ class AttributedTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
906
907
return dyn_cast_or_null<T>(getAttr ());
907
908
}
908
909
909
- SourceRange getLocalSourceRange () const ;
910
+ CLANG_ABI SourceRange getLocalSourceRange () const ;
910
911
911
912
void initializeLocal (ASTContext &Context, SourceLocation loc) {
912
913
setAttr (nullptr );
@@ -933,7 +934,7 @@ class BTFTagAttributedTypeLoc
933
934
return dyn_cast_or_null<T>(getAttr ());
934
935
}
935
936
936
- SourceRange getLocalSourceRange () const ;
937
+ CLANG_ABI SourceRange getLocalSourceRange () const ;
937
938
938
939
void initializeLocal (ASTContext &Context, SourceLocation loc) {}
939
940
@@ -1092,7 +1093,7 @@ class ObjCObjectTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
1092
1093
return SourceRange (start, end);
1093
1094
}
1094
1095
1095
- void initializeLocal (ASTContext &Context, SourceLocation Loc);
1096
+ CLANG_ABI void initializeLocal (ASTContext &Context, SourceLocation Loc);
1096
1097
1097
1098
unsigned getExtraLocalDataSize () const {
1098
1099
return this ->getNumTypeArgs () * sizeof (TypeSourceInfo *)
@@ -1174,7 +1175,7 @@ class CountAttributedTypeLoc final
1174
1175
bool isCountInBytes () const { return getTypePtr ()->isCountInBytes (); }
1175
1176
bool isOrNull () const { return getTypePtr ()->isOrNull (); }
1176
1177
1177
- SourceRange getLocalSourceRange () const ;
1178
+ CLANG_ABI SourceRange getLocalSourceRange () const ;
1178
1179
};
1179
1180
1180
1181
struct MacroQualifiedLocInfo {
@@ -1764,7 +1765,7 @@ class TemplateSpecializationTypeLoc :
1764
1765
getArgInfos (), Loc);
1765
1766
}
1766
1767
1767
- static void initializeArgLocs (ASTContext &Context,
1768
+ CLANG_ABI static void initializeArgLocs (ASTContext &Context,
1768
1769
ArrayRef<TemplateArgument> Args,
1769
1770
TemplateArgumentLocInfo *ArgInfos,
1770
1771
SourceLocation Loc);
@@ -2075,7 +2076,7 @@ class TypeOfExprTypeLoc : public TypeofLikeTypeLoc<TypeOfExprTypeLoc,
2075
2076
// Reimplemented to account for GNU/C++ extension
2076
2077
// typeof unary-expression
2077
2078
// where there are no parentheses.
2078
- SourceRange getLocalSourceRange () const ;
2079
+ CLANG_ABI SourceRange getLocalSourceRange () const ;
2079
2080
};
2080
2081
2081
2082
class TypeOfTypeLoc
@@ -2093,7 +2094,7 @@ class TypeOfTypeLoc
2093
2094
this ->getLocalData ()->UnmodifiedTInfo = TI;
2094
2095
}
2095
2096
2096
- void initializeLocal (ASTContext &Context, SourceLocation Loc);
2097
+ CLANG_ABI void initializeLocal (ASTContext &Context, SourceLocation Loc);
2097
2098
};
2098
2099
2099
2100
// decltype(expression) abc;
@@ -2197,7 +2198,7 @@ class UnaryTransformTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
2197
2198
setRParenLoc (Range.getEnd ());
2198
2199
}
2199
2200
2200
- void initializeLocal (ASTContext &Context, SourceLocation Loc);
2201
+ CLANG_ABI void initializeLocal (ASTContext &Context, SourceLocation Loc);
2201
2202
};
2202
2203
2203
2204
class DeducedTypeLoc
@@ -2318,7 +2319,7 @@ class AutoTypeLoc
2318
2319
memcpy (Data, Loc.Data , size);
2319
2320
}
2320
2321
2321
- void initializeLocal (ASTContext &Context, SourceLocation Loc);
2322
+ CLANG_ABI void initializeLocal (ASTContext &Context, SourceLocation Loc);
2322
2323
};
2323
2324
2324
2325
class DeducedTemplateSpecializationTypeLoc
@@ -2387,7 +2388,7 @@ class ElaboratedTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
2387
2388
return getQualifierLoc ().getSourceRange ();
2388
2389
}
2389
2390
2390
- void initializeLocal (ASTContext &Context, SourceLocation Loc);
2391
+ CLANG_ABI void initializeLocal (ASTContext &Context, SourceLocation Loc);
2391
2392
2392
2393
TypeLoc getNamedTypeLoc () const { return getInnerTypeLoc (); }
2393
2394
@@ -2468,7 +2469,7 @@ class DependentNameTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
2468
2469
memcpy (Data, Loc.Data , size);
2469
2470
}
2470
2471
2471
- void initializeLocal (ASTContext &Context, SourceLocation Loc);
2472
+ CLANG_ABI void initializeLocal (ASTContext &Context, SourceLocation Loc);
2472
2473
};
2473
2474
2474
2475
struct DependentTemplateSpecializationLocInfo : DependentNameLocInfo {
@@ -2582,7 +2583,7 @@ class DependentTemplateSpecializationTypeLoc :
2582
2583
memcpy (Data, Loc.Data , size);
2583
2584
}
2584
2585
2585
- void initializeLocal (ASTContext &Context, SourceLocation Loc);
2586
+ CLANG_ABI void initializeLocal (ASTContext &Context, SourceLocation Loc);
2586
2587
2587
2588
unsigned getExtraLocalDataSize () const {
2588
2589
return getNumArgs () * sizeof (TemplateArgumentLocInfo);
0 commit comments