diff options
Diffstat (limited to 'include/clang')
37 files changed, 134 insertions, 10 deletions
diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h index 345cc94510..449e916eb1 100644 --- a/include/clang/AST/Attr.h +++ b/include/clang/AST/Attr.h @@ -112,6 +112,7 @@ public: }; class InheritableAttr : public Attr { + virtual void anchor(); protected: InheritableAttr(attr::Kind AK, SourceRange R) : Attr(AK, R) {} @@ -127,6 +128,7 @@ public: }; class InheritableParamAttr : public InheritableAttr { + virtual void anchor(); protected: InheritableParamAttr(attr::Kind AK, SourceRange R) : InheritableAttr(AK, R) {} diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 0a24b72560..6b97a5775a 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -67,6 +67,7 @@ public: /// TranslationUnitDecl - The top declaration context. class TranslationUnitDecl : public Decl, public DeclContext { + virtual void anchor(); ASTContext &Ctx; /// The (most recently entered) anonymous namespace for this @@ -99,6 +100,7 @@ public: /// NamedDecl - This represents a decl with a name. Many decls have names such /// as ObjCMethodDecl, but not @class, etc. class NamedDecl : public Decl { + virtual void anchor(); /// Name - The name of this declaration, which is typically a normal /// identifier but may also be a special kind of name (C++ /// constructor, Objective-C selector, etc.) @@ -320,6 +322,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const NamedDecl &ND) { /// location of the statement. For GNU local labels (__label__), the decl /// location is where the __label__ is. class LabelDecl : public NamedDecl { + virtual void anchor(); LabelStmt *TheStmt; /// LocStart - For normal labels, this is the same as the main declaration /// label, i.e., the location of the identifier; for GNU local labels, @@ -355,6 +358,7 @@ public: /// NamespaceDecl - Represent a C++ namespace. class NamespaceDecl : public NamedDecl, public DeclContext { + virtual void anchor(); bool IsInline : 1; /// LocStart - The starting location of the source range, pointing @@ -498,6 +502,7 @@ public: /// an lvalue) a function (in which case it is a function designator) or /// an enum constant. class ValueDecl : public NamedDecl { + virtual void anchor(); QualType DeclType; protected: @@ -1137,6 +1142,7 @@ public: }; class ImplicitParamDecl : public VarDecl { + virtual void anchor(); public: static ImplicitParamDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id, @@ -2140,6 +2146,7 @@ public: /// field injected from an anonymous union/struct into the parent scope. /// IndirectFieldDecl are always implicit. class IndirectFieldDecl : public ValueDecl { + virtual void anchor(); NamedDecl **Chaining; unsigned ChainingSize; @@ -2179,6 +2186,7 @@ public: /// TypeDecl - Represents a declaration of a type. /// class TypeDecl : public NamedDecl { + virtual void anchor(); /// TypeForDecl - This indicates the Type object that represents /// this TypeDecl. It is a cache maintained by /// ASTContext::getTypedefType, ASTContext::getTagDeclType, and @@ -2220,6 +2228,7 @@ public: /// Base class for declarations which introduce a typedef-name. class TypedefNameDecl : public TypeDecl, public Redeclarable<TypedefNameDecl> { + virtual void anchor(); /// UnderlyingType - This is the type the typedef is set to. TypeSourceInfo *TInfo; @@ -2547,6 +2556,7 @@ public: /// EnumDecl - Represents an enum. As an extension, we allow forward-declared /// enums. class EnumDecl : public TagDecl { + virtual void anchor(); /// IntegerType - This represent the integer type that the enum corresponds /// to for code generation purposes. Note that the enumerator constants may /// have a different type than this does. @@ -2866,6 +2876,7 @@ private: }; class FileScopeAsmDecl : public Decl { + virtual void anchor(); StringLiteral *AsmString; SourceLocation RParenLoc; FileScopeAsmDecl(DeclContext *DC, StringLiteral *asmstring, diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index c8a703f38f..7c040e7d2e 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -104,6 +104,7 @@ namespace clang { /// Also note that this class has nothing to do with so-called /// "access declarations" (C++98 11.3 [class.access.dcl]). class AccessSpecDecl : public Decl { + virtual void anchor(); /// ColonLoc - The location of the ':'. SourceLocation ColonLoc; @@ -1316,6 +1317,7 @@ public: /// CXXMethodDecl - Represents a static or instance method of a /// struct/union/class. class CXXMethodDecl : public FunctionDecl { + virtual void anchor(); protected: CXXMethodDecl(Kind DK, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, @@ -1325,9 +1327,9 @@ protected: : FunctionDecl(DK, RD, StartLoc, NameInfo, T, TInfo, (isStatic ? SC_Static : SC_None), SCAsWritten, isInline, isConstexpr) { - if (EndLocation.isValid()) - setRangeEnd(EndLocation); - } + if (EndLocation.isValid()) + setRangeEnd(EndLocation); + } public: static CXXMethodDecl *Create(ASTContext &C, CXXRecordDecl *RD, @@ -1690,6 +1692,7 @@ public: /// }; /// @endcode class CXXConstructorDecl : public CXXMethodDecl { + virtual void anchor(); /// IsExplicitSpecified - Whether this constructor declaration has the /// 'explicit' keyword specified. bool IsExplicitSpecified : 1; @@ -1918,6 +1921,7 @@ public: /// }; /// @endcode class CXXDestructorDecl : public CXXMethodDecl { + virtual void anchor(); /// ImplicitlyDefined - Whether this destructor was implicitly /// defined by the compiler. When false, the destructor was defined /// by the user. In C++03, this flag will have the same value as @@ -1989,6 +1993,7 @@ public: /// }; /// @endcode class CXXConversionDecl : public CXXMethodDecl { + virtual void anchor(); /// IsExplicitSpecified - Whether this conversion function declaration is /// marked "explicit", meaning that it can only be applied when the user /// explicitly wrote a cast. This is a C++0x feature. @@ -2045,6 +2050,7 @@ public: /// extern "C" void foo(); /// class LinkageSpecDecl : public Decl, public DeclContext { + virtual void anchor(); public: /// LanguageIDs - Used to represent the language in a linkage /// specification. The values are part of the serialization abi for @@ -2117,9 +2123,10 @@ public: /// using namespace std; /// // NB: UsingDirectiveDecl should be Decl not NamedDecl, but we provide -// artificial name, for all using-directives in order to store +// artificial names for all using-directives in order to store // them in DeclContext effectively. class UsingDirectiveDecl : public NamedDecl { + virtual void anchor(); /// \brief The location of the "using" keyword. SourceLocation UsingLoc; @@ -2219,6 +2226,8 @@ public: /// namespace Foo = Bar; /// @endcode class NamespaceAliasDecl : public NamedDecl { + virtual void anchor(); + /// \brief The location of the "namespace" keyword. SourceLocation NamespaceLoc; @@ -2308,6 +2317,8 @@ public: /// } /// class UsingShadowDecl : public NamedDecl { + virtual void anchor(); + /// The referenced declaration. NamedDecl *Underlying; @@ -2367,6 +2378,8 @@ public: /// UsingDecl - Represents a C++ using-declaration. For example: /// using someNameSpace::someIdentifier; class UsingDecl : public NamedDecl { + virtual void anchor(); + /// \brief The source location of the "using" location itself. SourceLocation UsingLocation; @@ -2497,6 +2510,8 @@ public: /// using Base<T>::foo; /// }; class UnresolvedUsingValueDecl : public ValueDecl { + virtual void anchor(); + /// \brief The source location of the 'using' keyword SourceLocation UsingLocation; @@ -2564,6 +2579,8 @@ public: /// The type associated with a unresolved using typename decl is /// currently always a typename type. class UnresolvedUsingTypenameDecl : public TypeDecl { + virtual void anchor(); + /// \brief The source location of the 'using' keyword SourceLocation UsingLocation; @@ -2612,6 +2629,7 @@ public: /// StaticAssertDecl - Represents a C++0x static_assert declaration. class StaticAssertDecl : public Decl { + virtual void anchor(); Expr *AssertExpr; StringLiteral *Message; SourceLocation RParenLoc; diff --git a/include/clang/AST/DeclFriend.h b/include/clang/AST/DeclFriend.h index b84e5bba86..07f696a4df 100644 --- a/include/clang/AST/DeclFriend.h +++ b/include/clang/AST/DeclFriend.h @@ -35,6 +35,7 @@ namespace clang { /// /// The semantic context of a friend decl is its declaring class. class FriendDecl : public Decl { + virtual void anchor(); public: typedef llvm::PointerUnion<NamedDecl*,TypeSourceInfo*> FriendUnion; diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index 6a0b6acc87..8cc6e7374d 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -426,6 +426,8 @@ public: /// ObjCProtocolDecl, and ObjCImplDecl. /// class ObjCContainerDecl : public NamedDecl, public DeclContext { + virtual void anchor(); + SourceLocation AtStart; // These two locations in the range mark the end of the method container. @@ -542,6 +544,8 @@ public: /// class ObjCInterfaceDecl : public ObjCContainerDecl , public Redeclarable<ObjCInterfaceDecl> { + virtual void anchor(); + /// TypeForDecl - This indicates the Type object that represents this /// TypeDecl. It is a cache maintained by ASTContext::getObjCInterfaceType mutable const Type *TypeForDecl; @@ -949,6 +953,8 @@ public: /// } /// class ObjCIvarDecl : public FieldDecl { + virtual void anchor(); + public: enum AccessControl { None, Private, Protected, Public, Package @@ -1010,7 +1016,7 @@ private: /// ObjCAtDefsFieldDecl - Represents a field declaration created by an /// @defs(...). class ObjCAtDefsFieldDecl : public FieldDecl { -private: + virtual void anchor(); ObjCAtDefsFieldDecl(DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, Expr *BW) @@ -1055,6 +1061,8 @@ public: /// id <NSDraggingInfo> anyObjectThatImplementsNSDraggingInfo; /// class ObjCProtocolDecl : public ObjCContainerDecl { + virtual void anchor(); + /// Referenced protocols ObjCProtocolList ReferencedProtocols; @@ -1173,6 +1181,8 @@ public: /// @protocol NSTextInput, NSChangeSpelling, NSDraggingInfo; /// class ObjCForwardProtocolDecl : public Decl { + virtual void anchor(); + ObjCProtocolList ReferencedProtocols; ObjCForwardProtocolDecl(DeclContext *DC, SourceLocation L, @@ -1232,6 +1242,8 @@ public: /// don't support this level of dynamism, which is both powerful and dangerous. /// class ObjCCategoryDecl : public ObjCContainerDecl { + virtual void anchor(); + /// Interface belonging to this category ObjCInterfaceDecl *ClassInterface; @@ -1328,6 +1340,8 @@ public: }; class ObjCImplDecl : public ObjCContainerDecl { + virtual void anchor(); + /// Class interface for this class/category implementation ObjCInterfaceDecl *ClassInterface; @@ -1391,6 +1405,8 @@ public: /// /// ObjCCategoryImplDecl class ObjCCategoryImplDecl : public ObjCImplDecl { + virtual void anchor(); + // Category name IdentifierInfo *Id; @@ -1479,6 +1495,7 @@ raw_ostream &operator<<(raw_ostream &OS, /// specified, they need to be *identical* to the interface. /// class ObjCImplementationDecl : public ObjCImplDecl { + virtual void anchor(); /// Implementation Class's super class. ObjCInterfaceDecl *SuperClass; /// Support for ivar initialization. @@ -1609,6 +1626,7 @@ raw_ostream &operator<<(raw_ostream &OS, /// ObjCCompatibleAliasDecl - Represents alias of a class. This alias is /// declared as @compatibility_alias alias class. class ObjCCompatibleAliasDecl : public NamedDecl { + virtual void anchor(); /// Class that this is an alias of. ObjCInterfaceDecl *AliasedClass; @@ -1635,6 +1653,7 @@ public: /// @property (assign, readwrite) int MyProperty; /// class ObjCPropertyDecl : public NamedDecl { + virtual void anchor(); public: enum PropertyAttributeKind { OBJC_PR_noattr = 0x00, diff --git a/include/clang/AST/DeclTemplate.h b/include/clang/AST/DeclTemplate.h index 9149850e8f..f6bc41a640 100644 --- a/include/clang/AST/DeclTemplate.h +++ b/include/clang/AST/DeclTemplate.h @@ -198,6 +198,7 @@ public: /// parameters and a reference to the templated scoped declaration: the /// underlying AST node. class TemplateDecl : public NamedDecl { + virtual void anchor(); protected: // This is probably never used. TemplateDecl(Kind DK, DeclContext *DC, SourceLocation L, @@ -1201,6 +1202,7 @@ public: /// name of a template and the template parameters allowable for substitution. class TemplateTemplateParmDecl : public TemplateDecl, protected TemplateParmPosition { + virtual void anchor(); /// DefaultArgument - The default template argument, if any. TemplateArgumentLoc DefaultArgument; @@ -1561,6 +1563,8 @@ public: class ClassTemplatePartialSpecializationDecl : public ClassTemplateSpecializationDecl { + virtual void anchor(); + /// \brief The list of template parameters TemplateParameterList* TemplateParams; @@ -1941,6 +1945,7 @@ public: /// NOTE: This class is not currently in use. All of the above /// will yield a FriendDecl, not a FriendTemplateDecl. class FriendTemplateDecl : public Decl { + virtual void anchor(); public: typedef llvm::PointerUnion<NamedDecl*,TypeSourceInfo*> FriendUnion; @@ -2107,7 +2112,8 @@ public: /// CXXMethodDecl. Then during an instantiation of class A, it will be /// transformed into an actual function specialization. class ClassScopeFunctionSpecializationDecl : public Decl { -private: + virtual void anchor(); + ClassScopeFunctionSpecializationDecl(DeclContext *DC, SourceLocation Loc, CXXMethodDecl *FD) : Decl(Decl::ClassScopeFunctionSpecialization, DC, Loc), diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h index 4ea1ef4aa9..9d07e051ad 100644 --- a/include/clang/AST/ExprCXX.h +++ b/include/clang/AST/ExprCXX.h @@ -1643,6 +1643,8 @@ public: /// __array_rank(int[10][20]) == 2 /// __array_extent(int, 1) == 20 class ArrayTypeTraitExpr : public Expr { + virtual void anchor(); + /// ATT - The trait. An ArrayTypeTrait enum in MSVC compat unsigned. unsigned ATT : 2; diff --git a/include/clang/AST/Mangle.h b/include/clang/AST/Mangle.h index f58a83b54b..5a42aec0dc 100644 --- a/include/clang/AST/Mangle.h +++ b/include/clang/AST/Mangle.h @@ -64,6 +64,8 @@ private: /// MangleContext - Context for tracking state which persists across multiple /// calls to the C++ name mangler. class MangleContext { + virtual void anchor(); + ASTContext &Context; DiagnosticsEngine &Diags; diff --git a/include/clang/Analysis/Analyses/Dominators.h b/include/clang/Analysis/Analyses/Dominators.h index a9b80593d1..e9a431a991 100644 --- a/include/clang/Analysis/Analyses/Dominators.h +++ b/include/clang/Analysis/Analyses/Dominators.h @@ -31,6 +31,7 @@ typedef llvm::DomTreeNodeBase<CFGBlock> DomTreeNode; /// This class implements the dominators tree functionality given a Clang CFG. /// class DominatorTree : public ManagedAnalysis { + virtual void anchor(); public: llvm::DominatorTreeBase<CFGBlock>* DT; @@ -155,7 +156,7 @@ private: CFG *cfg; }; -void WriteAsOperand(raw_ostream &OS, const CFGBlock *BB, +inline void WriteAsOperand(raw_ostream &OS, const CFGBlock *BB, bool t) { OS << "BB#" << BB->getBlockID(); } diff --git a/include/clang/Analysis/Analyses/LiveVariables.h b/include/clang/Analysis/Analyses/LiveVariables.h index 42e56b26e0..c9f39b46b9 100644 --- a/include/clang/Analysis/Analyses/LiveVariables.h +++ b/include/clang/Analysis/Analyses/LiveVariables.h @@ -52,7 +52,9 @@ public: friend class LiveVariables; }; - struct Observer { + class Observer { + virtual void anchor(); + public: virtual ~Observer() {} /// A callback invoked right before invoking the diff --git a/include/clang/Analysis/Analyses/PostOrderCFGView.h b/include/clang/Analysis/Analyses/PostOrderCFGView.h index 57db398054..4e3244e7b7 100644 --- a/include/clang/Analysis/Analyses/PostOrderCFGView.h +++ b/include/clang/Analysis/Analyses/PostOrderCFGView.h @@ -27,6 +27,7 @@ namespace clang { class PostOrderCFGView : public ManagedAnalysis { + virtual void anchor(); public: /// \brief Implements a set of CFGBlocks using a BitVector. /// diff --git a/include/clang/Analysis/Analyses/ReachableCode.h b/include/clang/Analysis/Analyses/ReachableCode.h index a5dba6eefe..30c5b2d7a5 100644 --- a/include/clang/Analysis/Analyses/ReachableCode.h +++ b/include/clang/Analysis/Analyses/ReachableCode.h @@ -37,6 +37,7 @@ namespace clang { namespace reachable_code { class Callback { + virtual void anchor(); public: virtual ~Callback() {} virtual void HandleUnreachable(SourceLocation L, SourceRange R1, diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index e6f30b17dc..0a785fd0a7 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -1118,6 +1118,7 @@ public: /// IgnoringDiagConsumer - This is a diagnostic client that just ignores all /// diags. class IgnoringDiagConsumer : public DiagnosticConsumer { + virtual void anchor(); void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) { // Just ignore it. diff --git a/include/clang/Basic/FileSystemStatCache.h b/include/clang/Basic/FileSystemStatCache.h index 77828b3ecb..f27312fade 100644 --- a/include/clang/Basic/FileSystemStatCache.h +++ b/include/clang/Basic/FileSystemStatCache.h @@ -25,6 +25,7 @@ namespace clang { /// system calls, which is used by precompiled and pretokenized headers to /// improve performance. class FileSystemStatCache { + virtual void anchor(); protected: llvm::OwningPtr<FileSystemStatCache> NextStatCache; diff --git a/include/clang/CodeGen/CodeGenAction.h b/include/clang/CodeGen/CodeGenAction.h index 9697bc62af..5c2e2bbe8d 100644 --- a/include/clang/CodeGen/CodeGenAction.h +++ b/include/clang/CodeGen/CodeGenAction.h @@ -63,31 +63,37 @@ public: }; class EmitAssemblyAction : public CodeGenAction { + virtual void anchor(); public: EmitAssemblyAction(llvm::LLVMContext *_VMContext = 0); }; class EmitBCAction : public CodeGenAction { + virtual void anchor(); public: EmitBCAction(llvm::LLVMContext *_VMContext = 0); }; class EmitLLVMAction : public CodeGenAction { + virtual void anchor(); public: EmitLLVMAction(llvm::LLVMContext *_VMContext = 0); }; class EmitLLVMOnlyAction : public CodeGenAction { + virtual void anchor(); public: EmitLLVMOnlyAction(llvm::LLVMContext *_VMContext = 0); }; class EmitCodeGenOnlyAction : public CodeGenAction { + virtual void anchor(); public: EmitCodeGenOnlyAction(llvm::LLVMContext *_VMContext = 0); }; class EmitObjAction : public CodeGenAction { + virtual void anchor(); public: EmitObjAction(llvm::LLVMContext *_VMContext = 0); }; diff --git a/include/clang/CodeGen/ModuleBuilder.h b/include/clang/CodeGen/ModuleBuilder.h index 38aba89002..ba9d1f9305 100644 --- a/include/clang/CodeGen/ModuleBuilder.h +++ b/include/clang/CodeGen/ModuleBuilder.h @@ -28,6 +28,7 @@ namespace clang { class CodeGenOptions; class CodeGenerator : public ASTConsumer { + virtual void anchor(); public: virtual llvm::Module* GetModule() = 0; virtual llvm::Module* ReleaseModule() = 0; diff --git a/include/clang/Driver/Action.h b/include/clang/Driver/Action.h index a33c33bf73..41ce4d92c4 100644 --- a/include/clang/Driver/Action.h +++ b/include/clang/Driver/Action.h @@ -94,6 +94,7 @@ public: }; class InputAction : public Action { + virtual void anchor(); const Arg &Input; public: InputAction(const Arg &_Input, types::ID _Type); @@ -107,6 +108,7 @@ public: }; class BindArchAction : public Action { + virtual void anchor(); /// The architecture to bind, or 0 if the default architecture /// should be bound. const char *ArchName; @@ -123,6 +125,7 @@ public: }; class JobAction : public Action { + virtual void anchor(); protected: JobAction(ActionClass Kind, Action *Input, types::ID Type); JobAction(ActionClass Kind, const ActionList &Inputs, types::ID Type); @@ -136,6 +139,7 @@ public: }; class PreprocessJobAction : public JobAction { + virtual void anchor(); public: PreprocessJobAction(Action *Input, types::ID OutputType); @@ -146,6 +150,7 @@ public: }; class PrecompileJobAction : public JobAction { + virtual void anchor(); public: PrecompileJobAction(Action *Input, types::ID OutputType); @@ -156,6 +161,7 @@ public: }; class AnalyzeJobAction : public JobAction { + virtual void anchor(); public: AnalyzeJobAction(Action *Input, types::ID OutputType); @@ -166,6 +172,7 @@ public: }; class CompileJobAction : public JobAction { + virtual void anchor(); public: CompileJobAction(Action *Input, types::ID OutputType); @@ -176,6 +183,7 @@ public: }; class AssembleJobAction : public JobAction { + virtual void anchor(); public: AssembleJobAction(Action *Input, types::ID OutputType); @@ -186,6 +194,7 @@ public: }; class LinkJobAction : public JobAction { + virtual void anchor(); public: LinkJobAction(ActionList &Inputs, types::ID Type); @@ -196,6 +205,7 @@ public: }; class LipoJobAction : public JobAction { + virtual void anchor(); public: LipoJobAction(ActionList &Inputs, types::ID Type); @@ -206,6 +216,7 @@ public: }; class DsymutilJobAction : public JobAction { + virtual void anchor(); public: DsymutilJobAction(ActionList &Inputs, types::ID Type); @@ -216,6 +227,7 @@ public: }; class VerifyJobAction : public JobAction { + virtual void anchor(); public: VerifyJobAction(ActionList &Inputs, types::ID Type); static bool classof(const Action *A) { diff --git a/include/clang/Driver/Job.h b/include/clang/Driver/Job.h index 367955f59f..c94886dc26 100644 --- a/include/clang/Driver/Job.h +++ b/include/clang/Driver/Job.h @@ -46,6 +46,8 @@ public: /// Command - An executable path/name and argument vector to /// execute. class Command : public Job { + virtual void anchor(); + /// Source - The action which caused the creation of this job. const Action &Source; diff --git a/include/clang/Frontend/ChainedDiagnosticConsumer.h b/include/clang/Frontend/ChainedDiagnosticConsumer.h index b47fac5217..6ffcec51cf 100644 --- a/include/clang/Frontend/ChainedDiagnosticConsumer.h +++ b/include/clang/Frontend/ChainedDiagnosticConsumer.h @@ -21,6 +21,7 @@ class LangOptions; /// should be the "primary" client, and will be used for computing whether the /// diagnostics should be included in counts. class ChainedDiagnosticConsumer : public DiagnosticConsumer { + virtual void anchor(); |