diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2014-06-06 12:40:24 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2014-06-06 12:40:24 +0000 |
| commit | b06b15aa28d0b2efce5a2eb58ae0a73fa1ffe94d (patch) | |
| tree | e0d0c2cd0c6a64f5cb212503bf62f3062c9e0ff9 /clang/lib/AST/StmtPrinter.cpp | |
| parent | 909b7490a338fac18c59317c48d970c50bcb6552 (diff) | |
| download | bcm5719-llvm-b06b15aa28d0b2efce5a2eb58ae0a73fa1ffe94d.tar.gz bcm5719-llvm-b06b15aa28d0b2efce5a2eb58ae0a73fa1ffe94d.zip | |
Adding a new #pragma for the vectorize and interleave optimization hints.
Patch thanks to Tyler Nowicki!
llvm-svn: 210330
Diffstat (limited to 'clang/lib/AST/StmtPrinter.cpp')
| -rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index 297de5e09ab..1daab32e5b7 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -168,8 +168,22 @@ void StmtPrinter::VisitLabelStmt(LabelStmt *Node) { } void StmtPrinter::VisitAttributedStmt(AttributedStmt *Node) { - for (const auto *Attr : Node->getAttrs()) - Attr->printPretty(OS, Policy); + std::string raw_attr_os; + llvm::raw_string_ostream AttrOS(raw_attr_os); + for (const auto *Attr : Node->getAttrs()) { + // FIXME: This hack will be removed when printPretty + // has been modified to print pretty pragmas + if (const LoopHintAttr *LHA = dyn_cast<LoopHintAttr>(Attr)) { + LHA->print(OS, Policy); + } else + Attr->printPretty(AttrOS, Policy); + } + + // Print attributes after pragmas. + StringRef AttrStr = AttrOS.str(); + if (!AttrStr.empty()) + OS << AttrStr; + PrintStmt(Node->getSubStmt(), 0); } |

