//===--- Sema.cpp - AST Builder and Semantic Analysis Implementation ------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This file implements the actions class which performs semantic analysis and// builds an AST out of a parse stream.////===----------------------------------------------------------------------===//#include"clang/Sema/SemaInternal.h"#include"clang/Sema/DelayedDiagnostic.h"#include"TargetAttributesSema.h"#include"llvm/ADT/DenseMap.h"#include"llvm/ADT/SmallSet.h"#include"llvm/ADT/APFloat.h"#include"llvm/Support/CrashRecoveryContext.h"#include"clang/Sema/CXXFieldCollector.h"#include"clang/Sema/TemplateDeduction.h"#include"clang/Sema/ExternalSemaSource.h"#include"clang/Sema/ObjCMethodList.h"#include"clang/Sema/PrettyDeclStackTrace.h"#include"clang/Sema/Scope.h"#include"clang/Sema/ScopeInfo.h"#include"clang/Sema/SemaConsumer.h"#include"clang/AST/ASTContext.h"#include"clang/AST/ASTDiagnostic.h"#include"clang/AST/DeclCXX.h"#include"clang/AST/DeclFriend.h"#include"clang/AST/DeclObjC.h"#include"clang/AST/Expr.h"#include"clang/AST/ExprCXX.h"#include"clang/AST/StmtCXX.h"#include"clang/Lex/HeaderSearch.h"#include"clang/Lex/Preprocessor.h"#include"clang/Basic/FileManager.h"#include"clang/Basic/PartialDiagnostic.h"#include"clang/Basic/TargetInfo.h"usingnamespaceclang;usingnamespacesema;FunctionScopeInfo::~FunctionScopeInfo(){}voidFunctionScopeInfo::Clear(){HasBranchProtectedScope=false;HasBranchIntoScope=false;HasIndirectGoto=false;SwitchStack.clear();Returns.clear();ErrorTrap.reset();PossiblyUnreachableDiags.clear();WeakObjectUses.clear();}staticconstNamedDecl*getBestPropertyDecl(constObjCPropertyRefExpr*PropE){if(PropE->isExplicitProperty())returnPropE->getExplicitProperty();returnPropE->getImplicitPropertyGetter();}staticboolisSelfExpr(constExpr*E){E=E->IgnoreParenImpCasts();constDeclRefExpr*DRE=dyn_cast<DeclRefExpr>(E);if(!DRE)returnfalse;