summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-rc/ResourceScriptParser.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-08-15 15:54:37 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-08-15 15:54:37 +0000
commit0eaee545eef49ff9498234d3a51a5cbde59bf976 (patch)
treefd7691e102022fb97622c5485fa8c4f506fc124e /llvm/tools/llvm-rc/ResourceScriptParser.cpp
parent1c34d10776828c0756ff4f0b2b9aa8bda2be348a (diff)
downloadbcm5719-llvm-0eaee545eef49ff9498234d3a51a5cbde59bf976.tar.gz
bcm5719-llvm-0eaee545eef49ff9498234d3a51a5cbde59bf976.zip
[llvm] Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
Diffstat (limited to 'llvm/tools/llvm-rc/ResourceScriptParser.cpp')
-rw-r--r--llvm/tools/llvm-rc/ResourceScriptParser.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/llvm/tools/llvm-rc/ResourceScriptParser.cpp b/llvm/tools/llvm-rc/ResourceScriptParser.cpp
index 56534e73087..36b305645fb 100644
--- a/llvm/tools/llvm-rc/ResourceScriptParser.cpp
+++ b/llvm/tools/llvm-rc/ResourceScriptParser.cpp
@@ -428,7 +428,7 @@ RCParser::ParseType RCParser::parseAcceleratorsResource() {
ASSIGN_OR_RETURN(OptStatements, parseOptionalStatements());
RETURN_IF_ERROR(consumeType(Kind::BlockBegin));
- auto Accels = llvm::make_unique<AcceleratorsResource>(
+ auto Accels = std::make_unique<AcceleratorsResource>(
std::move(*OptStatements), MemoryFlags);
while (!consumeOptionalType(Kind::BlockEnd)) {
@@ -449,7 +449,7 @@ RCParser::ParseType RCParser::parseCursorResource() {
uint16_t MemoryFlags =
parseMemoryFlags(CursorResource::getDefaultMemoryFlags());
ASSIGN_OR_RETURN(Arg, readFilename());
- return llvm::make_unique<CursorResource>(*Arg, MemoryFlags);
+ return std::make_unique<CursorResource>(*Arg, MemoryFlags);
}
RCParser::ParseType RCParser::parseDialogResource(bool IsExtended) {
@@ -475,7 +475,7 @@ RCParser::ParseType RCParser::parseDialogResource(bool IsExtended) {
"parseOptionalStatements, when successful, halts on BlockBegin.");
consume();
- auto Dialog = llvm::make_unique<DialogResource>(
+ auto Dialog = std::make_unique<DialogResource>(
(*LocResult)[0], (*LocResult)[1], (*LocResult)[2], (*LocResult)[3],
HelpID, std::move(*OptStatements), IsExtended, MemoryFlags);
@@ -497,7 +497,7 @@ RCParser::ParseType RCParser::parseUserDefinedResource(IntOrString Type) {
switch (look().kind()) {
case Kind::String:
case Kind::Identifier:
- return llvm::make_unique<UserDefinedResource>(Type, read().value(),
+ return std::make_unique<UserDefinedResource>(Type, read().value(),
MemoryFlags);
default:
break;
@@ -517,7 +517,7 @@ RCParser::ParseType RCParser::parseUserDefinedResource(IntOrString Type) {
Data.push_back(*Item);
}
- return llvm::make_unique<UserDefinedResource>(Type, std::move(Data),
+ return std::make_unique<UserDefinedResource>(Type, std::move(Data),
MemoryFlags);
}
@@ -526,7 +526,7 @@ RCParser::ParseType RCParser::parseVersionInfoResource() {
parseMemoryFlags(VersionInfoResource::getDefaultMemoryFlags());
ASSIGN_OR_RETURN(FixedResult, parseVersionInfoFixed());
ASSIGN_OR_RETURN(BlockResult, parseVersionInfoBlockContents(StringRef()));
- return llvm::make_unique<VersionInfoResource>(
+ return std::make_unique<VersionInfoResource>(
std::move(**BlockResult), std::move(*FixedResult), MemoryFlags);
}
@@ -597,21 +597,21 @@ RCParser::ParseType RCParser::parseBitmapResource() {
uint16_t MemoryFlags =
parseMemoryFlags(BitmapResource::getDefaultMemoryFlags());
ASSIGN_OR_RETURN(Arg, readFilename());
- return llvm::make_unique<BitmapResource>(*Arg, MemoryFlags);
+ return std::make_unique<BitmapResource>(*Arg, MemoryFlags);
}
RCParser::ParseType RCParser::parseIconResource() {
uint16_t MemoryFlags =
parseMemoryFlags(IconResource::getDefaultMemoryFlags());
ASSIGN_OR_RETURN(Arg, readFilename());
- return llvm::make_unique<IconResource>(*Arg, MemoryFlags);
+ return std::make_unique<IconResource>(*Arg, MemoryFlags);
}
RCParser::ParseType RCParser::parseHTMLResource() {
uint16_t MemoryFlags =
parseMemoryFlags(HTMLResource::getDefaultMemoryFlags());
ASSIGN_OR_RETURN(Arg, readFilename());
- return llvm::make_unique<HTMLResource>(*Arg, MemoryFlags);
+ return std::make_unique<HTMLResource>(*Arg, MemoryFlags);
}
RCParser::ParseType RCParser::parseMenuResource() {
@@ -619,7 +619,7 @@ RCParser::ParseType RCParser::parseMenuResource() {
parseMemoryFlags(MenuResource::getDefaultMemoryFlags());
ASSIGN_OR_RETURN(OptStatements, parseOptionalStatements());
ASSIGN_OR_RETURN(Items, parseMenuItemsList());
- return llvm::make_unique<MenuResource>(std::move(*OptStatements),
+ return std::make_unique<MenuResource>(std::move(*OptStatements),
std::move(*Items), MemoryFlags);
}
@@ -644,7 +644,7 @@ Expected<MenuDefinitionList> RCParser::parseMenuItemsList() {
// Now, expecting SEPARATOR.
ASSIGN_OR_RETURN(SeparatorResult, readIdentifier());
if (SeparatorResult->equals_lower("SEPARATOR")) {
- List.addDefinition(llvm::make_unique<MenuSeparator>());
+ List.addDefinition(std::make_unique<MenuSeparator>());
continue;
}
@@ -669,14 +669,14 @@ Expected<MenuDefinitionList> RCParser::parseMenuItemsList() {
if (IsPopup) {
// If POPUP, read submenu items recursively.
ASSIGN_OR_RETURN(SubMenuResult, parseMenuItemsList());
- List.addDefinition(llvm::make_unique<PopupItem>(
+ List.addDefinition(std::make_unique<PopupItem>(
*CaptionResult, *FlagsResult, std::move(*SubMenuResult)));
continue;
}
assert(IsMenuItem);
List.addDefinition(
- llvm::make_unique<MenuItem>(*CaptionResult, MenuResult, *FlagsResult));
+ std::make_unique<MenuItem>(*CaptionResult, MenuResult, *FlagsResult));
}
return std::move(List);
@@ -688,7 +688,7 @@ RCParser::ParseType RCParser::parseStringTableResource() {
ASSIGN_OR_RETURN(OptStatements, parseOptionalStatements());
RETURN_IF_ERROR(consumeType(Kind::BlockBegin));
- auto Table = llvm::make_unique<StringTableResource>(std::move(*OptStatements),
+ auto Table = std::make_unique<StringTableResource>(std::move(*OptStatements),
MemoryFlags);
// Read strings until we reach the end of the block.
@@ -709,7 +709,7 @@ Expected<std::unique_ptr<VersionInfoBlock>>
RCParser::parseVersionInfoBlockContents(StringRef BlockName) {
RETURN_IF_ERROR(consumeType(Kind::BlockBegin));
- auto Contents = llvm::make_unique<VersionInfoBlock>(BlockName);
+ auto Contents = std::make_unique<VersionInfoBlock>(BlockName);
while (!isNextTokenKind(Kind::BlockEnd)) {
ASSIGN_OR_RETURN(Stmt, parseVersionInfoStmt());
@@ -746,7 +746,7 @@ Expected<std::unique_ptr<VersionInfoStmt>> RCParser::parseVersionInfoStmt() {
Values.push_back(*ValueResult);
PrecedingCommas.push_back(HadComma);
}
- return llvm::make_unique<VersionInfoValue>(*KeyResult, std::move(Values),
+ return std::make_unique<VersionInfoValue>(*KeyResult, std::move(Values),
std::move(PrecedingCommas));
}
@@ -781,27 +781,27 @@ RCParser::parseVersionInfoFixed() {
RCParser::ParseOptionType RCParser::parseLanguageStmt() {
ASSIGN_OR_RETURN(Args, readIntsWithCommas(/* min = */ 2, /* max = */ 2));
- return llvm::make_unique<LanguageResource>((*Args)[0], (*Args)[1]);
+ return std::make_unique<LanguageResource>((*Args)[0], (*Args)[1]);
}
RCParser::ParseOptionType RCParser::parseCharacteristicsStmt() {
ASSIGN_OR_RETURN(Arg, readInt());
- return llvm::make_unique<CharacteristicsStmt>(*Arg);
+ return std::make_unique<CharacteristicsStmt>(*Arg);
}
RCParser::ParseOptionType RCParser::parseVersionStmt() {
ASSIGN_OR_RETURN(Arg, readInt());
- return llvm::make_unique<VersionStmt>(*Arg);
+ return std::make_unique<VersionStmt>(*Arg);
}
RCParser::ParseOptionType RCParser::parseCaptionStmt() {
ASSIGN_OR_RETURN(Arg, readString());
- return llvm::make_unique<CaptionStmt>(*Arg);
+ return std::make_unique<CaptionStmt>(*Arg);
}
RCParser::ParseOptionType RCParser::parseClassStmt() {
ASSIGN_OR_RETURN(Arg, readIntOrString());
- return llvm::make_unique<ClassStmt>(*Arg);
+ return std::make_unique<ClassStmt>(*Arg);
}
RCParser::ParseOptionType RCParser::parseFontStmt(OptStmtType DialogType) {
@@ -826,18 +826,18 @@ RCParser::ParseOptionType RCParser::parseFontStmt(OptStmtType DialogType) {
FontCharset = (*Args)[2];
}
}
- return llvm::make_unique<FontStmt>(*SizeResult, *NameResult, FontWeight,
+ return std::make_unique<FontStmt>(*SizeResult, *NameResult, FontWeight,
FontItalic, FontCharset);
}
RCParser::ParseOptionType RCParser::parseStyleStmt() {
ASSIGN_OR_RETURN(Arg, readInt());
- return llvm::make_unique<StyleStmt>(*Arg);
+ return std::make_unique<StyleStmt>(*Arg);
}
RCParser::ParseOptionType RCParser::parseExStyleStmt() {
ASSIGN_OR_RETURN(Arg, readInt());
- return llvm::make_unique<ExStyleStmt>(*Arg);
+ return std::make_unique<ExStyleStmt>(*Arg);
}
Error RCParser::getExpectedError(const Twine &Message, bool IsAlreadyRead) {
OpenPOWER on IntegriCloud