diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/YAMLTraits.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/llvm/Support/YAMLTraits.h b/include/llvm/Support/YAMLTraits.h index 6b6a8b7..d6eeaac 100644 --- a/include/llvm/Support/YAMLTraits.h +++ b/include/llvm/Support/YAMLTraits.h @@ -18,6 +18,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/ADT/Twine.h" +#include "llvm/Support/Casting.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/YAMLParser.h" @@ -317,7 +318,7 @@ public: IO(void *Ctxt=NULL); virtual ~IO(); - virtual bool outputting() = 0; + virtual bool outputting() const = 0; virtual unsigned beginSequence() = 0; virtual bool preflightElement(unsigned, void *&) = 0; @@ -694,8 +695,10 @@ public: // To set alternate error reporting. void setDiagHandler(llvm::SourceMgr::DiagHandlerTy Handler, void *Ctxt = 0); + static bool classof(const IO *io) { return !io->outputting(); } + private: - virtual bool outputting(); + virtual bool outputting() const; virtual bool mapTag(StringRef, bool); virtual void beginMapping(); virtual void endMapping(); @@ -819,7 +822,9 @@ public: Output(llvm::raw_ostream &, void *Ctxt=NULL); virtual ~Output(); - virtual bool outputting(); + static bool classof(const IO *io) { return io->outputting(); } + + virtual bool outputting() const; virtual bool mapTag(StringRef, bool); virtual void beginMapping(); virtual void endMapping(); |