This revision was automatically updated to reflect the committed changes.
Closed by commit rGf33c2c27a8d4: Fix crash on `user defined literals` (authored
by eduucaldas).
Changed prior to commit:
https://reviews.llvm.org/D82157?vs=277060&id=277071#toc
Repository:
rG LLVM Github Monorepo
CHAN
eduucaldas updated this revision to Diff 277060.
eduucaldas marked an inline comment as done.
eduucaldas added a comment.
Add assert
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82157/new/
https://reviews.llvm.org/D82157
Files:
clang/include/cl
gribozavr2 accepted this revision.
gribozavr2 added inline comments.
This revision is now accepted and ready to land.
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:749
+ else
+return new (allocator()) syntax::FloatUserDefinedLiteralExpression;
+}
---
eduucaldas updated this revision to Diff 276960.
eduucaldas added a comment.
- Add comment explaining complication on LOK_Raw and LOK_Template
- Use FileRange::text instead of Lexer::getSpelling
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82157/ne
eduucaldas marked 2 inline comments as done.
eduucaldas added inline comments.
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:723
+ syntax::UserDefinedLiteralExpression *
+ buildUserDefinedLiteral(UserDefinedLiteral *S) {
+switch (S->getLiteralOperatorKind()) {
eduucaldas added inline comments.
Comment at: clang/unittests/Tooling/Syntax/TreeTest.cpp:1210
+ 12_t; // call: operator<'1', '2'> "" _x() | kind: integer
+ 1.2_t; // call: operator<'1', '2'> "" _x() | kind: float
}
gribozavr2 wrote:
> call -> calls? (as in,
eduucaldas updated this revision to Diff 276919.
eduucaldas marked 9 inline comments as done.
eduucaldas added a comment.
Use right function to get TokSpelling, answer comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82157/new/
https://review
gribozavr2 added inline comments.
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:737
+ Builder.findToken(TokLoc)->text(Context.getSourceManager());
+ auto Literal = NumericLiteralParser{TokSpelling,
+ TokLoc,
eduucaldas updated this revision to Diff 276772.
eduucaldas added a comment.
Nothing
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82157/new/
https://reviews.llvm.org/D82157
Files:
clang/include/clang/Tooling/Syntax/Nodes.h
clang/lib/Tooling/S
eduucaldas marked an inline comment as done.
eduucaldas added inline comments.
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:736
+ auto TokSpelling =
+ Builder.findToken(TokLoc)->text(Context.getSourceManager());
+ auto Literal = NumericLiteralParser{TokSp
eduucaldas updated this revision to Diff 276771.
eduucaldas added a comment.
nothing
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82157/new/
https://reviews.llvm.org/D82157
Files:
clang/include/clang/Tooling/Syntax/Nodes.h
clang/lib/Tooling/S
eduucaldas updated this revision to Diff 276770.
eduucaldas added a comment.
Add support for integer and floating UDL even for raw literal operator and
numeric literal operator template
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82157/new/
http
eduucaldas updated this revision to Diff 276681.
eduucaldas added a comment.
Document proposed solution for treating raw literal operators and numeric
template operators
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82157/new/
https://reviews.llvm
gribozavr2 added inline comments.
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:634
+// `SourceLocation`s. As a result one of these nodes has a valid
+// `SourceLocation` that doesn't point to a token.
+//
eduucaldas wrote:
> gribozavr2 wrote:
>
eduucaldas updated this revision to Diff 276678.
eduucaldas added a comment.
Polishing patch
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82157/new/
https://reviews.llvm.org/D82157
Files:
clang/include/clang/Tooling/Syntax/Nodes.h
clang/lib/T
eduucaldas added inline comments.
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:634
+// `SourceLocation`s. As a result one of these nodes has a valid
+// `SourceLocation` that doesn't point to a token.
+//
gribozavr2 wrote:
> "The semantic AST no
eduucaldas marked 4 inline comments as done.
eduucaldas added inline comments.
Comment at: clang/include/clang/Tooling/Syntax/Nodes.h:347-357
+/// Expression for an unkonwn user-defined literal. C++ [lex.ext]
+class UnknownUserDefinedLiteralExpression final
+: public UserDefi
eduucaldas updated this revision to Diff 276638.
eduucaldas added a comment.
workaround size_t
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82157/new/
https://reviews.llvm.org/D82157
Files:
clang/include/clang/Testing/TestClangConfig.h
clang/
eduucaldas updated this revision to Diff 276637.
eduucaldas marked 4 inline comments as done.
eduucaldas added a comment.
Add support for {Integer,Float,Char,String}UserDefinedLiteral
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82157/new/
https:/
eduucaldas marked 2 inline comments as done.
eduucaldas added inline comments.
Comment at: clang/unittests/Tooling/Syntax/TreeTest.cpp:1265
+| |-UserDefinedLiteralExpression
+| | `-12_w
+| `-;
gribozavr2 wrote:
> It looks somewhat weird to me that int
gribozavr2 added a comment.
> Fix crash on `user defined literals`
WDYT:
Implement support for user defined literals (which also fixes a crash)
> Given an UserDefinedLiteral 1.2_w:
> Problem: Lexer generates one Token for the literal, but ClangAST
> references two source locations
> Fix: Ign
eduucaldas updated this revision to Diff 276361.
eduucaldas added a comment.
Reflect fix on RecursiveASTVisitor
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82157/new/
https://reviews.llvm.org/D82157
Files:
clang/include/clang/Tooling/Syntax/No
gribozavr2 added inline comments.
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:632
+// As a node is built by folding tokens we cannot generate one
+// for `_w`
+Builder.markChildToken(S->getBeginLoc(), syntax::NodeRole::LiteralToken);
This comme
eduucaldas updated this revision to Diff 271980.
eduucaldas added a comment.
Why does this work?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82157/new/
https://reviews.llvm.org/D82157
Files:
clang/lib/Tooling/Syntax/BuildTree.cpp
clang/unitt
eduucaldas created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Given an UserDefinedLiteral `1.2_w`:
Problem: Lexer generates one Token for the literal, but ClangAST
references two source locations
Fix: Ignore the operator and interpret it as the underlying
25 matches
Mail list logo