forked from OSchip/llvm-project
Fix code typos spotted while working on type traits
llvm-svn: 196587
This commit is contained in:
parent
d629980ab3
commit
028ed91127
|
@ -799,7 +799,7 @@ struct TypeList {
|
|||
/// \brief The first type on the list.
|
||||
typedef T1 head;
|
||||
|
||||
/// \brief A sub list with the tail. ie everything but the head.
|
||||
/// \brief A sublist with the tail. ie everything but the head.
|
||||
///
|
||||
/// This type is used to do recursion. TypeList<>/EmptyTypeList indicates the
|
||||
/// end of the list.
|
||||
|
|
|
@ -136,9 +136,9 @@ class Parser : public CodeCompletionHandler {
|
|||
mutable IdentifierInfo *Ident_final;
|
||||
mutable IdentifierInfo *Ident_override;
|
||||
|
||||
// C++ type trait keywords that have can be reverted to identifiers and
|
||||
// still used as type traits.
|
||||
llvm::SmallDenseMap<IdentifierInfo *, tok::TokenKind> RevertableTypeTraits;
|
||||
// C++ type trait keywords that can be reverted to identifiers and still be
|
||||
// used as type traits.
|
||||
llvm::SmallDenseMap<IdentifierInfo *, tok::TokenKind> RevertibleTypeTraits;
|
||||
|
||||
OwningPtr<PragmaHandler> AlignHandler;
|
||||
OwningPtr<PragmaHandler> GCCVisibilityHandler;
|
||||
|
|
|
@ -1832,7 +1832,7 @@ public:
|
|||
"Should be called only during statement reading!");
|
||||
// Subexpressions are stored from last to first, so the next Stmt we need
|
||||
// is at the back of the stack.
|
||||
assert(!StmtStack.empty() && "Read too many sub statements!");
|
||||
assert(!StmtStack.empty() && "Read too many sub-statements!");
|
||||
return StmtStack.pop_back_val();
|
||||
}
|
||||
|
||||
|
|
|
@ -246,10 +246,10 @@ private:
|
|||
/// @name FlushStmt Caches
|
||||
/// @{
|
||||
|
||||
/// \brief Set of parent Stmts for the currently serializing sub stmt.
|
||||
/// \brief Set of parent Stmts for the currently serializing sub-stmt.
|
||||
llvm::DenseSet<Stmt *> ParentStmts;
|
||||
|
||||
/// \brief Offsets of sub stmts already serialized. The offset points
|
||||
/// \brief Offsets of sub-stmts already serialized. The offset points
|
||||
/// just after the stmt record.
|
||||
llvm::DenseMap<Stmt *, uint64_t> SubStmtEntries;
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ public:
|
|||
|
||||
virtual SVal evalComplement(NonLoc val) = 0;
|
||||
|
||||
/// Create a new value which represents a binary expression with two non
|
||||
/// Create a new value which represents a binary expression with two non-
|
||||
/// location operands.
|
||||
virtual SVal evalBinOpNN(ProgramStateRef state, BinaryOperator::Opcode op,
|
||||
NonLoc lhs, NonLoc rhs, QualType resultTy) = 0;
|
||||
|
|
|
@ -1041,7 +1041,7 @@ void StmtPrinter::VisitCompoundLiteralExpr(CompoundLiteralExpr *Node) {
|
|||
PrintExpr(Node->getInitializer());
|
||||
}
|
||||
void StmtPrinter::VisitImplicitCastExpr(ImplicitCastExpr *Node) {
|
||||
// No need to print anything, simply forward to the sub expression.
|
||||
// No need to print anything, simply forward to the subexpression.
|
||||
PrintExpr(Node->getSubExpr());
|
||||
}
|
||||
void StmtPrinter::VisitBinaryOperator(BinaryOperator *Node) {
|
||||
|
@ -1625,7 +1625,7 @@ void StmtPrinter::VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *E) {
|
|||
}
|
||||
|
||||
void StmtPrinter::VisitExprWithCleanups(ExprWithCleanups *E) {
|
||||
// Just forward to the sub expression.
|
||||
// Just forward to the subexpression.
|
||||
PrintExpr(E->getSubExpr());
|
||||
}
|
||||
|
||||
|
|
|
@ -719,30 +719,30 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
|
|||
Tok.is(tok::identifier) &&
|
||||
Tok.getIdentifierInfo()->hasRevertedTokenIDToIdentifier()) {
|
||||
IdentifierInfo *II = Tok.getIdentifierInfo();
|
||||
// Build up the mapping of revertable type traits, for future use.
|
||||
if (RevertableTypeTraits.empty()) {
|
||||
// Build up the mapping of revertible type traits, for future use.
|
||||
if (RevertibleTypeTraits.empty()) {
|
||||
#define RTT_JOIN(X,Y) X##Y
|
||||
#define REVERTABLE_TYPE_TRAIT(Name) \
|
||||
RevertableTypeTraits[PP.getIdentifierInfo(#Name)] \
|
||||
#define REVERTIBLE_TYPE_TRAIT(Name) \
|
||||
RevertibleTypeTraits[PP.getIdentifierInfo(#Name)] \
|
||||
= RTT_JOIN(tok::kw_,Name)
|
||||
|
||||
REVERTABLE_TYPE_TRAIT(__is_arithmetic);
|
||||
REVERTABLE_TYPE_TRAIT(__is_convertible);
|
||||
REVERTABLE_TYPE_TRAIT(__is_empty);
|
||||
REVERTABLE_TYPE_TRAIT(__is_floating_point);
|
||||
REVERTABLE_TYPE_TRAIT(__is_function);
|
||||
REVERTABLE_TYPE_TRAIT(__is_fundamental);
|
||||
REVERTABLE_TYPE_TRAIT(__is_integral);
|
||||
REVERTABLE_TYPE_TRAIT(__is_member_function_pointer);
|
||||
REVERTABLE_TYPE_TRAIT(__is_member_pointer);
|
||||
REVERTABLE_TYPE_TRAIT(__is_pod);
|
||||
REVERTABLE_TYPE_TRAIT(__is_pointer);
|
||||
REVERTABLE_TYPE_TRAIT(__is_same);
|
||||
REVERTABLE_TYPE_TRAIT(__is_scalar);
|
||||
REVERTABLE_TYPE_TRAIT(__is_signed);
|
||||
REVERTABLE_TYPE_TRAIT(__is_unsigned);
|
||||
REVERTABLE_TYPE_TRAIT(__is_void);
|
||||
#undef REVERTABLE_TYPE_TRAIT
|
||||
REVERTIBLE_TYPE_TRAIT(__is_arithmetic);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_convertible);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_empty);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_floating_point);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_function);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_fundamental);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_integral);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_member_function_pointer);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_member_pointer);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_pod);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_pointer);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_same);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_scalar);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_signed);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_unsigned);
|
||||
REVERTIBLE_TYPE_TRAIT(__is_void);
|
||||
#undef REVERTIBLE_TYPE_TRAIT
|
||||
#undef RTT_JOIN
|
||||
}
|
||||
|
||||
|
@ -750,8 +750,8 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
|
|||
// update the token kind in place and parse again to treat it as
|
||||
// the appropriate kind of type trait.
|
||||
llvm::SmallDenseMap<IdentifierInfo *, tok::TokenKind>::iterator Known
|
||||
= RevertableTypeTraits.find(II);
|
||||
if (Known != RevertableTypeTraits.end()) {
|
||||
= RevertibleTypeTraits.find(II);
|
||||
if (Known != RevertibleTypeTraits.end()) {
|
||||
Tok.setKind(Known->second);
|
||||
return ParseCastExpression(isUnaryExpression, isAddressOfOperand,
|
||||
NotCastExpr, isTypeCast);
|
||||
|
|
|
@ -9876,7 +9876,7 @@ Sema::ActOnStmtExpr(SourceLocation LPLoc, Stmt *SubStmt,
|
|||
// example, it is not possible to goto into a stmt expression apparently.
|
||||
// More semantic analysis is needed.
|
||||
|
||||
// If there are sub stmts in the compound stmt, take the type of the last one
|
||||
// If there are sub-stmts in the compound stmt, take the type of the last one
|
||||
// as the type of the stmtexpr.
|
||||
QualType Ty = Context.VoidTy;
|
||||
bool StmtExprMayBindToTemp = false;
|
||||
|
|
|
@ -5049,7 +5049,7 @@ Sema::MaybeCreateExprWithCleanups(ExprResult SubExpr) {
|
|||
}
|
||||
|
||||
Expr *Sema::MaybeCreateExprWithCleanups(Expr *SubExpr) {
|
||||
assert(SubExpr && "sub expression can't be null!");
|
||||
assert(SubExpr && "subexpression can't be null!");
|
||||
|
||||
CleanupVarDeclMarking();
|
||||
|
||||
|
@ -5070,7 +5070,7 @@ Expr *Sema::MaybeCreateExprWithCleanups(Expr *SubExpr) {
|
|||
}
|
||||
|
||||
Stmt *Sema::MaybeCreateStmtWithCleanups(Stmt *SubStmt) {
|
||||
assert(SubStmt && "sub statement can't be null!");
|
||||
assert(SubStmt && "sub-statement can't be null!");
|
||||
|
||||
CleanupVarDeclMarking();
|
||||
|
||||
|
|
|
@ -11893,7 +11893,7 @@ Expr *Sema::FixOverloadedFunctionReference(Expr *E, DeclAccessPair Found,
|
|||
// Do nothing: static member functions aren't any different
|
||||
// from non-member functions.
|
||||
} else {
|
||||
// Fix the sub expression, which really has to be an
|
||||
// Fix the subexpression, which really has to be an
|
||||
// UnresolvedLookupExpr holding an overloaded member function
|
||||
// or template.
|
||||
Expr *SubExpr = FixOverloadedFunctionReference(UnOp->getSubExpr(),
|
||||
|
|
|
@ -2491,7 +2491,7 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
|
|||
StmtStack.push_back(S);
|
||||
}
|
||||
Done:
|
||||
assert(StmtStack.size() > PrevNumStmts && "Read too many sub stmts!");
|
||||
assert(StmtStack.size() > PrevNumStmts && "Read too many sub-stmts!");
|
||||
assert(StmtStack.size() == PrevNumStmts + 1 && "Extra expressions on stack!");
|
||||
return StmtStack.pop_back_val();
|
||||
}
|
||||
|
|
|
@ -1812,7 +1812,7 @@ void ASTWriter::WriteSubStmt(Stmt *S,
|
|||
ParentStmtInserterRAII ParentStmtInserter(S, ParentStmts);
|
||||
#endif
|
||||
|
||||
// Redirect ASTWriter::AddStmt to collect sub stmts.
|
||||
// Redirect ASTWriter::AddStmt to collect sub-stmts.
|
||||
SmallVector<Stmt *, 16> SubStmts;
|
||||
CollectedStmts = &SubStmts;
|
||||
|
||||
|
@ -1825,16 +1825,16 @@ void ASTWriter::WriteSubStmt(Stmt *S,
|
|||
SourceManager &SrcMgr
|
||||
= DeclIDs.begin()->first->getASTContext().getSourceManager();
|
||||
S->dump(SrcMgr);
|
||||
llvm_unreachable("Unhandled sub statement writing AST file");
|
||||
llvm_unreachable("Unhandled sub-statement writing AST file");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Revert ASTWriter::AddStmt.
|
||||
CollectedStmts = &StmtsToEmit;
|
||||
|
||||
// Write the sub stmts in reverse order, last to first. When reading them back
|
||||
// Write the sub-stmts in reverse order, last to first. When reading them back
|
||||
// we will read them in correct order by "pop"ing them from the Stmts stack.
|
||||
// This simplifies reading and allows to store a variable number of sub stmts
|
||||
// This simplifies reading and allows to store a variable number of sub-stmts
|
||||
// without knowing it in advance.
|
||||
while (!SubStmts.empty())
|
||||
WriteSubStmt(SubStmts.pop_back_val(), SubStmtEntries, ParentStmts);
|
||||
|
@ -1851,7 +1851,7 @@ void ASTWriter::FlushStmts() {
|
|||
|
||||
// We expect to be the only consumer of the two temporary statement maps,
|
||||
// assert that they are empty.
|
||||
assert(SubStmtEntries.empty() && "unexpected entries in sub stmt map");
|
||||
assert(SubStmtEntries.empty() && "unexpected entries in sub-stmt map");
|
||||
assert(ParentStmts.empty() && "unexpected entries in parent stmt map");
|
||||
|
||||
for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {
|
||||
|
|
Loading…
Reference in New Issue