Skip to content

Commit b811940

Browse files
document the function declaration and change param name
1 parent 09dd041 commit b811940

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

clang/include/clang/Parse/Parser.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5158,6 +5158,16 @@ class Parser : public CodeCompletionHandler {
51585158

51595159
///@}
51605160

5161+
//===--------------------------------------------------------------------===//
5162+
// Reflection parsing
5163+
5164+
/// ParseCXXReflectExpression - parses the operand of reflection operator
5165+
/// \param DoubleCaretLoc the location of the double caret operator
5166+
///
5167+
/// \returns on success, a expression holdiing the constructed CXXReflectExpr;
5168+
/// on failture, an ExprError
5169+
ExprResult ParseCXXReflectExpression(SourceLocation DoubleCaretLoc);
5170+
51615171
//
51625172
//
51635173
// -------------------------------------------------------------------------
@@ -5169,8 +5179,6 @@ class Parser : public CodeCompletionHandler {
51695179
///@{
51705180

51715181
//===--------------------------------------------------------------------===//
5172-
// Parses the operand of reflection operator
5173-
ExprResult ParseCXXReflectExpression(SourceLocation OpLoc);
51745182

51755183
private:
51765184
bool MaybeParseHLSLAnnotations(Declarator &D,
@@ -7682,7 +7690,7 @@ class Parser : public CodeCompletionHandler {
76827690
/// [GNU] asm-clobbers:
76837691
/// asm-string-literal
76847692
/// asm-clobbers ',' asm-string-literal
7685-
/// \endverbatim
7693+
/// \endverbatim
76867694
///
76877695
StmtResult ParseAsmStatement(bool &msAsm);
76887696

clang/lib/Parse/ParseReflect.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "clang/Sema/EnterExpressionEvaluationContext.h"
1717
using namespace clang;
1818

19-
ExprResult Parser::ParseCXXReflectExpression(SourceLocation OpLoc) {
19+
ExprResult Parser::ParseCXXReflectExpression(SourceLocation DoubleCaretLoc) {
2020
// TODO(reflection) : support parsing for more reflect-expressions.
2121
EnterExpressionEvaluationContext Unevaluated(
2222
Actions, Sema::ExpressionEvaluationContext::Unevaluated);
@@ -30,7 +30,8 @@ ExprResult Parser::ParseCXXReflectExpression(SourceLocation OpLoc) {
3030
ConsumeToken();
3131
TPA.Commit();
3232
Decl *TUDecl = Actions.getASTContext().getTranslationUnitDecl();
33-
return Actions.ActOnCXXReflectExpr(OpLoc, SourceLocation(), TUDecl);
33+
return Actions.ActOnCXXReflectExpr(DoubleCaretLoc, SourceLocation(),
34+
TUDecl);
3435
}
3536
TPA.Revert();
3637
}
@@ -52,7 +53,7 @@ ExprResult Parser::ParseCXXReflectExpression(SourceLocation OpLoc) {
5253
QualType Canon = QT.getCanonicalType();
5354
if (Canon->isBuiltinType()) {
5455
// Only supports builtin types for now
55-
return Actions.ActOnCXXReflectExpr(OpLoc, TSI);
56+
return Actions.ActOnCXXReflectExpr(DoubleCaretLoc, TSI);
5657
}
5758
}
5859

0 commit comments

Comments
 (0)