Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 1 | //===--- SemaDeclSpec.cpp - Declaration Specifier Semantic Analysis -------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 0bc735f | 2007-12-29 19:59:25 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements semantic analysis for declaration specifiers. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "clang/Parse/DeclSpec.h" |
Daniel Dunbar | e4858a6 | 2008-08-11 03:45:03 +0000 | [diff] [blame] | 15 | #include "clang/Basic/Diagnostic.h" |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 16 | #include "clang/Basic/LangOptions.h" |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 17 | using namespace clang; |
| 18 | |
| 19 | /// getParsedSpecifiers - Return a bitmask of which flavors of specifiers this |
| 20 | /// |
| 21 | unsigned DeclSpec::getParsedSpecifiers() const { |
| 22 | unsigned Res = 0; |
| 23 | if (StorageClassSpec != SCS_unspecified || |
| 24 | SCS_thread_specified) |
| 25 | Res |= PQ_StorageClassSpecifier; |
Mike Stump | d420433 | 2008-06-19 19:52:46 +0000 | [diff] [blame] | 26 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 27 | if (TypeQualifiers != TQ_unspecified) |
| 28 | Res |= PQ_TypeQualifier; |
| 29 | |
| 30 | if (hasTypeSpecifier()) |
| 31 | Res |= PQ_TypeSpecifier; |
| 32 | |
Douglas Gregor | b48fe38 | 2008-10-31 09:07:45 +0000 | [diff] [blame] | 33 | if (FS_inline_specified || FS_virtual_specified || FS_explicit_specified) |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 34 | Res |= PQ_FunctionSpecifier; |
| 35 | return Res; |
| 36 | } |
| 37 | |
| 38 | const char *DeclSpec::getSpecifierName(DeclSpec::SCS S) { |
| 39 | switch (S) { |
| 40 | default: assert(0 && "Unknown typespec!"); |
| 41 | case DeclSpec::SCS_unspecified: return "unspecified"; |
| 42 | case DeclSpec::SCS_typedef: return "typedef"; |
| 43 | case DeclSpec::SCS_extern: return "extern"; |
| 44 | case DeclSpec::SCS_static: return "static"; |
| 45 | case DeclSpec::SCS_auto: return "auto"; |
| 46 | case DeclSpec::SCS_register: return "register"; |
Sebastian Redl | 669d5d7 | 2008-11-14 23:42:31 +0000 | [diff] [blame^] | 47 | case DeclSpec::SCS_mutable: return "mutable"; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 48 | } |
| 49 | } |
| 50 | |
Steve Naroff | 9532414 | 2008-02-12 04:08:59 +0000 | [diff] [blame] | 51 | bool DeclSpec::BadSpecifier(SCS S, const char *&PrevSpec) { |
Steve Naroff | 9532414 | 2008-02-12 04:08:59 +0000 | [diff] [blame] | 52 | PrevSpec = getSpecifierName(S); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 53 | return true; |
| 54 | } |
| 55 | |
Steve Naroff | 9532414 | 2008-02-12 04:08:59 +0000 | [diff] [blame] | 56 | bool DeclSpec::BadSpecifier(TSW W, const char *&PrevSpec) { |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 57 | switch (W) { |
Steve Naroff | 9532414 | 2008-02-12 04:08:59 +0000 | [diff] [blame] | 58 | case TSW_unspecified: PrevSpec = "unspecified"; break; |
| 59 | case TSW_short: PrevSpec = "short"; break; |
| 60 | case TSW_long: PrevSpec = "long"; break; |
| 61 | case TSW_longlong: PrevSpec = "long long"; break; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 62 | } |
| 63 | return true; |
| 64 | } |
| 65 | |
Steve Naroff | 9532414 | 2008-02-12 04:08:59 +0000 | [diff] [blame] | 66 | bool DeclSpec::BadSpecifier(TSC C, const char *&PrevSpec) { |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 67 | switch (C) { |
Steve Naroff | 9532414 | 2008-02-12 04:08:59 +0000 | [diff] [blame] | 68 | case TSC_unspecified: PrevSpec = "unspecified"; break; |
| 69 | case TSC_imaginary: PrevSpec = "imaginary"; break; |
| 70 | case TSC_complex: PrevSpec = "complex"; break; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 71 | } |
| 72 | return true; |
| 73 | } |
| 74 | |
| 75 | |
Steve Naroff | 9532414 | 2008-02-12 04:08:59 +0000 | [diff] [blame] | 76 | bool DeclSpec::BadSpecifier(TSS S, const char *&PrevSpec) { |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 77 | switch (S) { |
Steve Naroff | 9532414 | 2008-02-12 04:08:59 +0000 | [diff] [blame] | 78 | case TSS_unspecified: PrevSpec = "unspecified"; break; |
| 79 | case TSS_signed: PrevSpec = "signed"; break; |
| 80 | case TSS_unsigned: PrevSpec = "unsigned"; break; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 81 | } |
| 82 | return true; |
| 83 | } |
| 84 | |
| 85 | const char *DeclSpec::getSpecifierName(DeclSpec::TST T) { |
| 86 | switch (T) { |
| 87 | default: assert(0 && "Unknown typespec!"); |
| 88 | case DeclSpec::TST_unspecified: return "unspecified"; |
| 89 | case DeclSpec::TST_void: return "void"; |
| 90 | case DeclSpec::TST_char: return "char"; |
Argyrios Kyrtzidis | 64c438a | 2008-08-09 16:51:54 +0000 | [diff] [blame] | 91 | case DeclSpec::TST_wchar: return "wchar_t"; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 92 | case DeclSpec::TST_int: return "int"; |
| 93 | case DeclSpec::TST_float: return "float"; |
| 94 | case DeclSpec::TST_double: return "double"; |
| 95 | case DeclSpec::TST_bool: return "_Bool"; |
| 96 | case DeclSpec::TST_decimal32: return "_Decimal32"; |
| 97 | case DeclSpec::TST_decimal64: return "_Decimal64"; |
| 98 | case DeclSpec::TST_decimal128: return "_Decimal128"; |
| 99 | case DeclSpec::TST_enum: return "enum"; |
Chris Lattner | 99dc914 | 2008-04-13 18:59:07 +0000 | [diff] [blame] | 100 | case DeclSpec::TST_class: return "class"; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 101 | case DeclSpec::TST_union: return "union"; |
| 102 | case DeclSpec::TST_struct: return "struct"; |
| 103 | case DeclSpec::TST_typedef: return "typedef"; |
Steve Naroff | d1861fd | 2007-07-31 12:34:36 +0000 | [diff] [blame] | 104 | case DeclSpec::TST_typeofType: |
| 105 | case DeclSpec::TST_typeofExpr: return "typeof"; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 106 | } |
| 107 | } |
| 108 | |
Steve Naroff | 9532414 | 2008-02-12 04:08:59 +0000 | [diff] [blame] | 109 | bool DeclSpec::BadSpecifier(TST T, const char *&PrevSpec) { |
Steve Naroff | 9532414 | 2008-02-12 04:08:59 +0000 | [diff] [blame] | 110 | PrevSpec = getSpecifierName(T); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 111 | return true; |
| 112 | } |
| 113 | |
Steve Naroff | 9532414 | 2008-02-12 04:08:59 +0000 | [diff] [blame] | 114 | bool DeclSpec::BadSpecifier(TQ T, const char *&PrevSpec) { |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 115 | switch (T) { |
| 116 | case DeclSpec::TQ_unspecified: PrevSpec = "unspecified"; break; |
| 117 | case DeclSpec::TQ_const: PrevSpec = "const"; break; |
| 118 | case DeclSpec::TQ_restrict: PrevSpec = "restrict"; break; |
| 119 | case DeclSpec::TQ_volatile: PrevSpec = "volatile"; break; |
| 120 | } |
| 121 | return true; |
| 122 | } |
| 123 | |
| 124 | bool DeclSpec::SetStorageClassSpec(SCS S, SourceLocation Loc, |
| 125 | const char *&PrevSpec) { |
| 126 | if (StorageClassSpec != SCS_unspecified) |
Chris Lattner | 2efcd2f | 2007-12-02 00:47:03 +0000 | [diff] [blame] | 127 | return BadSpecifier( (SCS)StorageClassSpec, PrevSpec); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 128 | StorageClassSpec = S; |
| 129 | StorageClassSpecLoc = Loc; |
Sebastian Redl | 669d5d7 | 2008-11-14 23:42:31 +0000 | [diff] [blame^] | 130 | assert((unsigned)S == StorageClassSpec && "SCS constants overflow bitfield"); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 131 | return false; |
| 132 | } |
| 133 | |
| 134 | bool DeclSpec::SetStorageClassSpecThread(SourceLocation Loc, |
| 135 | const char *&PrevSpec) { |
| 136 | if (SCS_thread_specified) { |
| 137 | PrevSpec = "__thread"; |
| 138 | return true; |
| 139 | } |
| 140 | SCS_thread_specified = true; |
| 141 | SCS_threadLoc = Loc; |
| 142 | return false; |
| 143 | } |
| 144 | |
| 145 | |
| 146 | /// These methods set the specified attribute of the DeclSpec, but return true |
| 147 | /// and ignore the request if invalid (e.g. "extern" then "auto" is |
| 148 | /// specified). |
| 149 | bool DeclSpec::SetTypeSpecWidth(TSW W, SourceLocation Loc, |
| 150 | const char *&PrevSpec) { |
| 151 | if (TypeSpecWidth != TSW_unspecified && |
| 152 | // Allow turning long -> long long. |
| 153 | (W != TSW_longlong || TypeSpecWidth != TSW_long)) |
Chris Lattner | 2efcd2f | 2007-12-02 00:47:03 +0000 | [diff] [blame] | 154 | return BadSpecifier( (TSW)TypeSpecWidth, PrevSpec); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 155 | TypeSpecWidth = W; |
| 156 | TSWLoc = Loc; |
| 157 | return false; |
| 158 | } |
| 159 | |
| 160 | bool DeclSpec::SetTypeSpecComplex(TSC C, SourceLocation Loc, |
| 161 | const char *&PrevSpec) { |
| 162 | if (TypeSpecComplex != TSC_unspecified) |
Chris Lattner | 2efcd2f | 2007-12-02 00:47:03 +0000 | [diff] [blame] | 163 | return BadSpecifier( (TSC)TypeSpecComplex, PrevSpec); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 164 | TypeSpecComplex = C; |
| 165 | TSCLoc = Loc; |
| 166 | return false; |
| 167 | } |
| 168 | |
| 169 | bool DeclSpec::SetTypeSpecSign(TSS S, SourceLocation Loc, |
| 170 | const char *&PrevSpec) { |
| 171 | if (TypeSpecSign != TSS_unspecified) |
Chris Lattner | 2efcd2f | 2007-12-02 00:47:03 +0000 | [diff] [blame] | 172 | return BadSpecifier( (TSS)TypeSpecSign, PrevSpec); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 173 | TypeSpecSign = S; |
| 174 | TSSLoc = Loc; |
| 175 | return false; |
| 176 | } |
| 177 | |
| 178 | bool DeclSpec::SetTypeSpecType(TST T, SourceLocation Loc, |
Argyrios Kyrtzidis | 39caa08 | 2008-08-01 10:35:27 +0000 | [diff] [blame] | 179 | const char *&PrevSpec, Action::TypeTy *Rep) { |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 180 | if (TypeSpecType != TST_unspecified) |
Chris Lattner | 2efcd2f | 2007-12-02 00:47:03 +0000 | [diff] [blame] | 181 | return BadSpecifier( (TST)TypeSpecType, PrevSpec); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 182 | TypeSpecType = T; |
| 183 | TypeRep = Rep; |
| 184 | TSTLoc = Loc; |
| 185 | return false; |
| 186 | } |
| 187 | |
| 188 | bool DeclSpec::SetTypeQual(TQ T, SourceLocation Loc, const char *&PrevSpec, |
| 189 | const LangOptions &Lang) { |
| 190 | // Duplicates turn into warnings pre-C99. |
| 191 | if ((TypeQualifiers & T) && !Lang.C99) |
| 192 | return BadSpecifier(T, PrevSpec); |
| 193 | TypeQualifiers |= T; |
| 194 | |
| 195 | switch (T) { |
| 196 | default: assert(0 && "Unknown type qualifier!"); |
| 197 | case TQ_const: TQ_constLoc = Loc; break; |
| 198 | case TQ_restrict: TQ_restrictLoc = Loc; break; |
| 199 | case TQ_volatile: TQ_volatileLoc = Loc; break; |
| 200 | } |
| 201 | return false; |
| 202 | } |
| 203 | |
| 204 | bool DeclSpec::SetFunctionSpecInline(SourceLocation Loc, const char *&PrevSpec){ |
| 205 | // 'inline inline' is ok. |
| 206 | FS_inline_specified = true; |
| 207 | FS_inlineLoc = Loc; |
| 208 | return false; |
| 209 | } |
| 210 | |
Douglas Gregor | b48fe38 | 2008-10-31 09:07:45 +0000 | [diff] [blame] | 211 | bool DeclSpec::SetFunctionSpecVirtual(SourceLocation Loc, const char *&PrevSpec){ |
| 212 | // 'virtual virtual' is ok. |
| 213 | FS_virtual_specified = true; |
| 214 | FS_virtualLoc = Loc; |
| 215 | return false; |
| 216 | } |
| 217 | |
| 218 | bool DeclSpec::SetFunctionSpecExplicit(SourceLocation Loc, const char *&PrevSpec){ |
| 219 | // 'explicit explicit' is ok. |
| 220 | FS_explicit_specified = true; |
| 221 | FS_explicitLoc = Loc; |
| 222 | return false; |
| 223 | } |
| 224 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 225 | |
| 226 | /// Finish - This does final analysis of the declspec, rejecting things like |
| 227 | /// "_Imaginary" (lacking an FP type). This returns a diagnostic to issue or |
| 228 | /// diag::NUM_DIAGNOSTICS if there is no error. After calling this method, |
| 229 | /// DeclSpec is guaranteed self-consistent, even if an error occurred. |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 230 | void DeclSpec::Finish(Diagnostic &D, SourceManager& SrcMgr, |
| 231 | const LangOptions &Lang) { |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 232 | // Check the type specifier components first. |
| 233 | |
Argyrios Kyrtzidis | 64c438a | 2008-08-09 16:51:54 +0000 | [diff] [blame] | 234 | // signed/unsigned are only valid with int/char/wchar_t. |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 235 | if (TypeSpecSign != TSS_unspecified) { |
| 236 | if (TypeSpecType == TST_unspecified) |
| 237 | TypeSpecType = TST_int; // unsigned -> unsigned int, signed -> signed int. |
Argyrios Kyrtzidis | 64c438a | 2008-08-09 16:51:54 +0000 | [diff] [blame] | 238 | else if (TypeSpecType != TST_int && |
| 239 | TypeSpecType != TST_char && TypeSpecType != TST_wchar) { |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 240 | Diag(D, TSSLoc, SrcMgr, diag::err_invalid_sign_spec, |
Chris Lattner | 2efcd2f | 2007-12-02 00:47:03 +0000 | [diff] [blame] | 241 | getSpecifierName( (TST)TypeSpecType)); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 242 | // signed double -> double. |
| 243 | TypeSpecSign = TSS_unspecified; |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | // Validate the width of the type. |
| 248 | switch (TypeSpecWidth) { |
| 249 | case TSW_unspecified: break; |
| 250 | case TSW_short: // short int |
| 251 | case TSW_longlong: // long long int |
| 252 | if (TypeSpecType == TST_unspecified) |
| 253 | TypeSpecType = TST_int; // short -> short int, long long -> long long int. |
| 254 | else if (TypeSpecType != TST_int) { |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 255 | Diag(D, TSWLoc, SrcMgr, |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 256 | TypeSpecWidth == TSW_short ? diag::err_invalid_short_spec |
| 257 | : diag::err_invalid_longlong_spec, |
Chris Lattner | 2efcd2f | 2007-12-02 00:47:03 +0000 | [diff] [blame] | 258 | getSpecifierName( (TST)TypeSpecType)); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 259 | TypeSpecType = TST_int; |
| 260 | } |
| 261 | break; |
| 262 | case TSW_long: // long double, long int |
| 263 | if (TypeSpecType == TST_unspecified) |
| 264 | TypeSpecType = TST_int; // long -> long int. |
| 265 | else if (TypeSpecType != TST_int && TypeSpecType != TST_double) { |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 266 | Diag(D, TSWLoc, SrcMgr, diag::err_invalid_long_spec, |
Chris Lattner | 2efcd2f | 2007-12-02 00:47:03 +0000 | [diff] [blame] | 267 | getSpecifierName( (TST)TypeSpecType)); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 268 | TypeSpecType = TST_int; |
| 269 | } |
| 270 | break; |
| 271 | } |
| 272 | |
| 273 | // TODO: if the implementation does not implement _Complex or _Imaginary, |
| 274 | // disallow their use. Need information about the backend. |
| 275 | if (TypeSpecComplex != TSC_unspecified) { |
| 276 | if (TypeSpecType == TST_unspecified) { |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 277 | Diag(D, TSCLoc, SrcMgr, diag::ext_plain_complex); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 278 | TypeSpecType = TST_double; // _Complex -> _Complex double. |
| 279 | } else if (TypeSpecType == TST_int || TypeSpecType == TST_char) { |
| 280 | // Note that this intentionally doesn't include _Complex _Bool. |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 281 | Diag(D, TSTLoc, SrcMgr, diag::ext_integer_complex); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 282 | } else if (TypeSpecType != TST_float && TypeSpecType != TST_double) { |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 283 | Diag(D, TSCLoc, SrcMgr, diag::err_invalid_complex_spec, |
Chris Lattner | 2efcd2f | 2007-12-02 00:47:03 +0000 | [diff] [blame] | 284 | getSpecifierName( (TST)TypeSpecType)); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 285 | TypeSpecComplex = TSC_unspecified; |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | // Verify __thread. |
| 290 | if (SCS_thread_specified) { |
| 291 | if (StorageClassSpec == SCS_unspecified) { |
| 292 | StorageClassSpec = SCS_extern; // '__thread int' -> 'extern __thread int' |
| 293 | } else if (StorageClassSpec != SCS_extern && |
| 294 | StorageClassSpec != SCS_static) { |
Ted Kremenek | 7a9d49f | 2007-12-11 21:27:55 +0000 | [diff] [blame] | 295 | Diag(D, getStorageClassSpecLoc(), SrcMgr, diag::err_invalid_thread_spec, |
Chris Lattner | 2efcd2f | 2007-12-02 00:47:03 +0000 | [diff] [blame] | 296 | getSpecifierName( (SCS)StorageClassSpec)); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 297 | SCS_thread_specified = false; |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | // Okay, now we can infer the real type. |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 302 | |
| 303 | // TODO: return "auto function" and other bad things based on the real type. |
| 304 | |
| 305 | // 'data definition has no type or storage class'? |
| 306 | } |
Daniel Dunbar | e4858a6 | 2008-08-11 03:45:03 +0000 | [diff] [blame] | 307 | |
| 308 | void DeclSpec::Diag(Diagnostic &D, SourceLocation Loc, SourceManager& SrcMgr, |
| 309 | unsigned DiagID) { |
| 310 | D.Report(FullSourceLoc(Loc,SrcMgr), DiagID); |
| 311 | } |
| 312 | |
| 313 | void DeclSpec::Diag(Diagnostic &D, SourceLocation Loc, SourceManager& SrcMgr, |
| 314 | unsigned DiagID, const std::string &info) { |
| 315 | D.Report(FullSourceLoc(Loc,SrcMgr), DiagID, &info, 1); |
| 316 | } |