Sema.cpp revision 4eb4f0f96289cbece50c1270e02af3caf8779705
1//===--- Sema.cpp - AST Builder and Semantic Analysis Implementation ------===// 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// This file implements the actions class which performs semantic analysis and 11// builds an AST out of a parse stream. 12// 13//===----------------------------------------------------------------------===// 14 15#include "clang/Sema/SemaInternal.h" 16#include "clang/Sema/DelayedDiagnostic.h" 17#include "TargetAttributesSema.h" 18#include "llvm/ADT/DenseMap.h" 19#include "llvm/ADT/SmallSet.h" 20#include "llvm/ADT/APFloat.h" 21#include "clang/Sema/CXXFieldCollector.h" 22#include "clang/Sema/ExternalSemaSource.h" 23#include "clang/Sema/PrettyDeclStackTrace.h" 24#include "clang/Sema/Scope.h" 25#include "clang/Sema/ScopeInfo.h" 26#include "clang/Sema/SemaConsumer.h" 27#include "clang/AST/ASTContext.h" 28#include "clang/AST/ASTDiagnostic.h" 29#include "clang/AST/DeclCXX.h" 30#include "clang/AST/DeclObjC.h" 31#include "clang/AST/Expr.h" 32#include "clang/Lex/Preprocessor.h" 33#include "clang/Basic/PartialDiagnostic.h" 34#include "clang/Basic/TargetInfo.h" 35using namespace clang; 36using namespace sema; 37 38FunctionScopeInfo::~FunctionScopeInfo() { } 39 40void FunctionScopeInfo::Clear(unsigned NumErrors) { 41 HasBranchProtectedScope = false; 42 HasBranchIntoScope = false; 43 HasIndirectGoto = false; 44 45 LabelMap.clear(); 46 SwitchStack.clear(); 47 Returns.clear(); 48 NumErrorsAtStartOfFunction = NumErrors; 49} 50 51BlockScopeInfo::~BlockScopeInfo() { } 52 53void Sema::ActOnTranslationUnitScope(Scope *S) { 54 TUScope = S; 55 PushDeclContext(S, Context.getTranslationUnitDecl()); 56 57 VAListTagName = PP.getIdentifierInfo("__va_list_tag"); 58 59 if (!Context.isInt128Installed() && // May be set by ASTReader. 60 PP.getTargetInfo().getPointerWidth(0) >= 64) { 61 TypeSourceInfo *TInfo; 62 63 // Install [u]int128_t for 64-bit targets. 64 TInfo = Context.getTrivialTypeSourceInfo(Context.Int128Ty); 65 PushOnScopeChains(TypedefDecl::Create(Context, CurContext, 66 SourceLocation(), 67 &Context.Idents.get("__int128_t"), 68 TInfo), TUScope); 69 70 TInfo = Context.getTrivialTypeSourceInfo(Context.UnsignedInt128Ty); 71 PushOnScopeChains(TypedefDecl::Create(Context, CurContext, 72 SourceLocation(), 73 &Context.Idents.get("__uint128_t"), 74 TInfo), TUScope); 75 Context.setInt128Installed(); 76 } 77 78 79 if (!PP.getLangOptions().ObjC1) return; 80 81 // Built-in ObjC types may already be set by ASTReader (hence isNull checks). 82 if (Context.getObjCSelType().isNull()) { 83 // Create the built-in typedef for 'SEL'. 84 QualType SelT = Context.getPointerType(Context.ObjCBuiltinSelTy); 85 TypeSourceInfo *SelInfo = Context.getTrivialTypeSourceInfo(SelT); 86 TypedefDecl *SelTypedef 87 = TypedefDecl::Create(Context, CurContext, SourceLocation(), 88 &Context.Idents.get("SEL"), SelInfo); 89 PushOnScopeChains(SelTypedef, TUScope); 90 Context.setObjCSelType(Context.getTypeDeclType(SelTypedef)); 91 Context.ObjCSelRedefinitionType = Context.getObjCSelType(); 92 } 93 94 // Synthesize "@class Protocol; 95 if (Context.getObjCProtoType().isNull()) { 96 ObjCInterfaceDecl *ProtocolDecl = 97 ObjCInterfaceDecl::Create(Context, CurContext, SourceLocation(), 98 &Context.Idents.get("Protocol"), 99 SourceLocation(), true); 100 Context.setObjCProtoType(Context.getObjCInterfaceType(ProtocolDecl)); 101 PushOnScopeChains(ProtocolDecl, TUScope, false); 102 } 103 // Create the built-in typedef for 'id'. 104 if (Context.getObjCIdType().isNull()) { 105 QualType T = Context.getObjCObjectType(Context.ObjCBuiltinIdTy, 0, 0); 106 T = Context.getObjCObjectPointerType(T); 107 TypeSourceInfo *IdInfo = Context.getTrivialTypeSourceInfo(T); 108 TypedefDecl *IdTypedef 109 = TypedefDecl::Create(Context, CurContext, SourceLocation(), 110 &Context.Idents.get("id"), IdInfo); 111 PushOnScopeChains(IdTypedef, TUScope); 112 Context.setObjCIdType(Context.getTypeDeclType(IdTypedef)); 113 Context.ObjCIdRedefinitionType = Context.getObjCIdType(); 114 } 115 // Create the built-in typedef for 'Class'. 116 if (Context.getObjCClassType().isNull()) { 117 QualType T = Context.getObjCObjectType(Context.ObjCBuiltinClassTy, 0, 0); 118 T = Context.getObjCObjectPointerType(T); 119 TypeSourceInfo *ClassInfo = Context.getTrivialTypeSourceInfo(T); 120 TypedefDecl *ClassTypedef 121 = TypedefDecl::Create(Context, CurContext, SourceLocation(), 122 &Context.Idents.get("Class"), ClassInfo); 123 PushOnScopeChains(ClassTypedef, TUScope); 124 Context.setObjCClassType(Context.getTypeDeclType(ClassTypedef)); 125 Context.ObjCClassRedefinitionType = Context.getObjCClassType(); 126 } 127} 128 129Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer, 130 bool CompleteTranslationUnit, 131 CodeCompleteConsumer *CodeCompleter) 132 : TheTargetAttributesSema(0), 133 LangOpts(pp.getLangOptions()), PP(pp), Context(ctxt), Consumer(consumer), 134 Diags(PP.getDiagnostics()), SourceMgr(PP.getSourceManager()), 135 ExternalSource(0), CodeCompleter(CodeCompleter), CurContext(0), 136 PackContext(0), VisContext(0), ParsingDeclDepth(0), 137 IdResolver(pp.getLangOptions()), CXXTypeInfoDecl(0), MSVCGuidDecl(0), 138 GlobalNewDeleteDeclared(false), 139 CompleteTranslationUnit(CompleteTranslationUnit), 140 NumSFINAEErrors(0), SuppressAccessChecking(false), 141 NonInstantiationEntries(0), CurrentInstantiationScope(0), TyposCorrected(0), 142 AnalysisWarnings(*this) 143{ 144 TUScope = 0; 145 if (getLangOptions().CPlusPlus) 146 FieldCollector.reset(new CXXFieldCollector()); 147 148 // Tell diagnostics how to render things from the AST library. 149 PP.getDiagnostics().SetArgToStringFn(&FormatASTNodeDiagnosticArgument, 150 &Context); 151 152 ExprEvalContexts.push_back( 153 ExpressionEvaluationContextRecord(PotentiallyEvaluated, 0)); 154 155 FunctionScopes.push_back(new FunctionScopeInfo(Diags.getNumErrors())); 156} 157 158void Sema::Initialize() { 159 // Tell the AST consumer about this Sema object. 160 Consumer.Initialize(Context); 161 162 // FIXME: Isn't this redundant with the initialization above? 163 if (SemaConsumer *SC = dyn_cast<SemaConsumer>(&Consumer)) 164 SC->InitializeSema(*this); 165 166 // Tell the external Sema source about this Sema object. 167 if (ExternalSemaSource *ExternalSema 168 = dyn_cast_or_null<ExternalSemaSource>(Context.getExternalSource())) 169 ExternalSema->InitializeSema(*this); 170} 171 172Sema::~Sema() { 173 if (PackContext) FreePackedContext(); 174 if (VisContext) FreeVisContext(); 175 delete TheTargetAttributesSema; 176 177 // Kill all the active scopes. 178 for (unsigned I = 1, E = FunctionScopes.size(); I != E; ++I) 179 delete FunctionScopes[I]; 180 if (FunctionScopes.size() == 1) 181 delete FunctionScopes[0]; 182 183 // Tell the SemaConsumer to forget about us; we're going out of scope. 184 if (SemaConsumer *SC = dyn_cast<SemaConsumer>(&Consumer)) 185 SC->ForgetSema(); 186 187 // Detach from the external Sema source. 188 if (ExternalSemaSource *ExternalSema 189 = dyn_cast_or_null<ExternalSemaSource>(Context.getExternalSource())) 190 ExternalSema->ForgetSema(); 191} 192 193/// ImpCastExprToType - If Expr is not of type 'Type', insert an implicit cast. 194/// If there is already an implicit cast, merge into the existing one. 195/// The result is of the given category. 196void Sema::ImpCastExprToType(Expr *&Expr, QualType Ty, 197 CastKind Kind, ExprValueKind VK, 198 const CXXCastPath *BasePath) { 199 QualType ExprTy = Context.getCanonicalType(Expr->getType()); 200 QualType TypeTy = Context.getCanonicalType(Ty); 201 202 if (ExprTy == TypeTy) 203 return; 204 205 if (Expr->getType()->isPointerType() && Ty->isPointerType()) { 206 QualType ExprBaseType = cast<PointerType>(ExprTy)->getPointeeType(); 207 QualType BaseType = cast<PointerType>(TypeTy)->getPointeeType(); 208 if (ExprBaseType.getAddressSpace() != BaseType.getAddressSpace()) { 209 Diag(Expr->getExprLoc(), diag::err_implicit_pointer_address_space_cast) 210 << Expr->getSourceRange(); 211 } 212 } 213 214 // If this is a derived-to-base cast to a through a virtual base, we 215 // need a vtable. 216 if (Kind == CK_DerivedToBase && 217 BasePathInvolvesVirtualBase(*BasePath)) { 218 QualType T = Expr->getType(); 219 if (const PointerType *Pointer = T->getAs<PointerType>()) 220 T = Pointer->getPointeeType(); 221 if (const RecordType *RecordTy = T->getAs<RecordType>()) 222 MarkVTableUsed(Expr->getLocStart(), 223 cast<CXXRecordDecl>(RecordTy->getDecl())); 224 } 225 226 if (ImplicitCastExpr *ImpCast = dyn_cast<ImplicitCastExpr>(Expr)) { 227 if (ImpCast->getCastKind() == Kind && (!BasePath || BasePath->empty())) { 228 ImpCast->setType(Ty); 229 ImpCast->setValueKind(VK); 230 return; 231 } 232 } 233 234 Expr = ImplicitCastExpr::Create(Context, Ty, Kind, Expr, BasePath, VK); 235} 236 237ExprValueKind Sema::CastCategory(Expr *E) { 238 Expr::Classification Classification = E->Classify(Context); 239 return Classification.isRValue() ? VK_RValue : 240 (Classification.isLValue() ? VK_LValue : VK_XValue); 241} 242 243/// \brief Used to prune the decls of Sema's UnusedFileScopedDecls vector. 244static bool ShouldRemoveFromUnused(Sema *SemaRef, const DeclaratorDecl *D) { 245 if (D->isUsed()) 246 return true; 247 248 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { 249 // UnusedFileScopedDecls stores the first declaration. 250 // The declaration may have become definition so check again. 251 const FunctionDecl *DeclToCheck; 252 if (FD->hasBody(DeclToCheck)) 253 return !SemaRef->ShouldWarnIfUnusedFileScopedDecl(DeclToCheck); 254 255 // Later redecls may add new information resulting in not having to warn, 256 // so check again. 257 DeclToCheck = FD->getMostRecentDeclaration(); 258 if (DeclToCheck != FD) 259 return !SemaRef->ShouldWarnIfUnusedFileScopedDecl(DeclToCheck); 260 } 261 262 if (const VarDecl *VD = dyn_cast<VarDecl>(D)) { 263 // UnusedFileScopedDecls stores the first declaration. 264 // The declaration may have become definition so check again. 265 const VarDecl *DeclToCheck = VD->getDefinition(); 266 if (DeclToCheck) 267 return !SemaRef->ShouldWarnIfUnusedFileScopedDecl(DeclToCheck); 268 269 // Later redecls may add new information resulting in not having to warn, 270 // so check again. 271 DeclToCheck = VD->getMostRecentDeclaration(); 272 if (DeclToCheck != VD) 273 return !SemaRef->ShouldWarnIfUnusedFileScopedDecl(DeclToCheck); 274 } 275 276 return false; 277} 278 279/// ActOnEndOfTranslationUnit - This is called at the very end of the 280/// translation unit when EOF is reached and all but the top-level scope is 281/// popped. 282void Sema::ActOnEndOfTranslationUnit() { 283 // At PCH writing, implicit instantiations and VTable handling info are 284 // stored and performed when the PCH is included. 285 if (CompleteTranslationUnit) 286 while (1) { 287 // C++: Perform implicit template instantiations. 288 // 289 // FIXME: When we perform these implicit instantiations, we do not 290 // carefully keep track of the point of instantiation (C++ [temp.point]). 291 // This means that name lookup that occurs within the template 292 // instantiation will always happen at the end of the translation unit, 293 // so it will find some names that should not be found. Although this is 294 // common behavior for C++ compilers, it is technically wrong. In the 295 // future, we either need to be able to filter the results of name lookup 296 // or we need to perform template instantiations earlier. 297 PerformPendingInstantiations(); 298 299 /// If DefinedUsedVTables ends up marking any virtual member 300 /// functions it might lead to more pending template 301 /// instantiations, which is why we need to loop here. 302 if (!DefineUsedVTables()) 303 break; 304 } 305 306 // Remove file scoped decls that turned out to be used. 307 UnusedFileScopedDecls.erase(std::remove_if(UnusedFileScopedDecls.begin(), 308 UnusedFileScopedDecls.end(), 309 std::bind1st(std::ptr_fun(ShouldRemoveFromUnused), 310 this)), 311 UnusedFileScopedDecls.end()); 312 313 if (!CompleteTranslationUnit) { 314 TUScope = 0; 315 return; 316 } 317 318 // Check for #pragma weak identifiers that were never declared 319 // FIXME: This will cause diagnostics to be emitted in a non-determinstic 320 // order! Iterating over a densemap like this is bad. 321 for (llvm::DenseMap<IdentifierInfo*,WeakInfo>::iterator 322 I = WeakUndeclaredIdentifiers.begin(), 323 E = WeakUndeclaredIdentifiers.end(); I != E; ++I) { 324 if (I->second.getUsed()) continue; 325 326 Diag(I->second.getLocation(), diag::warn_weak_identifier_undeclared) 327 << I->first; 328 } 329 330 // C99 6.9.2p2: 331 // A declaration of an identifier for an object that has file 332 // scope without an initializer, and without a storage-class 333 // specifier or with the storage-class specifier static, 334 // constitutes a tentative definition. If a translation unit 335 // contains one or more tentative definitions for an identifier, 336 // and the translation unit contains no external definition for 337 // that identifier, then the behavior is exactly as if the 338 // translation unit contains a file scope declaration of that 339 // identifier, with the composite type as of the end of the 340 // translation unit, with an initializer equal to 0. 341 llvm::SmallSet<VarDecl *, 32> Seen; 342 for (unsigned i = 0, e = TentativeDefinitions.size(); i != e; ++i) { 343 VarDecl *VD = TentativeDefinitions[i]->getActingDefinition(); 344 345 // If the tentative definition was completed, getActingDefinition() returns 346 // null. If we've already seen this variable before, insert()'s second 347 // return value is false. 348 if (VD == 0 || VD->isInvalidDecl() || !Seen.insert(VD)) 349 continue; 350 351 if (const IncompleteArrayType *ArrayT 352 = Context.getAsIncompleteArrayType(VD->getType())) { 353 if (RequireCompleteType(VD->getLocation(), 354 ArrayT->getElementType(), 355 diag::err_tentative_def_incomplete_type_arr)) { 356 VD->setInvalidDecl(); 357 continue; 358 } 359 360 // Set the length of the array to 1 (C99 6.9.2p5). 361 Diag(VD->getLocation(), diag::warn_tentative_incomplete_array); 362 llvm::APInt One(Context.getTypeSize(Context.getSizeType()), true); 363 QualType T = Context.getConstantArrayType(ArrayT->getElementType(), 364 One, ArrayType::Normal, 0); 365 VD->setType(T); 366 } else if (RequireCompleteType(VD->getLocation(), VD->getType(), 367 diag::err_tentative_def_incomplete_type)) 368 VD->setInvalidDecl(); 369 370 // Notify the consumer that we've completed a tentative definition. 371 if (!VD->isInvalidDecl()) 372 Consumer.CompleteTentativeDefinition(VD); 373 374 } 375 376 // Output warning for unused file scoped decls. 377 for (llvm::SmallVectorImpl<const DeclaratorDecl*>::iterator 378 I = UnusedFileScopedDecls.begin(), 379 E = UnusedFileScopedDecls.end(); I != E; ++I) { 380 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(*I)) { 381 const FunctionDecl *DiagD; 382 if (!FD->hasBody(DiagD)) 383 DiagD = FD; 384 Diag(DiagD->getLocation(), 385 isa<CXXMethodDecl>(DiagD) ? diag::warn_unused_member_function 386 : diag::warn_unused_function) 387 << DiagD->getDeclName(); 388 } else { 389 const VarDecl *DiagD = cast<VarDecl>(*I)->getDefinition(); 390 if (!DiagD) 391 DiagD = cast<VarDecl>(*I); 392 Diag(DiagD->getLocation(), diag::warn_unused_variable) 393 << DiagD->getDeclName(); 394 } 395 } 396 397 TUScope = 0; 398} 399 400 401//===----------------------------------------------------------------------===// 402// Helper functions. 403//===----------------------------------------------------------------------===// 404 405DeclContext *Sema::getFunctionLevelDeclContext() { 406 DeclContext *DC = CurContext; 407 408 while (isa<BlockDecl>(DC) || isa<EnumDecl>(DC)) 409 DC = DC->getParent(); 410 411 return DC; 412} 413 414/// getCurFunctionDecl - If inside of a function body, this returns a pointer 415/// to the function decl for the function being parsed. If we're currently 416/// in a 'block', this returns the containing context. 417FunctionDecl *Sema::getCurFunctionDecl() { 418 DeclContext *DC = getFunctionLevelDeclContext(); 419 return dyn_cast<FunctionDecl>(DC); 420} 421 422ObjCMethodDecl *Sema::getCurMethodDecl() { 423 DeclContext *DC = getFunctionLevelDeclContext(); 424 return dyn_cast<ObjCMethodDecl>(DC); 425} 426 427NamedDecl *Sema::getCurFunctionOrMethodDecl() { 428 DeclContext *DC = getFunctionLevelDeclContext(); 429 if (isa<ObjCMethodDecl>(DC) || isa<FunctionDecl>(DC)) 430 return cast<NamedDecl>(DC); 431 return 0; 432} 433 434Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder() { 435 if (!this->Emit()) 436 return; 437 438 // If this is not a note, and we're in a template instantiation 439 // that is different from the last template instantiation where 440 // we emitted an error, print a template instantiation 441 // backtrace. 442 if (!SemaRef.Diags.isBuiltinNote(DiagID) && 443 !SemaRef.ActiveTemplateInstantiations.empty() && 444 SemaRef.ActiveTemplateInstantiations.back() 445 != SemaRef.LastTemplateInstantiationErrorContext) { 446 SemaRef.PrintInstantiationStack(); 447 SemaRef.LastTemplateInstantiationErrorContext 448 = SemaRef.ActiveTemplateInstantiations.back(); 449 } 450} 451 452Sema::SemaDiagnosticBuilder Sema::Diag(SourceLocation Loc, unsigned DiagID) { 453 if (isSFINAEContext()) { 454 switch (Diagnostic::getDiagnosticSFINAEResponse(DiagID)) { 455 case Diagnostic::SFINAE_Report: 456 // Fall through; we'll report the diagnostic below. 457 break; 458 459 case Diagnostic::SFINAE_SubstitutionFailure: 460 // Count this failure so that we know that template argument deduction 461 // has failed. 462 ++NumSFINAEErrors; 463 // Fall through 464 465 case Diagnostic::SFINAE_Suppress: 466 // Suppress this diagnostic. 467 Diags.setLastDiagnosticIgnored(); 468 return SemaDiagnosticBuilder(*this); 469 } 470 } 471 472 DiagnosticBuilder DB = Diags.Report(FullSourceLoc(Loc, SourceMgr), DiagID); 473 return SemaDiagnosticBuilder(DB, *this, DiagID); 474} 475 476Sema::SemaDiagnosticBuilder 477Sema::Diag(SourceLocation Loc, const PartialDiagnostic& PD) { 478 SemaDiagnosticBuilder Builder(Diag(Loc, PD.getDiagID())); 479 PD.Emit(Builder); 480 481 return Builder; 482} 483 484/// \brief Determines the active Scope associated with the given declaration 485/// context. 486/// 487/// This routine maps a declaration context to the active Scope object that 488/// represents that declaration context in the parser. It is typically used 489/// from "scope-less" code (e.g., template instantiation, lazy creation of 490/// declarations) that injects a name for name-lookup purposes and, therefore, 491/// must update the Scope. 492/// 493/// \returns The scope corresponding to the given declaraion context, or NULL 494/// if no such scope is open. 495Scope *Sema::getScopeForContext(DeclContext *Ctx) { 496 497 if (!Ctx) 498 return 0; 499 500 Ctx = Ctx->getPrimaryContext(); 501 for (Scope *S = getCurScope(); S; S = S->getParent()) { 502 // Ignore scopes that cannot have declarations. This is important for 503 // out-of-line definitions of static class members. 504 if (S->getFlags() & (Scope::DeclScope | Scope::TemplateParamScope)) 505 if (DeclContext *Entity = static_cast<DeclContext *> (S->getEntity())) 506 if (Ctx == Entity->getPrimaryContext()) 507 return S; 508 } 509 510 return 0; 511} 512 513/// \brief Enter a new function scope 514void Sema::PushFunctionScope() { 515 if (FunctionScopes.size() == 1) { 516 // Use the "top" function scope rather than having to allocate 517 // memory for a new scope. 518 FunctionScopes.back()->Clear(getDiagnostics().getNumErrors()); 519 FunctionScopes.push_back(FunctionScopes.back()); 520 return; 521 } 522 523 FunctionScopes.push_back( 524 new FunctionScopeInfo(getDiagnostics().getNumErrors())); 525} 526 527void Sema::PushBlockScope(Scope *BlockScope, BlockDecl *Block) { 528 FunctionScopes.push_back(new BlockScopeInfo(getDiagnostics().getNumErrors(), 529 BlockScope, Block)); 530} 531 532void Sema::PopFunctionOrBlockScope() { 533 FunctionScopeInfo *Scope = FunctionScopes.pop_back_val(); 534 assert(!FunctionScopes.empty() && "mismatched push/pop!"); 535 if (FunctionScopes.back() != Scope) 536 delete Scope; 537} 538 539/// \brief Determine whether any errors occurred within this function/method/ 540/// block. 541bool Sema::hasAnyErrorsInThisFunction() const { 542 return getCurFunction()->NumErrorsAtStartOfFunction 543 != getDiagnostics().getNumErrors(); 544} 545 546BlockScopeInfo *Sema::getCurBlock() { 547 if (FunctionScopes.empty()) 548 return 0; 549 550 return dyn_cast<BlockScopeInfo>(FunctionScopes.back()); 551} 552 553// Pin this vtable to this file. 554ExternalSemaSource::~ExternalSemaSource() {} 555 556void PrettyDeclStackTraceEntry::print(llvm::raw_ostream &OS) const { 557 SourceLocation Loc = this->Loc; 558 if (!Loc.isValid() && TheDecl) Loc = TheDecl->getLocation(); 559 if (Loc.isValid()) { 560 Loc.print(OS, S.getSourceManager()); 561 OS << ": "; 562 } 563 OS << Message; 564 565 if (TheDecl && isa<NamedDecl>(TheDecl)) { 566 std::string Name = cast<NamedDecl>(TheDecl)->getNameAsString(); 567 if (!Name.empty()) 568 OS << " '" << Name << '\''; 569 } 570 571 OS << '\n'; 572} 573