r198840 - Update Clang's CFGBlock interface to conform to the strange part of

Chandler Carruth chandlerc at gmail.com
Wed Jan 8 18:56:16 PST 2014

Author: chandlerc
Date: Wed Jan  8 20:56:16 2014
New Revision: 198840

URL: http://llvm.org/viewvc/llvm-project?rev=198840&view=rev
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.


Modified: cfe/trunk/include/clang/Analysis/Analyses/Dominators.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Analyses/Dominators.h?rev=198840&r1=198839&r2=198840&view=diff
--- cfe/trunk/include/clang/Analysis/Analyses/Dominators.h (original)
+++ cfe/trunk/include/clang/Analysis/Analyses/Dominators.h Wed Jan  8 20:56:16 2014
@@ -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

Modified: cfe/trunk/include/clang/Analysis/CFG.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/CFG.h?rev=198840&r1=198839&r2=198840&view=diff
--- cfe/trunk/include/clang/Analysis/CFG.h (original)
+++ cfe/trunk/include/clang/Analysis/CFG.h Wed Jan  8 20:56:16 2014
@@ -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 <bitset>
 #include <cassert>
 #include <iterator>
@@ -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)

More information about the cfe-commits mailing list