From: Chandler Carruth Date: Thu, 9 Jan 2014 02:56:16 +0000 (+0000) Subject: Update Clang's CFGBlock interface to conform to the strange part of X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87639c32ffaa9366ef5eef1006af34fc2cbd504b;p=clang Update Clang's CFGBlock interface to conform to the strange part of LLVM's Value interface which is used in LLVM's DominatorTree analysis and which changed in LLVM r198836. The DominatorTree analysis is actually a generic graph analysis and should be moved to LLVM's support library to clarify that Clang and others are using it with arbitrary graphs. Further, it seems likely that it should be using something other than printAsOperand, but this is a simpler build fix. I'll clean this up later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198840 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/Analyses/Dominators.h b/include/clang/Analysis/Analyses/Dominators.h index 2a806c8bef..73c38242a2 100644 --- a/include/clang/Analysis/Analyses/Dominators.h +++ b/include/clang/Analysis/Analyses/Dominators.h @@ -155,11 +155,6 @@ private: CFG *cfg; }; -inline void WriteAsOperand(raw_ostream &OS, const CFGBlock *BB, - bool t) { - OS << "BB#" << BB->getBlockID(); -} - } // end namespace clang //===------------------------------------- diff --git a/include/clang/Analysis/CFG.h b/include/clang/Analysis/CFG.h index 14b7ab8426..f715055f60 100644 --- a/include/clang/Analysis/CFG.h +++ b/include/clang/Analysis/CFG.h @@ -25,6 +25,7 @@ #include "llvm/ADT/PointerIntPair.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/Casting.h" +#include "llvm/Support/raw_ostream.h" #include #include #include @@ -560,6 +561,9 @@ public: void print(raw_ostream &OS, const CFG* cfg, const LangOptions &LO, bool ShowColors) const; void printTerminator(raw_ostream &OS, const LangOptions &LO) const; + void printAsOperand(raw_ostream &OS, bool /*PrintType*/) { + OS << "BB#" << getBlockID(); + } void addSuccessor(CFGBlock *Block, BumpVectorContext &C) { if (Block)