diff options
author | Nick Kledzik <kledzik@apple.com> | 2013-11-14 02:38:07 +0000 |
---|---|---|
committer | Nick Kledzik <kledzik@apple.com> | 2013-11-14 02:38:07 +0000 |
commit | 04fca67d6f4b314ba618714698b58dbfba3af005 (patch) | |
tree | 96b4e3f0ffe4a83918bb125ad8297fdc48743eae /include/llvm | |
parent | e2058ff5bd4fa0397b57f6bdd84e5a5aa2343433 (diff) | |
download | llvm-04fca67d6f4b314ba618714698b58dbfba3af005.tar.gz llvm-04fca67d6f4b314ba618714698b58dbfba3af005.tar.bz2 llvm-04fca67d6f4b314ba618714698b58dbfba3af005.tar.xz |
Add dyn_cast<> support to YAML I/O's IO class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194655 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-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 6b6a8b7698..d6eeaace7b 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(); |