Page MenuHomePhabricator
Feed Advanced Search

Wed, Oct 9

martong retitled D68634: [ASTImporter] Imported FunctionDecls inherit __attribute__((noreturn)) and analyzer_noreturn attrs from existing functions from [ASTImporter] Imported FunctionDecls inherit attributes from existing functions to [ASTImporter] Imported FunctionDecls inherit __attribute__((noreturn)) and analyzer_noreturn attrs from existing functions.
Wed, Oct 9, 5:16 AM · Restricted Project
martong added a comment to D68634: [ASTImporter] Imported FunctionDecls inherit __attribute__((noreturn)) and analyzer_noreturn attrs from existing functions.

Hello Balasz,
In my opinion, importing and setting the attributes should be handled by the stuff used in InitializeImportedDecl(). Can we extend it or reuse the code? It will allow us not to miss the required actions while importing a new function too.

I was thinking about that too, but it turned out to be a way more intrusive change.

We have to work with the most recent existing decl (PrevDecl) of the FunctionDecl whose attribute we currently import.
We can get the PrevDecl only with the help of the lookup. We can't get it from the ToD param of InitializeImportedDecl because by the time when we call InitializeImportedDecl the redecl chain is not connected. So, we should pass PrevDecl then into GetImportedOrCreateDecl. It would require to change all call expressions of GetImportedOrCreateDecl (58 occurences). Besides, we would use the PrevDecl only in case of inheritable attributes, only they require this special care. Note that there are a bunch of non-inheritable attributes which are already handled correctly in InitializeImportedDecl.

Wed, Oct 9, 5:13 AM · Restricted Project
martong added a comment to D68634: [ASTImporter] Imported FunctionDecls inherit __attribute__((noreturn)) and analyzer_noreturn attrs from existing functions.

Hello Balasz,
In my opinion, importing and setting the attributes should be handled by the stuff used in InitializeImportedDecl(). Can we extend it or reuse the code? It will allow us not to miss the required actions while importing a new function too.

Wed, Oct 9, 5:04 AM · Restricted Project

Tue, Oct 8

martong created D68634: [ASTImporter] Imported FunctionDecls inherit __attribute__((noreturn)) and analyzer_noreturn attrs from existing functions.
Tue, Oct 8, 4:33 AM · Restricted Project

Mon, Oct 7

martong committed rG305a11d40911: [ASTImporter][NFC] Enable disabled but passing test (authored by martong).
[ASTImporter][NFC] Enable disabled but passing test
Mon, Oct 7, 10:11 PM
martong committed rL373896: [ASTImporter][NFC] Enable disabled but passing test.
[ASTImporter][NFC] Enable disabled but passing test
Mon, Oct 7, 10:10 PM
martong committed rG8f7fbed85e4b: [ASTImporter][NFC] Update ASTImporter internals docs (authored by martong).
[ASTImporter][NFC] Update ASTImporter internals docs
Mon, Oct 7, 10:10 PM
martong committed rG579882ae4407: [ASTImporter][NFC] Fix typo in user docs (authored by martong).
[ASTImporter][NFC] Fix typo in user docs
Mon, Oct 7, 10:10 PM
martong committed rL373895: [ASTImporter][NFC] Update ASTImporter internals docs.
[ASTImporter][NFC] Update ASTImporter internals docs
Mon, Oct 7, 10:10 PM
martong committed rL373894: [ASTImporter][NFC] Fix typo in user docs.
[ASTImporter][NFC] Fix typo in user docs
Mon, Oct 7, 10:10 PM

Thu, Oct 3

martong accepted D68326: [lldb][modern-type-lookup] No longer import temporary declarations into the persistent AST.

LGTM!

Thu, Oct 3, 9:15 AM · Restricted Project, Restricted Project

Wed, Oct 2

martong added a comment to D68326: [lldb][modern-type-lookup] No longer import temporary declarations into the persistent AST.

With [modern-type-lookup], we completely evade the use of ASTImporterDelegate? That would be a wonderful thing to use only the the ExternalASTMerger on a long term...

Wed, Oct 2, 7:07 AM · Restricted Project, Restricted Project

Tue, Oct 1

martong added a comment to D68140: [lldb][clang][modern-type-lookup] Use ASTImporterSharedState in ExternalASTMerger.

Raphael, thanks for working on this. Overall, the changes look good to me, but please see my comment for the constructor.

Tue, Oct 1, 2:58 AM · Restricted Project, Restricted Project

Tue, Sep 24

martong committed rG9223d438db3a: [ASTImporter] 4th attempt to fix Windows buildbot test errors (authored by martong).
[ASTImporter] 4th attempt to fix Windows buildbot test errors
Tue, Sep 24, 2:01 AM
martong committed rL372705: [ASTImporter] 4th attempt to fix Windows buildbot test errors.
[ASTImporter] 4th attempt to fix Windows buildbot test errors
Tue, Sep 24, 1:59 AM

Mon, Sep 23

martong committed rG3135a01da825: [ASTImporter] 3rd attempt to fix Windows buildbot test errors (authored by martong).
[ASTImporter] 3rd attempt to fix Windows buildbot test errors
Mon, Sep 23, 10:49 PM
martong committed rL372688: [ASTImporter] 3rd attempt to fix Windows buildbot test errors.
[ASTImporter] 3rd attempt to fix Windows buildbot test errors
Mon, Sep 23, 10:48 PM
martong committed rG174d43d123f5: [ASTImporter] 2nd attempt to fix Windows buildbot test errors (authored by martong).
[ASTImporter] 2nd attempt to fix Windows buildbot test errors
Mon, Sep 23, 12:56 PM
martong committed rL372646: [ASTImporter] 2nd attempt to fix Windows buildbot test errors.
[ASTImporter] 2nd attempt to fix Windows buildbot test errors
Mon, Sep 23, 12:52 PM
martong added a comment to D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.

2nd attempt to fix the windows build errors: 372646

Mon, Sep 23, 12:49 PM · Restricted Project, Restricted Project
martong committed rG4d51c6ff2311: [ASTImporter] Attempt to fix Windows buildbot test errors (authored by martong).
[ASTImporter] Attempt to fix Windows buildbot test errors
Mon, Sep 23, 10:28 AM
martong added a comment to D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.

Trying to fix in svn commit 372633.

Mon, Sep 23, 10:28 AM · Restricted Project, Restricted Project
martong committed rL372633: [ASTImporter] Attempt to fix Windows buildbot test errors.
[ASTImporter] Attempt to fix Windows buildbot test errors
Mon, Sep 23, 10:27 AM
martong committed rGc65628a49ad3: [ASTImporter][NFC] Add comprehensive tests for ODR violation handling strategies (authored by martong).
[ASTImporter][NFC] Add comprehensive tests for ODR violation handling strategies
Mon, Sep 23, 2:32 AM
martong committed rL372564: [ASTImporter][NFC] Add comprehensive tests for ODR violation handling strategies.
[ASTImporter][NFC] Add comprehensive tests for ODR violation handling strategies
Mon, Sep 23, 2:30 AM
martong closed D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.
Mon, Sep 23, 2:30 AM · Restricted Project, Restricted Project

Fri, Sep 20

martong added a comment to D67803: [lldb] Fix that importing decls in a TagDecl end up in wrong declaration context (partly reverts D61333).

BTW, I tried to access the bug reports rdar://55502701 and rdar://55129537, but could not.
I tried at openradar, but there the search for the ID was not successful.
I wonder if there is a publicly accessible (for non Apple employees) URL for these bugs?

Fri, Sep 20, 6:16 AM · Restricted Project, Restricted Project
martong accepted D67803: [lldb] Fix that importing decls in a TagDecl end up in wrong declaration context (partly reverts D61333).

Thanks for the thorough explanation about the different ASTContexts in LLDB.
The hack is indeed hideous, but seems good to me... for now until the real solution is born.

Fri, Sep 20, 5:58 AM · Restricted Project, Restricted Project
martong accepted D61478: Move decl completion out of the ASTImporterDelegate and document it [NFC].

Looks good to me, thanks!

Fri, Sep 20, 5:32 AM · Restricted Project, Restricted Project

Wed, Sep 18

martong added inline comments to D67545: [clang-tidy] Added DefaultOperatorNewCheck..
Wed, Sep 18, 6:26 AM · Restricted Project
martong added inline comments to D67545: [clang-tidy] Added DefaultOperatorNewCheck..
Wed, Sep 18, 6:16 AM · Restricted Project
martong added inline comments to D67545: [clang-tidy] Added DefaultOperatorNewCheck..
Wed, Sep 18, 6:07 AM · Restricted Project
martong added inline comments to D67545: [clang-tidy] Added DefaultOperatorNewCheck..
Wed, Sep 18, 5:40 AM · Restricted Project
martong added inline comments to D67545: [clang-tidy] Added DefaultOperatorNewCheck..
Wed, Sep 18, 5:16 AM · Restricted Project

Sep 16 2019

martong added inline comments to D67545: [clang-tidy] Added DefaultOperatorNewCheck..
Sep 16 2019, 8:36 AM · Restricted Project
martong added inline comments to D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.
Sep 16 2019, 7:28 AM · Restricted Project, Restricted Project
martong updated the diff for D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.
  • PrevF->ImportedF, remove braces
Sep 16 2019, 7:28 AM · Restricted Project, Restricted Project

Sep 13 2019

martong added a comment to D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.

I have reorganized the tests to group the ones which test ODR violation strategy independent behaviour.

Sep 13 2019, 10:05 AM · Restricted Project, Restricted Project
martong updated the diff for D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.
  • Reorganize ODRStrategy independent behaviour tests.
Sep 13 2019, 10:01 AM · Restricted Project, Restricted Project
martong updated the diff for D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.
  • Initialize the variable template in test
  • Clean up tests for fun templates and for specializations
Sep 13 2019, 7:56 AM · Restricted Project, Restricted Project
martong added inline comments to D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.
Sep 13 2019, 7:56 AM · Restricted Project, Restricted Project
martong committed rG9eaa981e8efd: [ASTImporter] Add development internals docs (authored by martong).
[ASTImporter] Add development internals docs
Sep 13 2019, 4:22 AM
martong committed rL371839: [ASTImporter] Add development internals docs.
[ASTImporter] Add development internals docs
Sep 13 2019, 4:21 AM
martong closed D66336: [ASTImporter] Add development internals docs.
Sep 13 2019, 4:20 AM · Restricted Project, Restricted Project

Sep 12 2019

martong added a reviewer for D67490: [Clang][ASTImporter] Added visibility check for FunctionTemplateDecl.: a_sidorin.
Sep 12 2019, 6:21 AM · Restricted Project, Restricted Project

Sep 6 2019

martong added a comment to D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.

OK
Probably the ClassTemplateSpec can not be handled in liberal way because the AST data structure for template specializations do not allow multiple instances with same argument values?

Sep 6 2019, 10:07 AM · Restricted Project, Restricted Project
martong added inline comments to D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.
Sep 6 2019, 6:41 AM · Restricted Project, Restricted Project
martong committed rL371175: Request commit access for martong.
Request commit access for martong
Sep 6 2019, 12:38 AM

Sep 4 2019

martong updated the diff for D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.
  • Fix wrong file comment
Sep 4 2019, 2:46 AM · Restricted Project, Restricted Project

Aug 30 2019

martong created D66999: [ASTImporter][NFC] Add comments to code where we cannot use HandleNameConflict.
Aug 30 2019, 5:56 AM · Restricted Project
martong added a comment to D66336: [ASTImporter] Add development internals docs.

Ping

Aug 30 2019, 5:54 AM · Restricted Project, Restricted Project
martong added a reviewer for D64480: [ASTImporter] Added visibility context check for TypedefNameDecl.: a_sidorin.
Aug 30 2019, 5:54 AM · Restricted Project, Restricted Project
martong accepted D64480: [ASTImporter] Added visibility context check for TypedefNameDecl..
Aug 30 2019, 5:54 AM · Restricted Project, Restricted Project
martong committed rGe3e83d708ab6: [ASTImporter] Do not look up lambda classes (authored by martong).
[ASTImporter] Do not look up lambda classes
Aug 30 2019, 3:56 AM
martong committed rL370461: [ASTImporter] Do not look up lambda classes.
[ASTImporter] Do not look up lambda classes
Aug 30 2019, 3:56 AM
martong closed D66348: [ASTImporter] Do not look up lambda classes.
Aug 30 2019, 3:56 AM · Restricted Project, Restricted Project
martong accepted D66538: [AST] AST structural equivalence to work internally with pairs..
Aug 30 2019, 3:56 AM · Restricted Project, Restricted Project
martong added a comment to D66538: [AST] AST structural equivalence to work internally with pairs..

@a_sidorin Ping

Aug 30 2019, 3:56 AM · Restricted Project, Restricted Project

Aug 29 2019

martong updated the diff for D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.
  • Fix copy error
Aug 29 2019, 8:50 AM · Restricted Project, Restricted Project
martong created D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.
Aug 29 2019, 8:50 AM · Restricted Project, Restricted Project
martong accepted D66933: [ASTImporter] Propagate errors during import of overridden methods..

LGTM, other than a few comments.

Aug 29 2019, 5:28 AM · Restricted Project, Restricted Project
martong accepted D66866: [ASTImporter] At import of records re-order indirect fields too..

LGTM!

Aug 29 2019, 5:21 AM · Restricted Project, Restricted Project

Aug 28 2019

martong added a comment to D63640: [clang] Improve Serialization/Imporing/Dumping of APValues.

Sorry for the long wait.

Changes:

  • Rebased on current master
  • Duplicated test file so that it runs for both importing
Aug 28 2019, 7:03 AM · Restricted Project
martong added a reviewer for D66866: [ASTImporter] At import of records re-order indirect fields too.: a_sidorin.
Aug 28 2019, 6:39 AM · Restricted Project, Restricted Project
martong added a comment to D66866: [ASTImporter] At import of records re-order indirect fields too..

Looks good, I just have a comment about the matcher.

Aug 28 2019, 6:38 AM · Restricted Project, Restricted Project

Aug 27 2019

martong added a comment to D59692: [ASTImporter] Fix name conflict handling with different strategies.

Jenkins is not green http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/743/
However, the newly failing test is TestTargetCommand.py, which seems to be unrelated.

Aug 27 2019, 6:37 AM · Restricted Project, Restricted Project
martong committed rL370045: [ASTImporter] Fix name conflict handling with different strategies.
[ASTImporter] Fix name conflict handling with different strategies
Aug 27 2019, 5:07 AM
martong committed rGf035b75d8f07: [ASTImporter] Fix name conflict handling with different strategies (authored by martong).
[ASTImporter] Fix name conflict handling with different strategies
Aug 27 2019, 4:58 AM
martong closed D59692: [ASTImporter] Fix name conflict handling with different strategies.
Aug 27 2019, 4:58 AM · Restricted Project, Restricted Project
martong updated the diff for D59692: [ASTImporter] Fix name conflict handling with different strategies.
  • Apply clang-format
Aug 27 2019, 2:55 AM · Restricted Project, Restricted Project
martong updated the diff for D59692: [ASTImporter] Fix name conflict handling with different strategies.
  • Revert changes in VisitFieldDecl and in VisitIndirectFieldDecl
  • Remove test suite ConflictingDeclsWithConservativeStrategy
Aug 27 2019, 2:31 AM · Restricted Project, Restricted Project
martong added inline comments to D59692: [ASTImporter] Fix name conflict handling with different strategies.
Aug 27 2019, 2:31 AM · Restricted Project, Restricted Project
martong added inline comments to D66765: [analyzer] (Urgent!) Add 9.0.0. release notes..
Aug 27 2019, 1:20 AM · Restricted Project, Restricted Project

Aug 26 2019

martong added inline comments to D66336: [ASTImporter] Add development internals docs.
Aug 26 2019, 8:48 AM · Restricted Project, Restricted Project
martong updated the diff for D66336: [ASTImporter] Add development internals docs.
  • Fix typo: getTemplatedDec -> getTemplatedDecl
Aug 26 2019, 8:47 AM · Restricted Project, Restricted Project
martong added a comment to D66538: [AST] AST structural equivalence to work internally with pairs..

There is a third test which could be useful to test whether there is no faulty cache entries there:

+TEST_F(StructuralEquivalenceCacheTest, DISABLED_NonEq) {
...
+}

This is somewhat the same check that is done in the current tests when the NonEquivalentDecls is checked to not contain any pairs of equivalent Decls. (Specially this line:

EXPECT_FALSE(isInNonEqCache(
      findDeclPair<FunctionDecl>(TU, functionDecl(hasName("x")))));

)

Aug 26 2019, 8:44 AM · Restricted Project, Restricted Project
martong added a comment to D59692: [ASTImporter] Fix name conflict handling with different strategies.

@shafik I have updated the patch with ODR handling strategies as per our discusson.

Aug 26 2019, 6:49 AM · Restricted Project, Restricted Project
martong retitled D59692: [ASTImporter] Fix name conflict handling with different strategies from [ASTImporter] Fix name conflict handling to [ASTImporter] Fix name conflict handling with different strategies.
Aug 26 2019, 6:42 AM · Restricted Project, Restricted Project
martong updated the diff for D59692: [ASTImporter] Fix name conflict handling with different strategies.
  • Use resulting Name from HandleNameConflict if set
  • Add ODRHandling strategies
  • Refactor tests, to avoid some code repetition
Aug 26 2019, 6:40 AM · Restricted Project, Restricted Project

Aug 23 2019

martong added a comment to D62131: [ASTImporter] Remove NonEquivalentDecls from ASTImporter.

... it is highly probable that if some pairs were ever non-equivalent they will stay non-equivalent.

Aug 23 2019, 8:19 AM · Restricted Project
martong reclaimed D62131: [ASTImporter] Remove NonEquivalentDecls from ASTImporter.
Aug 23 2019, 8:19 AM · Restricted Project
martong added a reviewer for D66538: [AST] AST structural equivalence to work internally with pairs.: a_sidorin.
Aug 23 2019, 8:12 AM · Restricted Project, Restricted Project
martong abandoned D62131: [ASTImporter] Remove NonEquivalentDecls from ASTImporter.

@a_sidorin Alexei,

Aug 23 2019, 8:11 AM · Restricted Project
martong added a comment to D62131: [ASTImporter] Remove NonEquivalentDecls from ASTImporter.

Example about how to get wrong things into NonEquivalentDecls:
We want to compare class C for structural equivalence in the following codes:

class A {}; class B {int i;}; void x(A *); void y(A *); class C { friend void x(A *); friend void y(A *); };

and

class A {}; class B {int i;}; void x(A *); void y(B *); class C { friend void x(A *); friend void y(B *); };

The result is false for C but the NonEquivalentDecls will contain after the compare a void x(A*)<->void x(A*) pair.

The reason is that during the check we encounter first a A<->B pair (iterating over the friends and friend functions, first y is encountered and a check for A and B follows). The B is recorded as "tentative equivalence" to A. Then we try to check A to A (during check of x) but because there is a "tentative equivalence" with B from A the check returns false (not equivalent). This false result is recorded as a (incorrect) non-equivalence of the two x functions.
I want to replace the DeclsToCheck and TentativeEquivalences with a set of Decl pairs (like the NonEquivalentDecls) so it will be possible to record the same from Decl with multiple to values. (Is there a reason for why there is a NonEquivalentDecls cache but not a EquivalentDecls or simply a cache for result values?)

Aug 23 2019, 7:43 AM · Restricted Project
martong added a comment to D66538: [AST] AST structural equivalence to work internally with pairs..

There is a third test which could be useful to test whether there is no faulty cache entries there:

Aug 23 2019, 7:38 AM · Restricted Project, Restricted Project
martong added a comment to D66538: [AST] AST structural equivalence to work internally with pairs..

I like this patch because it eliminates the need for checking the redeclaration chains.

Aug 23 2019, 4:57 AM · Restricted Project, Restricted Project
martong added a comment to D59692: [ASTImporter] Fix name conflict handling with different strategies.

@shafik Ping

Aug 23 2019, 4:26 AM · Restricted Project, Restricted Project
martong added a comment to D66538: [AST] AST structural equivalence to work internally with pairs..

The link for the diff went off, sorry about that.
Here is the new link which is going to work:
https://github.com/martong/clang/compare/NonEqDecls_cache_in_an_upper_level_0...martong:NonEqDecls_cache_in_an_upper_level?expand=1

Aug 23 2019, 1:52 AM · Restricted Project, Restricted Project

Aug 22 2019

martong added a comment to D66538: [AST] AST structural equivalence to work internally with pairs..

It looks like that the original code is correct in the decision of structural equivalence of the original pair. If we have an (A,B) and (A,C) to compare, B and C are in different decl chain, then (A,B) or (A,C) will be non-equivalent (unless B and C are equivalent, but what to do in this case?). The problem was that the code assumed that in this case always A and B (or A and C) are non-equivalent. If NonEquivalentDecls is not filled in this case (or not used at all) the problem does not exist.

Aug 22 2019, 9:34 AM · Restricted Project, Restricted Project
martong updated the diff for D66336: [ASTImporter] Add development internals docs.
  • Address review comments
Aug 22 2019, 4:04 AM · Restricted Project, Restricted Project
martong added a comment to D66336: [ASTImporter] Add development internals docs.

Thanks for the review!

Aug 22 2019, 4:04 AM · Restricted Project, Restricted Project
martong added inline comments to D66538: [AST] AST structural equivalence to work internally with pairs..
Aug 22 2019, 2:51 AM · Restricted Project, Restricted Project
martong added inline comments to D66538: [AST] AST structural equivalence to work internally with pairs..
Aug 22 2019, 2:43 AM · Restricted Project, Restricted Project

Aug 21 2019

martong added a comment to D66348: [ASTImporter] Do not look up lambda classes.

I am not enthusiastic about this solution but I need to think about it some more.

We can see that p0624r2 added copy assignable lambdas:

bool f1() {
    auto x = []{} = {}; auto x2 = x;

    return x == x2;
}

bool f2() {
    auto x = []{} = {};
    auto xb = []{} = {};

    return x == xb;
}

see godbolt

So I don't think this is a long-term solution, although I don't know what clang is doing to make this work yet.

Aug 21 2019, 5:36 AM · Restricted Project, Restricted Project
martong updated the diff for D66348: [ASTImporter] Do not look up lambda classes.
  • Add tests for default constructible and assignable stateless lambdas
Aug 21 2019, 5:28 AM · Restricted Project, Restricted Project

Aug 16 2019

martong added a comment to D64078: [ASTImporter] Fix structural ineq of lambdas with different sloc.

Hi Gabor,
it is a nice design question if source locations can participate in structural match or not. The comparison tells us that the same code written in different files is not structurally equivalent and I cannot agree with it. They can be not the same, but their structure is the same. The question is: why do we get to this comparison? Do we find a non-equivalent decl by lookup? I guess there can be another way to resolve this issue, and I'll be happy to help if you share what is the problem behind the patch.

Aug 16 2019, 7:17 AM · Restricted Project
martong created D66348: [ASTImporter] Do not look up lambda classes.
Aug 16 2019, 7:17 AM · Restricted Project, Restricted Project
martong added inline comments to D59692: [ASTImporter] Fix name conflict handling with different strategies.
Aug 16 2019, 6:21 AM · Restricted Project, Restricted Project
martong updated the diff for D59692: [ASTImporter] Fix name conflict handling with different strategies.
  • Name -> SearchName
  • Add tests for conflicting declarations
Aug 16 2019, 6:19 AM · Restricted Project, Restricted Project
martong committed rGb9a8ac74f14d: Fix typos in LibASTImporter.rst (authored by martong).
Fix typos in LibASTImporter.rst
Aug 16 2019, 5:22 AM