Skip to content

Commit b1fa644

Browse files
committed
fixups
1 parent 1033569 commit b1fa644

File tree

4 files changed

+39
-38
lines changed

4 files changed

+39
-38
lines changed

lldb/source/Plugins/ExpressionParser/Rust/RustAST.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ class RustPathExpression : public RustExpression {
613613
std::vector<std::string> names;
614614
names.push_back(std::move(item));
615615

616-
m_path = llvm::make_unique<RustPath>(false, true, 0, std::move(names),
616+
m_path = std::make_unique<RustPath>(false, true, 0, std::move(names),
617617
std::vector<RustTypeExpressionUP>());
618618
}
619619

@@ -694,7 +694,7 @@ class RustPathTypeExpression : public RustTypeExpression {
694694
std::vector<std::string> names;
695695
names.push_back(std::move(item));
696696

697-
m_path = llvm::make_unique<RustPath>(false, true, 0, std::move(names),
697+
m_path = std::make_unique<RustPath>(false, true, 0, std::move(names),
698698
std::vector<RustTypeExpressionUP>());
699699
}
700700

lldb/source/Plugins/ExpressionParser/Rust/RustLex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void lldb_private::rust::PrintTokenKind(Stream &stream, int kind) {
4040
case INVALID:
4141
case THATSALLFOLKS:
4242
// May want to clean this up someday.
43-
stream << "[TOKEN=" << kind << "]";
43+
//stream << "[TOKEN=" << kind << "]";
4444
break;
4545

4646
case DOTDOT:

lldb/source/Plugins/ExpressionParser/Rust/RustLex.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "lldb/lldb-private.h"
1717

1818
#include "llvm/ADT/Optional.h"
19+
#include "llvm/ADT/StringMap.h"
1920
#include "llvm/ADT/StringRef.h"
2021
#include "lldb/Utility/Stream.h"
2122

lldb/source/Plugins/ExpressionParser/Rust/RustParse.cpp

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ RustExpressionUP Parser::Unary(Status &error) {
13281328
if (!result) {
13291329
return result;
13301330
}
1331-
return llvm::make_unique<RustUnaryExpression<C, OP>>(std::move(result));
1331+
return std::make_unique<RustUnaryExpression<C, OP>>(std::move(result));
13321332
}
13331333

13341334
bool Parser::ExprList(std::vector<RustExpressionUP> *exprs, Status &error) {
@@ -1357,7 +1357,7 @@ RustExpressionUP Parser::Parens(Status &error) {
13571357
if (CurrentToken().kind == ')') {
13581358
// Unit tuple.
13591359
Advance();
1360-
return llvm::make_unique<RustTupleExpression>(std::vector<RustExpressionUP>());
1360+
return std::make_unique<RustTupleExpression>(std::vector<RustExpressionUP>());
13611361
}
13621362

13631363
RustExpressionUP expr = Expr(error);
@@ -1390,7 +1390,7 @@ RustExpressionUP Parser::Parens(Status &error) {
13901390
}
13911391
Advance();
13921392

1393-
return llvm::make_unique<RustTupleExpression>(std::move(exprs));
1393+
return std::make_unique<RustTupleExpression>(std::move(exprs));
13941394
}
13951395

13961396
RustExpressionUP Parser::Array(Status &error) {
@@ -1416,14 +1416,14 @@ RustExpressionUP Parser::Array(Status &error) {
14161416
return length;
14171417
}
14181418

1419-
result = llvm::make_unique<RustArrayWithLength>(std::move(expr), std::move(length));
1419+
result = std::make_unique<RustArrayWithLength>(std::move(expr), std::move(length));
14201420
} else if (CurrentToken().kind == ',') {
14211421
Advance();
14221422
std::vector<RustExpressionUP> exprs;
14231423
exprs.push_back(std::move(expr));
14241424

14251425
if (ExprList(&exprs, error)) {
1426-
result = llvm::make_unique<RustArrayLiteral>(std::move(exprs));
1426+
result = std::make_unique<RustArrayLiteral>(std::move(exprs));
14271427
}
14281428
} else {
14291429
error.SetErrorString("expected ',' or ';'");
@@ -1446,11 +1446,11 @@ RustExpressionUP Parser::Field(RustExpressionUP &&lhs, Status &error) {
14461446

14471447
RustExpressionUP result;
14481448
if (CurrentToken().kind == IDENTIFIER) {
1449-
result = llvm::make_unique<RustFieldExpression>(std::move(lhs),
1449+
result = std::make_unique<RustFieldExpression>(std::move(lhs),
14501450
CurrentToken().str);
14511451
Advance();
14521452
} else if (CurrentToken().kind == INTEGER) {
1453-
result = llvm::make_unique<RustTupleFieldExpression>(std::move(lhs),
1453+
result = std::make_unique<RustTupleFieldExpression>(std::move(lhs),
14541454
CurrentToken().uinteger.getValue());
14551455
Advance();
14561456
} else {
@@ -1477,7 +1477,7 @@ RustExpressionUP Parser::Call(RustExpressionUP &&func, Status &error) {
14771477
}
14781478
Advance();
14791479

1480-
return llvm::make_unique<RustCall>(std::move(func), std::move(exprs));
1480+
return std::make_unique<RustCall>(std::move(func), std::move(exprs));
14811481
}
14821482

14831483
RustExpressionUP Parser::Index(RustExpressionUP &&array, Status &error) {
@@ -1495,7 +1495,7 @@ RustExpressionUP Parser::Index(RustExpressionUP &&array, Status &error) {
14951495
}
14961496
Advance();
14971497

1498-
return llvm::make_unique<RustBinaryExpression<'@', ArrayIndex>>(std::move(array),
1498+
return std::make_unique<RustBinaryExpression<'@', ArrayIndex>>(std::move(array),
14991499
std::move(idx));
15001500
}
15011501

@@ -1514,7 +1514,7 @@ RustExpressionUP Parser::Struct(RustTypeExpressionUP &&path, Status &error) {
15141514
if (CurrentToken().kind == ',' || CurrentToken().kind == '}') {
15151515
// Plain "field".
15161516
std::string field_copy = field;
1517-
value = llvm::make_unique<RustPathExpression>(std::move(field_copy));
1517+
value = std::make_unique<RustPathExpression>(std::move(field_copy));
15181518
} else if (CurrentToken().kind != ':') {
15191519
error.SetErrorString("':' expected");
15201520
return RustExpressionUP();
@@ -1556,7 +1556,7 @@ RustExpressionUP Parser::Struct(RustTypeExpressionUP &&path, Status &error) {
15561556
}
15571557
Advance();
15581558

1559-
return llvm::make_unique<RustStructExpression>(std::move(path), std::move(inits),
1559+
return std::make_unique<RustStructExpression>(std::move(path), std::move(inits),
15601560
std::move(copy));
15611561
}
15621562

@@ -1570,7 +1570,7 @@ RustExpressionUP Parser::Path(Status &error) {
15701570
if (CurrentToken().kind != COLONCOLON) {
15711571
// This one can't be a struct expression, so we just return
15721572
// directly.
1573-
return llvm::make_unique<RustPathExpression>(std::string("self"));
1573+
return std::make_unique<RustPathExpression>(std::string("self"));
15741574
}
15751575
}
15761576

@@ -1620,17 +1620,17 @@ RustExpressionUP Parser::Path(Status &error) {
16201620
}
16211621

16221622
if (CurrentToken().kind == '{') {
1623-
RustPathUP name_path = llvm::make_unique<RustPath>(saw_self, relative, supers,
1623+
RustPathUP name_path = std::make_unique<RustPath>(saw_self, relative, supers,
16241624
std::move(path), std::move(type_list),
16251625
true);
16261626
RustTypeExpressionUP type_path =
1627-
llvm::make_unique<RustPathTypeExpression>(std::move(name_path));
1627+
std::make_unique<RustPathTypeExpression>(std::move(name_path));
16281628
return Struct(std::move(type_path), error);
16291629
}
16301630

1631-
RustPathUP name_path = llvm::make_unique<RustPath>(saw_self, relative, supers,
1631+
RustPathUP name_path = std::make_unique<RustPath>(saw_self, relative, supers,
16321632
std::move(path), std::move(type_list));
1633-
return llvm::make_unique<RustPathExpression>(std::move(name_path));
1633+
return std::make_unique<RustPathExpression>(std::move(name_path));
16341634
}
16351635

16361636
RustExpressionUP Parser::Sizeof(Status &error) {
@@ -1654,7 +1654,7 @@ RustExpressionUP Parser::Sizeof(Status &error) {
16541654
}
16551655
Advance();
16561656

1657-
return llvm::make_unique<RustUnaryExpression<'@', UnarySizeof>>(std::move(expr));
1657+
return std::make_unique<RustUnaryExpression<'@', UnarySizeof>>(std::move(expr));
16581658
}
16591659

16601660
bool Parser::StartsTerm() {
@@ -1699,8 +1699,8 @@ RustExpressionUP Parser::Term(Status &error) {
16991699
if (!suffix) {
17001700
suffix = "i32";
17011701
}
1702-
RustTypeExpressionUP type = llvm::make_unique<RustPathTypeExpression>(suffix);
1703-
term = llvm::make_unique<RustLiteral>(CurrentToken().uinteger.getValue(), std::move(type));
1702+
RustTypeExpressionUP type = std::make_unique<RustPathTypeExpression>(suffix);
1703+
term = std::make_unique<RustLiteral>(CurrentToken().uinteger.getValue(), std::move(type));
17041704
Advance();
17051705
break;
17061706
}
@@ -1710,29 +1710,29 @@ RustExpressionUP Parser::Term(Status &error) {
17101710
if (!suffix) {
17111711
suffix = "f64";
17121712
}
1713-
RustTypeExpressionUP type = llvm::make_unique<RustPathTypeExpression>(suffix);
1714-
term = llvm::make_unique<RustLiteral>(CurrentToken().dvalue.getValue(), std::move(type));
1713+
RustTypeExpressionUP type = std::make_unique<RustPathTypeExpression>(suffix);
1714+
term = std::make_unique<RustLiteral>(CurrentToken().dvalue.getValue(), std::move(type));
17151715
Advance();
17161716
break;
17171717
}
17181718

17191719
case STRING:
17201720
case BYTESTRING:
1721-
term = llvm::make_unique<RustStringLiteral>(std::move(CurrentToken().str),
1721+
term = std::make_unique<RustStringLiteral>(std::move(CurrentToken().str),
17221722
CurrentToken().kind == BYTESTRING);
17231723
Advance();
17241724
break;
17251725

17261726
case CHAR:
17271727
case BYTE:
1728-
term = llvm::make_unique<RustCharLiteral>(CurrentToken().uinteger.getValue(),
1728+
term = std::make_unique<RustCharLiteral>(CurrentToken().uinteger.getValue(),
17291729
CurrentToken().kind == BYTE);
17301730
Advance();
17311731
break;
17321732

17331733
case TRUE:
17341734
case FALSE:
1735-
term = llvm::make_unique<RustBooleanLiteral>(CurrentToken().kind == TRUE);
1735+
term = std::make_unique<RustBooleanLiteral>(CurrentToken().kind == TRUE);
17361736
Advance();
17371737
break;
17381738

@@ -1800,7 +1800,7 @@ RustExpressionUP Parser::Term(Status &error) {
18001800
if (!type) {
18011801
return RustExpressionUP();
18021802
}
1803-
term = llvm::make_unique<RustCast>(std::move(type), std::move(term));
1803+
term = std::make_unique<RustCast>(std::move(type), std::move(term));
18041804
break;
18051805
}
18061806

@@ -1952,7 +1952,7 @@ RustExpressionUP Parser::Binary(Status &error) {
19521952
switch (top.op) {
19531953
#define DEFINE(Token, Prec, Type) \
19541954
case Token: \
1955-
lhs.term = llvm::make_unique<Type>(std::move(lhs.term), std::move(top.term)); \
1955+
lhs.term = std::make_unique<Type>(std::move(lhs.term), std::move(top.term)); \
19561956
break;
19571957

19581958
BINARY_OPERATORS
@@ -1998,7 +1998,7 @@ RustExpressionUP Parser::Range(Status &error) {
19981998
}
19991999
}
20002000

2001-
return llvm::make_unique<RustRangeExpression>(std::move(lhs), std::move(rhs), is_inclusive);
2001+
return std::make_unique<RustRangeExpression>(std::move(lhs), std::move(rhs), is_inclusive);
20022002
}
20032003

20042004
////////////////////////////////////////////////////////////////
@@ -2033,7 +2033,7 @@ RustTypeExpressionUP Parser::ArrayType(Status &error) {
20332033
}
20342034
Advance();
20352035

2036-
return llvm::make_unique<RustArrayTypeExpression>(std::move(element), len);
2036+
return std::make_unique<RustArrayTypeExpression>(std::move(element), len);
20372037
}
20382038

20392039
RustTypeExpressionUP Parser::ReferenceType(Status &error) {
@@ -2064,10 +2064,10 @@ RustTypeExpressionUP Parser::ReferenceType(Status &error) {
20642064
}
20652065
Advance();
20662066

2067-
return llvm::make_unique<RustSliceTypeExpression>(std::move(target), is_mut);
2067+
return std::make_unique<RustSliceTypeExpression>(std::move(target), is_mut);
20682068
}
20692069

2070-
return llvm::make_unique<RustPointerTypeExpression>(std::move(target), true, is_mut);
2070+
return std::make_unique<RustPointerTypeExpression>(std::move(target), true, is_mut);
20712071
}
20722072

20732073
RustTypeExpressionUP Parser::PointerType(Status &error) {
@@ -2088,7 +2088,7 @@ RustTypeExpressionUP Parser::PointerType(Status &error) {
20882088
return target;
20892089
}
20902090

2091-
return llvm::make_unique<RustPointerTypeExpression>(std::move(target), false, is_mut);
2091+
return std::make_unique<RustPointerTypeExpression>(std::move(target), false, is_mut);
20922092
}
20932093

20942094
bool Parser::TypeList(std::vector<RustTypeExpressionUP> *type_list, Status &error) {
@@ -2174,7 +2174,7 @@ RustTypeExpressionUP Parser::FunctionType(Status &error) {
21742174
return return_type;
21752175
}
21762176

2177-
return llvm::make_unique<RustFunctionTypeExpression>(std::move(return_type),
2177+
return std::make_unique<RustFunctionTypeExpression>(std::move(return_type),
21782178
std::move(type_list));
21792179
}
21802180

@@ -2188,7 +2188,7 @@ RustTypeExpressionUP Parser::TupleType(Status &error) {
21882188
return RustTypeExpressionUP();
21892189
}
21902190

2191-
return llvm::make_unique<RustTupleTypeExpression>(std::move(type_list));
2191+
return std::make_unique<RustTupleTypeExpression>(std::move(type_list));
21922192
}
21932193

21942194
RustTypeExpressionUP Parser::TypePath(Status &error) {
@@ -2249,9 +2249,9 @@ RustTypeExpressionUP Parser::TypePath(Status &error) {
22492249
return RustTypeExpressionUP();
22502250
}
22512251

2252-
RustPathUP name_path = llvm::make_unique<RustPath>(saw_self, relative, supers, std::move(path),
2252+
RustPathUP name_path = std::make_unique<RustPath>(saw_self, relative, supers, std::move(path),
22532253
std::move(type_list));
2254-
return llvm::make_unique<RustPathTypeExpression>(std::move(name_path));
2254+
return std::make_unique<RustPathTypeExpression>(std::move(name_path));
22552255
}
22562256

22572257
RustTypeExpressionUP Parser::Type(Status &error) {

0 commit comments

Comments
 (0)