summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis/ScopGraphPrinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/Analysis/ScopGraphPrinter.cpp')
-rw-r--r--polly/lib/Analysis/ScopGraphPrinter.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/polly/lib/Analysis/ScopGraphPrinter.cpp b/polly/lib/Analysis/ScopGraphPrinter.cpp
index dab3f677531..02308dfa43a 100644
--- a/polly/lib/Analysis/ScopGraphPrinter.cpp
+++ b/polly/lib/Analysis/ScopGraphPrinter.cpp
@@ -101,6 +101,21 @@ struct DOTGraphTraits<ScopDetection*> : public DOTGraphTraits<RegionNode*> {
return DOTGraphTraits<RegionNode*>
::getNodeLabel(Node, SD->getRI()->getTopLevelRegion());
}
+
+ static std::string escapeString(std::string String) {
+ std::string Escaped;
+
+ for (std::string::iterator SI = String.begin(), SE = String.end();
+ SI != SE; ++SI) {
+
+ if (*SI == '"')
+ Escaped += '\\';
+
+ Escaped += *SI;
+ }
+ return Escaped;
+ }
+
// Print the cluster of the subregions. This groups the single basic blocks
// and adds a different background color for each group.
static void printRegionCluster(const ScopDetection *SD, const Region *R,
@@ -108,6 +123,7 @@ struct DOTGraphTraits<ScopDetection*> : public DOTGraphTraits<RegionNode*> {
O.indent(2 * depth) << "subgraph cluster_" << static_cast<const void*>(R)
<< " {\n";
std::string ErrorMessage = SD->regionIsInvalidBecause(R);
+ ErrorMessage = escapeString(ErrorMessage);
O.indent(2 * (depth + 1)) << "label = \"" << ErrorMessage << "\";\n";
if (SD->isMaxRegionInScop(*R)) {
OpenPOWER on IntegriCloud