r281408 - Fix a FIXME about MSVC 2013 in the diagnostic doc generation code
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 13 15:22:56 PDT 2016
Author: rnk
Date: Tue Sep 13 17:22:56 2016
New Revision: 281408
URL: http://llvm.org/viewvc/llvm-project?rev=281408&view=rev
Log:
Fix a FIXME about MSVC 2013 in the diagnostic doc generation code
Ultimately it boiled down to adding a move constructor.
Modified:
cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp
Modified: cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp?rev=281408&r1=281407&r2=281408&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp Tue Sep 13 17:22:56 2016
@@ -928,13 +928,14 @@ struct DiagText {
void print(std::vector<std::string> &RST) override;
};
struct SelectPiece : Piece {
+ SelectPiece() {}
+ SelectPiece(SelectPiece &&O) LLVM_NOEXCEPT : Options(std::move(O.Options)) {
+ }
std::vector<DiagText> Options;
void print(std::vector<std::string> &RST) override;
};
- // FIXME: This should be a unique_ptr, but I can't figure out how to get MSVC
- // to not issue errors on that.
- std::vector<std::shared_ptr<Piece>> Pieces;
+ std::vector<std::unique_ptr<Piece>> Pieces;
DiagText();
DiagText(DiagText &&O) LLVM_NOEXCEPT : Pieces(std::move(O.Pieces)) {}
@@ -943,7 +944,7 @@ struct DiagText {
DiagText(StringRef Kind, StringRef Text);
template<typename P> void add(P Piece) {
- Pieces.push_back(std::make_shared<P>(std::move(Piece)));
+ Pieces.push_back(llvm::make_unique<P>(std::move(Piece)));
}
void print(std::vector<std::string> &RST);
};
@@ -1040,7 +1041,8 @@ DiagText::DiagText(StringRef Kind, Strin
Prefix.Role = Kind;
Prefix.Text = Kind;
Prefix.Text += ": ";
- Pieces.insert(Pieces.begin(), std::make_shared<TextPiece>(std::move(Prefix)));
+ Pieces.insert(Pieces.begin(),
+ llvm::make_unique<TextPiece>(std::move(Prefix)));
}
void escapeRST(StringRef Str, std::string &Out) {
More information about the cfe-commits
mailing list