This is an archive of the discontinued LLVM Phabricator instance.

[clang-repl] Support multiline function definition.
AbandonedPublic

Authored by sunho on Jul 7 2022, 2:55 AM.

Details

Reviewers
v.g.vassilev
Summary

Supports multiline function definition. It pre-lex the entire source code and count brace level to see if additional lines are needed. It counts braces after preprocessing is done, thus it correctly handles tricky #ifdef directive cases such as this one reported in cling. (https://sft.its.cern.ch/jira/si/jira.issueviews:issue-html/ROOT-4812/ROOT-4812.html)

Currently, ReceiveCompleteSourceInput runs in O(n^2) where n is the number of lines within a function. Extension of Lexer class is required to make this more efficient up to O(n). Specifically, we need to teach Lexer to receive variable buffer and ask for additional bytes when it consumed all the buffer.

Diff Detail

Event Timeline

sunho created this revision.Jul 7 2022, 2:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2022, 2:55 AM
sunho requested review of this revision.Jul 7 2022, 2:55 AM
sunho added a comment.Jul 7 2022, 2:59 AM
This comment was removed by sunho.
sunho updated this revision to Diff 443146.Jul 7 2022, 11:50 PM
sunho retitled this revision from [clang-repl] Support multiline declaration & statements. to [clang-repl] Support multiline function definition..
sunho edited the summary of this revision. (Show Details)
sunho abandoned this revision.Feb 3 2023, 2:41 PM

We don't need this now.