From dd3ec833ccfe6171f4abfd0c48a8e73ea437810e Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 30 Dec 2015 03:33:22 +0000 Subject: [PATCH] [ptr-traits] Move a class definition up to the top of this header so it can be referenced as part of a PointerIntPair. This is part of a series of patches to allow LLVM to check for complete pointee types when computing its pointer traits. This is absolutely necessary to get correct (or reproducible) results for things like how many low bits are guaranteed to be zero. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256613 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Analysis/ProgramPoint.h | 49 +++++++++++++-------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/include/clang/Analysis/ProgramPoint.h b/include/clang/Analysis/ProgramPoint.h index f87271550c..6d816fd733 100644 --- a/include/clang/Analysis/ProgramPoint.h +++ b/include/clang/Analysis/ProgramPoint.h @@ -33,8 +33,31 @@ namespace clang { class AnalysisDeclContext; class FunctionDecl; class LocationContext; -class ProgramPointTag; +/// ProgramPoints can be "tagged" as representing points specific to a given +/// analysis entity. Tags are abstract annotations, with an associated +/// description and potentially other information. +class ProgramPointTag { +public: + ProgramPointTag(void *tagKind = nullptr) : TagKind(tagKind) {} + virtual ~ProgramPointTag(); + virtual StringRef getTagDescription() const = 0; + +protected: + /// Used to implement 'isKind' in subclasses. + const void *getTagKind() { return TagKind; } + +private: + const void *TagKind; +}; + +class SimpleProgramPointTag : public ProgramPointTag { + std::string Desc; +public: + SimpleProgramPointTag(StringRef MsgProvider, StringRef Msg); + StringRef getTagDescription() const override; +}; + class ProgramPoint { public: enum Kind { BlockEdgeKind, @@ -643,30 +666,6 @@ private: } }; -/// ProgramPoints can be "tagged" as representing points specific to a given -/// analysis entity. Tags are abstract annotations, with an associated -/// description and potentially other information. -class ProgramPointTag { -public: - ProgramPointTag(void *tagKind = nullptr) : TagKind(tagKind) {} - virtual ~ProgramPointTag(); - virtual StringRef getTagDescription() const = 0; - -protected: - /// Used to implement 'isKind' in subclasses. - const void *getTagKind() { return TagKind; } - -private: - const void *TagKind; -}; - -class SimpleProgramPointTag : public ProgramPointTag { - std::string Desc; -public: - SimpleProgramPointTag(StringRef MsgProvider, StringRef Msg); - StringRef getTagDescription() const override; -}; - } // end namespace clang -- 2.50.1