diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-03-06 09:23:02 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-03-06 09:23:02 +0000 |
commit | dd5132ce2569a1ef901c92772eb8581aa1705f25 (patch) | |
tree | 7e0a88c3c6cb70271946aaa95a231b3da55d9f91 /include | |
parent | 79ade4e028932fcb9dab15e2fb2305ca15ab0f14 (diff) | |
download | src-dd5132ce2569a1ef901c92772eb8581aa1705f25.tar.gz src-dd5132ce2569a1ef901c92772eb8581aa1705f25.zip |
Update clang to r97873.
Notes
Notes:
svn path=/vendor/clang/dist/; revision=204793
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/AST/ASTContext.h | 3 | ||||
-rw-r--r-- | include/clang/AST/DeclBase.h | 2 | ||||
-rw-r--r-- | include/clang/Basic/Builtins.def | 5 | ||||
-rw-r--r-- | include/clang/Basic/BuiltinsARM.def | 20 | ||||
-rw-r--r-- | include/clang/Basic/BuiltinsX86.def | 4 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 9 | ||||
-rw-r--r-- | include/clang/Basic/TargetBuiltins.h | 18 | ||||
-rw-r--r-- | include/clang/Basic/TokenKinds.def | 4 | ||||
-rw-r--r-- | include/clang/Checker/PathSensitive/Environment.h | 12 | ||||
-rw-r--r-- | include/clang/Checker/PathSensitive/GRState.h | 13 | ||||
-rw-r--r-- | include/clang/Checker/PathSensitive/SymbolManager.h | 15 | ||||
-rw-r--r-- | include/clang/Driver/HostInfo.h | 2 | ||||
-rw-r--r-- | include/clang/Driver/Options.td | 5 | ||||
-rw-r--r-- | include/clang/Frontend/ASTUnit.h | 30 |
14 files changed, 101 insertions, 41 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 6767f52f4d83..0838a3d0ebe6 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -621,7 +621,8 @@ public: /// given interface decl and the conforming protocol list. QualType getObjCObjectPointerType(QualType OIT, ObjCProtocolDecl **ProtocolList = 0, - unsigned NumProtocols = 0); + unsigned NumProtocols = 0, + unsigned Quals = 0); /// getTypeOfType - GCC extension. QualType getTypeOfExprType(Expr *e); diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index 7fb5f9daae17..0bdc6f54b7ca 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -268,7 +268,7 @@ public: /// setInvalidDecl - Indicates the Decl had a semantic error. This /// allows for graceful error recovery. - void setInvalidDecl(bool Invalid = true) { InvalidDecl = Invalid; } + void setInvalidDecl(bool Invalid = true); bool isInvalidDecl() const { return (bool) InvalidDecl; } /// isImplicit - Indicates whether the declaration was implicitly diff --git a/include/clang/Basic/Builtins.def b/include/clang/Basic/Builtins.def index 9442ac328700..af233b81e0a5 100644 --- a/include/clang/Basic/Builtins.def +++ b/include/clang/Basic/Builtins.def @@ -240,6 +240,11 @@ BUILTIN(__builtin_isinf_sign, "i.", "nc") BUILTIN(__builtin_isnan, "i.", "nc") BUILTIN(__builtin_isnormal, "i.", "nc") +// FP signbit builtins +BUILTIN(__builtin_signbit, "id", "nc") +BUILTIN(__builtin_signbitf, "if", "nc") +BUILTIN(__builtin_signbitl, "iLd", "nc") + // Builtins for arithmetic. BUILTIN(__builtin_clz , "iUi" , "nc") BUILTIN(__builtin_clzl , "iULi" , "nc") diff --git a/include/clang/Basic/BuiltinsARM.def b/include/clang/Basic/BuiltinsARM.def new file mode 100644 index 000000000000..4973076ae24d --- /dev/null +++ b/include/clang/Basic/BuiltinsARM.def @@ -0,0 +1,20 @@ +//===--- BuiltinsARM.def - ARM Builtin function database ----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the ARM-specific builtin function database. Users of +// this file must define the BUILTIN macro to make use of this information. +// +//===----------------------------------------------------------------------===// + +// The format of this database matches clang/Basic/Builtins.def. + +// FIXME: This is just a placeholder. NEON intrinsics should be listed here. +BUILTIN(__builtin_thread_pointer, "v*", "") + +#undef BUILTIN diff --git a/include/clang/Basic/BuiltinsX86.def b/include/clang/Basic/BuiltinsX86.def index 0062846a7a52..5d80528817c4 100644 --- a/include/clang/Basic/BuiltinsX86.def +++ b/include/clang/Basic/BuiltinsX86.def @@ -281,8 +281,8 @@ BUILTIN(__builtin_ia32_pmovzxwq128, "V2LLiV8s", "") BUILTIN(__builtin_ia32_pmuldq128, "V2LLiV4iV4i", "") BUILTIN(__builtin_ia32_pmulld128, "V4iV4iV4i", "") BUILTIN(__builtin_ia32_roundps, "V4fV4fi", "") -BUILTIN(__builtin_ia32_roundss, "V4fV4fi", "") -BUILTIN(__builtin_ia32_roundsd, "V2dV2di", "") +BUILTIN(__builtin_ia32_roundss, "V4fV4fV4fi", "") +BUILTIN(__builtin_ia32_roundsd, "V2dV2dV2di", "") BUILTIN(__builtin_ia32_roundpd, "V2dV2di", "") diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 9f77655052eb..badd64c31b56 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -1587,11 +1587,12 @@ def err_undeclared_label_use : Error<"use of undeclared label '%0'">; def err_goto_into_protected_scope : Error<"illegal goto into protected scope">; def err_switch_into_protected_scope : Error< "illegal switch case into protected scope">; -def err_indirect_goto_in_protected_scope : Error< - "illegal indirect goto in protected scope, unknown effect on scopes">; -def err_addr_of_label_in_protected_scope : Error< +def err_indirect_goto_in_protected_scope : Warning< + "illegal indirect goto in protected scope, unknown effect on scopes">, + InGroup<DiagGroup<"label-address-scope">>; +def err_addr_of_label_in_protected_scope : Warning< "address taken of label in protected scope, jump to it would have " - "unknown effect on scope">; + "unknown effect on scope">, InGroup<DiagGroup<"label-address-scope">>; def note_protected_by_variable_init : Note< "jump bypasses variable initialization">; def note_protected_by_vla_typedef : Note< diff --git a/include/clang/Basic/TargetBuiltins.h b/include/clang/Basic/TargetBuiltins.h index d2e949501748..f1edd1d45162 100644 --- a/include/clang/Basic/TargetBuiltins.h +++ b/include/clang/Basic/TargetBuiltins.h @@ -14,12 +14,13 @@ #undef PPC namespace clang { - /// X86 builtins - namespace X86 { + + /// ARM builtins + namespace ARM { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, #define BUILTIN(ID, TYPE, ATTRS) BI##ID, -#include "clang/Basic/BuiltinsX86.def" +#include "clang/Basic/BuiltinsARM.def" LastTSBuiltin }; } @@ -33,6 +34,17 @@ namespace clang { LastTSBuiltin }; } + + /// X86 builtins + namespace X86 { + enum { + LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, +#define BUILTIN(ID, TYPE, ATTRS) BI##ID, +#include "clang/Basic/BuiltinsX86.def" + LastTSBuiltin + }; + } + } // end namespace clang. #endif diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def index 522ac13b4e32..52e83f4045ef 100644 --- a/include/clang/Basic/TokenKinds.def +++ b/include/clang/Basic/TokenKinds.def @@ -336,8 +336,6 @@ KEYWORD(__declspec , KEYALL) KEYWORD(__cdecl , KEYALL) KEYWORD(__stdcall , KEYALL) KEYWORD(__fastcall , KEYALL) -KEYWORD(__ptr64 , KEYALL) -KEYWORD(__w64 , KEYALL) KEYWORD(__forceinline , KEYALL) // Altivec Extension. @@ -368,6 +366,8 @@ ALIAS("__volatile" , volatile , KEYALL) ALIAS("__volatile__" , volatile , KEYALL) // Microsoft extensions which should be disabled in strict conformance mode +KEYWORD(__ptr64 , KEYMS) +KEYWORD(__w64 , KEYMS) ALIAS("_asm" , asm , KEYMS) ALIAS("_cdecl" , __cdecl , KEYMS) ALIAS("_fastcall" , __fastcall , KEYMS) diff --git a/include/clang/Checker/PathSensitive/Environment.h b/include/clang/Checker/PathSensitive/Environment.h index 0852c31faeb6..6051654f4855 100644 --- a/include/clang/Checker/PathSensitive/Environment.h +++ b/include/clang/Checker/PathSensitive/Environment.h @@ -26,7 +26,6 @@ namespace clang { -class AnalysisContext; class EnvironmentManager; class ValueManager; class LiveVariables; @@ -41,10 +40,9 @@ private: // Data. BindingsTy ExprBindings; - AnalysisContext *ACtx; - Environment(BindingsTy eb, AnalysisContext *aCtx) - : ExprBindings(eb), ACtx(aCtx) {} + Environment(BindingsTy eb) + : ExprBindings(eb) {} public: typedef BindingsTy::iterator iterator; @@ -58,8 +56,6 @@ public: SVal GetSVal(const Stmt* Ex, ValueManager& ValMgr) const; - AnalysisContext &getAnalysisContext() const { return *ACtx; } - /// Profile - Profile the contents of an Environment object for use /// in a FoldingSet. static void Profile(llvm::FoldingSetNodeID& ID, const Environment* E) { @@ -86,8 +82,8 @@ public: EnvironmentManager(llvm::BumpPtrAllocator& Allocator) : F(Allocator) {} ~EnvironmentManager() {} - Environment getInitialEnvironment(AnalysisContext *ACtx) { - return Environment(F.GetEmptyMap(), ACtx); + Environment getInitialEnvironment() { + return Environment(F.GetEmptyMap()); } Environment BindExpr(Environment Env, const Stmt *S, SVal V, diff --git a/include/clang/Checker/PathSensitive/GRState.h b/include/clang/Checker/PathSensitive/GRState.h index 9194ee88a1a9..1178143bccdd 100644 --- a/include/clang/Checker/PathSensitive/GRState.h +++ b/include/clang/Checker/PathSensitive/GRState.h @@ -109,12 +109,6 @@ public: return *StateMgr; } - /// getAnalysisContext - Return the AnalysisContext associated with this - /// state. - AnalysisContext &getAnalysisContext() const { - return Env.getAnalysisContext(); - } - /// getEnvironment - Return the environment associated with this state. /// The environment is the mapping from expressions to values. const Environment& getEnvironment() const { return Env; } @@ -133,7 +127,6 @@ public: /// Profile - Profile the contents of a GRState object for use /// in a FoldingSet. static void Profile(llvm::FoldingSetNodeID& ID, const GRState* V) { - // FIXME: Do we need to include the AnalysisContext in the profile? V->Env.Profile(ID); ID.AddPointer(V->St); V->GDM.Profile(ID); @@ -337,12 +330,12 @@ public: }; // Pretty-printing. - void print(llvm::raw_ostream& Out, const char *nl = "\n", + void print(llvm::raw_ostream& Out, CFG &C, const char *nl = "\n", const char *sep = "") const; - void printStdErr() const; + void printStdErr(CFG &C) const; - void printDOT(llvm::raw_ostream& Out) const; + void printDOT(llvm::raw_ostream& Out, CFG &C) const; }; class GRStateSet { diff --git a/include/clang/Checker/PathSensitive/SymbolManager.h b/include/clang/Checker/PathSensitive/SymbolManager.h index d49f5e81c802..b6630c3d97d2 100644 --- a/include/clang/Checker/PathSensitive/SymbolManager.h +++ b/include/clang/Checker/PathSensitive/SymbolManager.h @@ -331,23 +331,20 @@ class SymbolReaper { SetTy TheLiving; SetTy TheDead; - LiveVariables& Liveness; + const LocationContext *LCtx; SymbolManager& SymMgr; - const StackFrameContext *CurrentStackFrame; public: - SymbolReaper(LiveVariables& liveness, SymbolManager& symmgr, - const StackFrameContext *currentStackFrame) - : Liveness(liveness), SymMgr(symmgr), CurrentStackFrame(currentStackFrame) - {} + SymbolReaper(const LocationContext *ctx, SymbolManager& symmgr) + : LCtx(ctx), SymMgr(symmgr) {} ~SymbolReaper() {} + const LocationContext *getLocationContext() const { return LCtx; } + bool isLive(SymbolRef sym); - bool isLive(const Stmt* Loc, const Stmt* ExprVal) const { - return Liveness.isLive(Loc, ExprVal); - } + bool isLive(const Stmt* Loc, const Stmt* ExprVal) const; bool isLive(const Stmt* Loc, const VarRegion *VR) const; diff --git a/include/clang/Driver/HostInfo.h b/include/clang/Driver/HostInfo.h index bf67c343f326..ca1ee9aa7766 100644 --- a/include/clang/Driver/HostInfo.h +++ b/include/clang/Driver/HostInfo.h @@ -80,6 +80,8 @@ const HostInfo *createDragonFlyHostInfo(const Driver &D, const llvm::Triple& Triple); const HostInfo *createLinuxHostInfo(const Driver &D, const llvm::Triple& Triple); +const HostInfo *createTCEHostInfo(const Driver &D, + const llvm::Triple& Triple); const HostInfo *createUnknownHostInfo(const Driver &D, const llvm::Triple& Triple); diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index b462a4d48ed5..3eb74ca59525 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -64,6 +64,7 @@ def clang_ignored_m_Group : OptionGroup<"<clang ignored m group>">, // , => _COMMA // = => _EQ // C++ => CXX +// . => _ // Developer Driver Options @@ -420,6 +421,8 @@ def mno_sse2 : Flag<"-mno-sse2">, Group<m_x86_Features_Group>; def mno_sse3 : Flag<"-mno-sse3">, Group<m_x86_Features_Group>; def mno_sse4a : Flag<"-mno-sse4a">, Group<m_x86_Features_Group>; def mno_sse4 : Flag<"-mno-sse4">, Group<m_x86_Features_Group>; +def mno_sse4_1 : Flag<"-mno-sse4.1">, Group<m_x86_Features_Group>; +def mno_sse4_2 : Flag<"-mno-sse4.2">, Group<m_x86_Features_Group>; def mno_sse : Flag<"-mno-sse">, Group<m_x86_Features_Group>; def mno_ssse3 : Flag<"-mno-ssse3">, Group<m_x86_Features_Group>; @@ -434,6 +437,8 @@ def msse2 : Flag<"-msse2">, Group<m_x86_Features_Group>; def msse3 : Flag<"-msse3">, Group<m_x86_Features_Group>; def msse4a : Flag<"-msse4a">, Group<m_x86_Features_Group>; def msse4 : Flag<"-msse4">, Group<m_x86_Features_Group>; +def msse4_1 : Flag<"-msse4.1">, Group<m_x86_Features_Group>; +def msse4_2 : Flag<"-msse4.2">, Group<m_x86_Features_Group>; def msse : Flag<"-msse">, Group<m_x86_Features_Group>; def mssse3 : Flag<"-mssse3">, Group<m_x86_Features_Group>; def mthumb : Flag<"-mthumb">, Group<m_Group>; diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index 626a162371bd..7f11c85ae35b 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -88,11 +88,39 @@ class ASTUnit { /// \brief Temporary files that should be removed when the ASTUnit is /// destroyed. llvm::SmallVector<llvm::sys::Path, 4> TemporaryFiles; + + /// \brief Simple hack to allow us to assert that ASTUnit is not being + /// used concurrently, which is not supported. + /// + /// Clients should create instances of the ConcurrencyCheck class whenever + /// using the ASTUnit in a way that isn't intended to be concurrent, which is + /// just about any usage. + unsigned int ConcurrencyCheckValue; + static const unsigned int CheckLocked = 28573289; + static const unsigned int CheckUnlocked = 9803453; ASTUnit(const ASTUnit&); // DO NOT IMPLEMENT ASTUnit &operator=(const ASTUnit &); // DO NOT IMPLEMENT - + public: + class ConcurrencyCheck { + volatile ASTUnit &Self; + + public: + explicit ConcurrencyCheck(ASTUnit &Self) + : Self(Self) + { + assert(Self.ConcurrencyCheckValue == CheckUnlocked && + "Concurrent access to ASTUnit!"); + Self.ConcurrencyCheckValue = CheckLocked; + } + + ~ConcurrencyCheck() { + Self.ConcurrencyCheckValue = CheckUnlocked; + } + }; + friend class ConcurrencyCheck; + ASTUnit(bool MainFileIsAST); ~ASTUnit(); |