Mercurial > hg > CbC > CbC_llvm
diff include/llvm/Analysis/CFGPrinter.h @ 77:54457678186b LLVM3.6
LLVM 3.6
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Sep 2014 22:06:00 +0900 |
parents | 95c75e76d11b |
children | 1172e4bd9c6f |
line wrap: on
line diff
--- a/include/llvm/Analysis/CFGPrinter.h Thu Dec 12 15:22:36 2013 +0900 +++ b/include/llvm/Analysis/CFGPrinter.h Mon Sep 08 22:06:00 2014 +0900 @@ -15,11 +15,10 @@ #ifndef LLVM_ANALYSIS_CFGPRINTER_H #define LLVM_ANALYSIS_CFGPRINTER_H -#include "llvm/Assembly/Writer.h" +#include "llvm/IR/CFG.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Function.h" #include "llvm/IR/Instructions.h" -#include "llvm/Support/CFG.h" #include "llvm/Support/GraphWriter.h" namespace llvm { @@ -40,7 +39,7 @@ std::string Str; raw_string_ostream OS(Str); - WriteAsOperand(OS, Node, false); + Node->printAsOperand(OS, false); return OS.str(); } @@ -51,7 +50,7 @@ raw_string_ostream OS(Str); if (Node->getName().empty()) { - WriteAsOperand(OS, Node, false); + Node->printAsOperand(OS, false); OS << ":"; } @@ -73,13 +72,13 @@ OutStr.erase(OutStr.begin()+i, OutStr.begin()+Idx); --i; } else if (ColNum == MaxColumns) { // Wrap lines. - if (LastSpace) { - OutStr.insert(LastSpace, "\\l..."); - ColNum = i - LastSpace; - LastSpace = 0; - i += 3; // The loop will advance 'i' again. - } - // Else keep trying to find a space. + // Wrap very long names even though we can't find a space. + if (!LastSpace) + LastSpace = i; + OutStr.insert(LastSpace, "\\l..."); + ColNum = i - LastSpace; + LastSpace = 0; + i += 3; // The loop will advance 'i' again. } else ++ColNum;