This revision was automatically updated to reflect the committed changes.
Closed by commit rL308433: Add default values for function parameter chunks
(authored by erikjv).
Changed prior to commit:
https://reviews.llvm.org/D33644?vs=107077&id=107276#toc
Repository:
rL LLVM
https://reviews.ll
klimek accepted this revision.
klimek added a comment.
This revision is now accepted and ready to land.
lg
Comment at: lib/Sema/SemaCodeComplete.cpp:2422
+ std::string DefValue{srcText};
+ // TODO: remove this check if the Lexer::getSourceText value is fixed and
+ // this va
yvvan updated this revision to Diff 107077.
yvvan added a comment.
Add TODO about '=' check
https://reviews.llvm.org/D33644
Files:
lib/Sema/SemaCodeComplete.cpp
test/CodeCompletion/functions.cpp
test/Index/code-completion.cpp
test/Index/complete-optional-params.cpp
Index: test/Index/co
klimek added a comment.
In https://reviews.llvm.org/D33644#812693, @yvvan wrote:
> So do we wait until the '=' case is more clear? This change should not break
> anything if it's fixed in either direction (if '=' will be provided always or
> never)
Ok, if you add a TODO I think this is fine f
yvvan added a comment.
So do we wait until the '=' case is more clear? This change should not break
anything if it's fixed in either direction (if '=' will be provided always or
never)
https://reviews.llvm.org/D33644
___
cfe-commits mailing list
c
klimek added a reviewer: rsmith.
klimek added a comment.
+Richard, as apparently we get the source ranges for default values of built-in
types without the preceding "=", but for user-defined types including the
preceding "=" - is that intentional?
Comment at: lib/Sema/SemaCod
yvvan updated this revision to Diff 106170.
yvvan added a comment.
Add more checks into GetDefaultValueString to make it safe
https://reviews.llvm.org/D33644
Files:
lib/Sema/SemaCodeComplete.cpp
test/CodeCompletion/functions.cpp
test/Index/code-completion.cpp
test/Index/complete-optiona
yvvan added a comment.
Ping! Comments are added :)
https://reviews.llvm.org/D33644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yvvan updated this revision to Diff 105976.
yvvan added a comment.
Add comments why it's needed to add '=' to default value in some cases
https://reviews.llvm.org/D33644
Files:
lib/Sema/SemaCodeComplete.cpp
test/CodeCompletion/functions.cpp
test/Index/code-completion.cpp
test/Index/comp
klimek added inline comments.
Comment at: lib/Sema/SemaCodeComplete.cpp:2411-2412
+ if (DefValue.at(0) != '=') {
+// If we don't have = in front of value
+return " = " + DefValue;
+ }
Can you expand in the comment on when each of these happens? Intuitiv
yvvan added a comment.
Ping :)
It's quite likely ok now because covered with tests. Check please.
https://reviews.llvm.org/D33644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yvvan updated this revision to Diff 105045.
yvvan added a comment.
Add tests, append tests with default values. Move all default value handling to
GetDefaultValueString
https://reviews.llvm.org/D33644
Files:
lib/Sema/SemaCodeComplete.cpp
test/CodeCompletion/functions.cpp
test/Index/code-
klimek added a comment.
In https://reviews.llvm.org/D33644#793601, @yvvan wrote:
> In https://reviews.llvm.org/D33644#793594, @klimek wrote:
>
> > In https://reviews.llvm.org/D33644#793577, @yvvan wrote:
> >
> > > In https://reviews.llvm.org/D33644#793573, @klimek wrote:
> > >
> > > > In https://
yvvan added a comment.
In https://reviews.llvm.org/D33644#793594, @klimek wrote:
> In https://reviews.llvm.org/D33644#793577, @yvvan wrote:
>
> > In https://reviews.llvm.org/D33644#793573, @klimek wrote:
> >
> > > In https://reviews.llvm.org/D33644#783903, @yvvan wrote:
> > >
> > > > Do not evalu
klimek added a comment.
In https://reviews.llvm.org/D33644#793577, @yvvan wrote:
> In https://reviews.llvm.org/D33644#793573, @klimek wrote:
>
> > In https://reviews.llvm.org/D33644#783903, @yvvan wrote:
> >
> > > Do not evaluate numbers.
> > > Check for != "=" is needed not to mess with invalid
yvvan added a comment.
In https://reviews.llvm.org/D33644#793573, @klimek wrote:
> In https://reviews.llvm.org/D33644#783903, @yvvan wrote:
>
> > Do not evaluate numbers.
> > Check for != "=" is needed not to mess with invalid default arguments or
> > their types (without it I get "const Bar& b
klimek added a comment.
In https://reviews.llvm.org/D33644#783903, @yvvan wrote:
> Do not evaluate numbers.
> Check for != "=" is needed not to mess with invalid default arguments or
> their types (without it I get "const Bar& bar = =" when Bar is not defined)
Shouldn't we than instead check
yvvan added a comment.
Recheck please the latest diff
https://reviews.llvm.org/D33644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yvvan updated this revision to Diff 103016.
yvvan added a comment.
Do not evaluate numbers.
Check for != "=" is needed not to mess with invalid default arguments or their
types (without it I get "const Bar& bar = =" when Bar is not defined)
https://reviews.llvm.org/D33644
Files:
lib/Sema/Sem
yvvan added inline comments.
Comment at: lib/Sema/SemaCodeComplete.cpp:2453
std::string PlaceholderStr = FormatFunctionParameter(Policy, Param);
+if (Param->hasDefaultArg() && PlaceholderStr.find("=") ==
std::string::npos) {
+std::string DefaultValue =
-
klimek added inline comments.
Comment at: lib/Sema/SemaCodeComplete.cpp:2453
std::string PlaceholderStr = FormatFunctionParameter(Policy, Param);
+if (Param->hasDefaultArg() && PlaceholderStr.find("=") ==
std::string::npos) {
+std::string DefaultValue =
yvvan updated this revision to Diff 102800.
yvvan added a comment.
Use Lexer::getSourceText
https://reviews.llvm.org/D33644
Files:
lib/Sema/SemaCodeComplete.cpp
Index: lib/Sema/SemaCodeComplete.cpp
===
--- lib/Sema/SemaCodeComp
yvvan added inline comments.
Comment at: lib/Sema/SemaCodeComplete.cpp:2453
std::string PlaceholderStr = FormatFunctionParameter(Policy, Param);
+if (Param->hasDefaultArg() && PlaceholderStr.find("=") ==
std::string::npos) {
+std::string DefaultValue =
-
klimek added inline comments.
Comment at: lib/Sema/SemaCodeComplete.cpp:2453
std::string PlaceholderStr = FormatFunctionParameter(Policy, Param);
+if (Param->hasDefaultArg() && PlaceholderStr.find("=") ==
std::string::npos) {
+std::string DefaultValue =
yvvan added inline comments.
Comment at: lib/Sema/SemaCodeComplete.cpp:2411-2417
+ const SourceLocation StartLoc = SrcRange.getBegin();
+ const SourceLocation EndLoc = SrcRange.getEnd();
+ if (StartLoc != SM.getExpansionLoc(StartLoc) || EndLoc !=
SM.getExpansionLoc(EndLoc))
+
klimek added a comment.
Ok, now I get it - can you please add tests? This is usually tested by adding a
c-index-test based test.
Comment at: lib/Sema/SemaCodeComplete.cpp:2411-2417
+ const SourceLocation StartLoc = SrcRange.getBegin();
+ const SourceLocation EndLoc = SrcRang
yvvan added a comment.
In https://reviews.llvm.org/D33644#780188, @klimek wrote:
> Can you give a bit more background what this is trying to do?
Sure :)
Currently default value string does not contain default value itself. This
change fixes it and adds the default value to the string.
https:
klimek added a comment.
Can you give a bit more background what this is trying to do?
https://reviews.llvm.org/D33644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yvvan added a comment.
Anyone? :)
https://reviews.llvm.org/D33644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yvvan added a comment.
Can someone check my review please?
https://reviews.llvm.org/D33644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yvvan added a comment.
Waiting for review...
https://reviews.llvm.org/D33644
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yvvan updated this revision to Diff 100705.
yvvan edited the summary of this revision.
yvvan added a comment.
Support for non-simple types. Drop results with macros.
https://reviews.llvm.org/D33644
Files:
lib/Sema/SemaCodeComplete.cpp
Index: lib/Sema/SemaCodeComplete.cpp
===
yvvan created this revision.
Append optional chunks with their default values. For example: before - "int
i", after - "int i = 10". This change affects only simple types.
https://reviews.llvm.org/D33644
Files:
lib/Sema/SemaCodeComplete.cpp
Index: lib/Sema/SemaCodeComplete.cpp
=
33 matches
Mail list logo