Page MenuHomePhabricator

balazske (Balázs Kéri)
Engineering

Projects

User does not belong to any projects.

User Details

User Since
May 23 2018, 7:08 AM (252 w, 6 d)

Recent Activity

Yesterday

balazske committed rG1a35893d2a58: [clang][ASTImporter] Import typedefs to distinct records as distinct nodes. (authored by balazske).
[clang][ASTImporter] Import typedefs to distinct records as distinct nodes.
Mon, Mar 27, 9:00 AM · Restricted Project, Restricted Project
balazske closed D145479: [clang][ASTImporter] Import typedefs to distinct records as distinct nodes..
Mon, Mar 27, 9:00 AM · Restricted Project, Restricted Project
balazske retitled D145868: [clang][ASTImporter] Fix import of typedef with unnamed structures from [clang][ASTImporter] Fix import of anonymous structures to [clang][ASTImporter] Fix import of typedef with unnamed structures.
Mon, Mar 27, 6:24 AM · Restricted Project, Restricted Project

Thu, Mar 23

balazske added a comment to D145868: [clang][ASTImporter] Fix import of typedef with unnamed structures.

Hi @balazske , all LIT and unittests pass with this change. By your logic, then we are missing some LIT or unittest cases that support your statement. Can you think of a case that demonstrates this? Thanks!

Thu, Mar 23, 8:44 AM · Restricted Project, Restricted Project

Wed, Mar 15

balazske updated the diff for D145868: [clang][ASTImporter] Fix import of typedef with unnamed structures.

Added a simple test and another test.
Instead of calling getTypeDeclType only the reuse of existing type is done
(this was the part that fixes the problem). In this way the underlying type
is still imported. The result is not correct but fixes some crash.

Wed, Mar 15, 7:21 AM · Restricted Project, Restricted Project

Tue, Mar 14

balazske added a comment to D145868: [clang][ASTImporter] Fix import of typedef with unnamed structures.

The problem is somewhat bigger and not fast to fix. This test shows what is problematic:

TEST_P(ASTImporterOptionSpecificTestBase,
       ImportExistingTypedefToUnnamedRecordPtr) {
  const char *Code =
      R"(
      typedef const struct { int fff; } * const T;
      extern T x;
      )";
  Decl *ToTU = getToTuDecl(Code, Lang_C99);
  Decl *FromTU = getTuDecl(Code, Lang_C99);
Tue, Mar 14, 7:17 AM · Restricted Project, Restricted Project
balazske accepted D145057: [clang][ASTImport] Add support for import of empty records.

There are some unresolved comments in the test (cast is not needed at Import and EXPECT_TRUE can be used) but otherwise LGTM.
(But I have a feeling that problems may happen with attributes like GuardedByAttr if these are imported before the field is added to the record. Probably it is better to only import the NoUniqueAddressAttr in VisitFieldDecl.)

Tue, Mar 14, 3:33 AM · Restricted Project, Restricted Project, Restricted Project

Mon, Mar 13

balazske commandeered D145868: [clang][ASTImporter] Fix import of typedef with unnamed structures.

My opinion is that we can not omit importing the "underlying type". The TypedefType has the type of the declaration (type of getDecl()) and the "underlying type" that may be different (this is the thing that comes from commit D133468). This is exactly different if TypedefType::typeMatchesDecl() (returns a stored value in TypedefDecl) returns true. In this case the type object is stored in the TypedefDecl node and is not the same as the type of declaration getDecl(). If function getTypeDeclType is used it creates the typedef type always with the type of getDecl() and the typeMatchesDecl will always return true for this type even if at the to-be-imported type it was false.

Mon, Mar 13, 4:59 AM · Restricted Project, Restricted Project

Fri, Mar 10

balazske updated the diff for D144003: [clang][analyzer] Improve bug reports of StdLibraryFunctionsChecker..

Change format of bug reports.
Now the problem is shown first, then the acceptable values.
Sometimes the messages can become too verbose (in case of
"should be NULL") or grammatically not totally correct,
I can not tell if this is acceptable but this was the most
simple implementation.

Fri, Mar 10, 9:39 AM · Restricted Project, Restricted Project
balazske added reviewers for D145479: [clang][ASTImporter] Import typedefs to distinct records as distinct nodes.: donat.nagy, gamesh411.
Fri, Mar 10, 12:37 AM · Restricted Project, Restricted Project

Thu, Mar 9

balazske committed rG353155a1a507: [clang][analyzer][NFC] Refactor code of StdLibraryFunctionsChecker. (authored by balazske).
[clang][analyzer][NFC] Refactor code of StdLibraryFunctionsChecker.
Thu, Mar 9, 2:56 AM · Restricted Project, Restricted Project
balazske closed D143751: [clang][analyzer][NFC] Refactor code of StdLibraryFunctionsChecker..
Thu, Mar 9, 2:56 AM · Restricted Project, Restricted Project

Tue, Mar 7

balazske added inline comments to D145057: [clang][ASTImport] Add support for import of empty records.
Tue, Mar 7, 6:41 AM · Restricted Project, Restricted Project, Restricted Project
balazske added inline comments to D145057: [clang][ASTImport] Add support for import of empty records.
Tue, Mar 7, 6:39 AM · Restricted Project, Restricted Project, Restricted Project
balazske requested review of D145479: [clang][ASTImporter] Import typedefs to distinct records as distinct nodes..
Tue, Mar 7, 12:48 AM · Restricted Project, Restricted Project

Mon, Mar 6

balazske committed rG29a4ed80bb4c: [clang][ASTImporter] Add VaList declaration to lookup table. (authored by balazske).
[clang][ASTImporter] Add VaList declaration to lookup table.
Mon, Mar 6, 12:33 AM · Restricted Project, Restricted Project
balazske closed D144273: [clang][ASTImporter] Add VaList declaration to lookup table..
Mon, Mar 6, 12:32 AM · Restricted Project, Restricted Project

Fri, Mar 3

balazske updated the diff for D143751: [clang][analyzer][NFC] Refactor code of StdLibraryFunctionsChecker..

rebase, reformatted code

Fri, Mar 3, 9:06 AM · Restricted Project, Restricted Project
balazske updated the diff for D143751: [clang][analyzer][NFC] Refactor code of StdLibraryFunctionsChecker..

changed comments, small variable rename

Fri, Mar 3, 8:40 AM · Restricted Project, Restricted Project
balazske added a comment to D144273: [clang][ASTImporter] Add VaList declaration to lookup table..

The new test should be better, it imports the f function without new and no VaList should exist in the imported translation unit. It looks like the test.cpp is appended to the AST after the import of the other files. I changed function CreateVaListDecl to always use the AArch64 create function, the test did not fail.

Fri, Mar 3, 3:37 AM · Restricted Project, Restricted Project
balazske updated the diff for D144273: [clang][ASTImporter] Add VaList declaration to lookup table..

Changed the lit test.

Fri, Mar 3, 3:32 AM · Restricted Project, Restricted Project
balazske committed rG27ab138c69fc: [clang][ASTImporter] Import TemplateName correctly (authored by balazske).
[clang][ASTImporter] Import TemplateName correctly
Fri, Mar 3, 12:17 AM · Restricted Project, Restricted Project
balazske closed D144622: [clang][ASTImporter] Import TemplateName correctly.
Fri, Mar 3, 12:17 AM · Restricted Project, Restricted Project

Thu, Mar 2

balazske added inline comments to D145057: [clang][ASTImport] Add support for import of empty records.
Thu, Mar 2, 7:45 AM · Restricted Project, Restricted Project, Restricted Project
balazske added inline comments to D143751: [clang][analyzer][NFC] Refactor code of StdLibraryFunctionsChecker..
Thu, Mar 2, 6:51 AM · Restricted Project, Restricted Project

Wed, Mar 1

balazske updated the diff for D144622: [clang][ASTImporter] Import TemplateName correctly.

Updated the test.

Wed, Mar 1, 8:54 AM · Restricted Project, Restricted Project
balazske added a comment to D144273: [clang][ASTImporter] Add VaList declaration to lookup table..

A tried to find out how to add a correct test but could not check if this fails or not on AArch64 platform. The test should import the va_list declarations and then another variable std. I want to touch ASTContext only if a test failure is found on AArch64 that makes it necessary. In that case I would add a non-modifying function getVaListTagDeclIfExists, another option is to change all other simiar get functions to "getOrCreate" form to have consistent API.

Wed, Mar 1, 8:02 AM · Restricted Project, Restricted Project
balazske updated the diff for D144273: [clang][ASTImporter] Add VaList declaration to lookup table..

Add a test.

Wed, Mar 1, 7:53 AM · Restricted Project, Restricted Project
balazske retitled D144622: [clang][ASTImporter] Import TemplateName correctly from [clang[[ASTImporter] Import TemplateName correctly to [clang][ASTImporter] Import TemplateName correctly.
Wed, Mar 1, 1:44 AM · Restricted Project, Restricted Project
balazske committed rGfeba03340cf3: [clang][ASTImporter] Improve import of InjectedClassNameType. (authored by balazske).
[clang][ASTImporter] Improve import of InjectedClassNameType.
Wed, Mar 1, 12:27 AM · Restricted Project, Restricted Project
balazske closed D140562: [clang][ASTImporter] Improve import of InjectedClassNameType..
Wed, Mar 1, 12:26 AM · Restricted Project, Restricted Project

Tue, Feb 28

balazske updated the summary of D144622: [clang][ASTImporter] Import TemplateName correctly.
Tue, Feb 28, 8:42 AM · Restricted Project, Restricted Project
balazske updated the diff for D144622: [clang][ASTImporter] Import TemplateName correctly.

Added a test case.

Tue, Feb 28, 8:35 AM · Restricted Project, Restricted Project

Mon, Feb 27

balazske added a comment to D144622: [clang][ASTImporter] Import TemplateName correctly.

I think these patches are fix for separate problems and can be applied independently. It is not better if these are moved into one change. The other patch D144273 is not finished (it can get bigger), and a test for this change is needed. I try still to discover what the exact problem is here, then I can add an unit test.

Mon, Feb 27, 1:22 AM · Restricted Project, Restricted Project

Feb 24 2023

balazske added a comment to D144273: [clang][ASTImporter] Add VaList declaration to lookup table..

Probably we can add a new function ASTContext::getVaListTagDeclIfExists that does not create declarations if these do not exist. These new mentioned test cases would probably fail, but with a new non-modifying get function it can work.

Feb 24 2023, 12:43 AM · Restricted Project, Restricted Project

Feb 23 2023

balazske requested review of D144622: [clang][ASTImporter] Import TemplateName correctly.
Feb 23 2023, 12:28 AM · Restricted Project, Restricted Project

Feb 22 2023

balazske added inline comments to D143751: [clang][analyzer][NFC] Refactor code of StdLibraryFunctionsChecker..
Feb 22 2023, 8:25 AM · Restricted Project, Restricted Project

Feb 17 2023

balazske added a reviewer for D144273: [clang][ASTImporter] Add VaList declaration to lookup table.: vabridgers.
Feb 17 2023, 8:44 AM · Restricted Project, Restricted Project
balazske updated the diff for D144273: [clang][ASTImporter] Add VaList declaration to lookup table..

removed a not needed line

Feb 17 2023, 8:41 AM · Restricted Project, Restricted Project
balazske added a comment to D142822: [clang] ASTImporter: Fix importing of va_list types and declarations.

I have created the new patch D144273 that should fix the same AST import problems as this patch, without change of Sema.

Feb 17 2023, 8:36 AM · Restricted Project, Restricted Project, Restricted Project
balazske requested review of D144273: [clang][ASTImporter] Add VaList declaration to lookup table..
Feb 17 2023, 8:31 AM · Restricted Project, Restricted Project
balazske added a comment to D144003: [clang][analyzer] Improve bug reports of StdLibraryFunctionsChecker..

The plan is to bring the checker out of the alpha package, the bug reports should be good enough for that. To modify bug report text generation a new patch would be better, after the current is finished. Maybe all single numbers in all allowed ranges that are 1, 2 (or 3?) long (like the 1,2,4,5,6 in the example) can be collected, this makes report generation more complicated than the current way.

Feb 17 2023, 1:16 AM · Restricted Project, Restricted Project

Feb 16 2023

balazske added a comment to D142822: [clang] ASTImporter: Fix importing of va_list types and declarations.

With this fix the std::__va_list is created at initialization of Sema, previously it was not there. Function CreateAArch64ABIBuiltinVaListDecl (ASTContext.cpp) makes the namespace std and __va_list record. This change fixes the problem with ASTImporter probably because the __va_list record exists before start of AST import, this way it is found and added to ASTImporterLookupTable at initialization (the original problem was caused because std::__va_list is missing from ASTImporterLookupTable). But I was thinking of other ways to fix the problem. My old fix for the problem may still work without any test failures:

ASTImporterLookupTable do not contain an entry for __va_list_tag, I do not know why it is missing. If it is added "manually" the crash disappears (without fix in VisitTypedefType). Following code was used to add VaListTagDecl:

ASTImporterLookupTable::ASTImporterLookupTable(TranslationUnitDecl &TU) {
  Builder B(*this);
  B.TraverseDecl(&TU);
  // Add __va_list_tag to the table, it is not visited by the builder.
  if (NamedDecl *D = dyn_cast_or_null<NamedDecl>(TU.getASTContext().getVaListTagDecl()))
    add(&TU, D);
}

The problem probably existed before but did not have visible effect until the new assertion was added.

It can happen (without any of the new fixes) that std::__va_list is created during the AST import process, it is created at first access. This can be the reason why it is missing from the lookup table: It is created implicitly by ASTContext code in the "to" context during import. To fix this problem, I think the above quoted code is a good solution: The va_list declaration is created at start of AST import (if it did not exist yet) (by the get function) and added to the lookup table. Probably it can be a problem that the va_list declaration and std namespace appears in a TU by just importing any code into it, but probably no tests will fail for this case. Another way to fix the problem is to add special handling of std::__va_list at least on the affected platforms to ASTImporterLookupTable but I did not check of this can be done. I do not like to change function ASTImporter::VisitTypedefType like in the very first fix of @vabridgers because it affects how every typedef is imported, and that can be incorrect. Probably some special handling of a record called __va_list at AST import can be a good fix too.

Feb 16 2023, 9:16 AM · Restricted Project, Restricted Project, Restricted Project

Feb 15 2023

balazske added a comment to D142822: [clang] ASTImporter: Fix importing of va_list types and declarations.

But there should be a way to make the namespace "invisible" like it is done with std::bad_alloc, the linked commit seems to contain the code to "hide" the first std definition and this may not work any more. Another question is why this architecture has a probably not standard requirement. This may be a question for the discourse forum to reach the developers that can make a working fix.

Feb 15 2023, 7:35 AM · Restricted Project, Restricted Project, Restricted Project
balazske updated the diff for D138777: [clang-tidy] Add check bugprone-multiple-new-in-one-expression..

make check available in all C++ versions, add compound operator related test and code

Feb 15 2023, 5:58 AM · Restricted Project, Restricted Project
balazske committed rGddc5d40dd285: [clang][analyzer] Make messages of StdCLibraryFunctionsChecker user-friendly (authored by balazske).
[clang][analyzer] Make messages of StdCLibraryFunctionsChecker user-friendly
Feb 15 2023, 12:23 AM · Restricted Project, Restricted Project
balazske closed D143194: [clang][analyzer] Make messages of StdCLibraryFunctionsChecker user-friendly.
Feb 15 2023, 12:23 AM · Restricted Project, Restricted Project

Feb 14 2023

balazske requested review of D144003: [clang][analyzer] Improve bug reports of StdLibraryFunctionsChecker..
Feb 14 2023, 6:21 AM · Restricted Project, Restricted Project

Feb 13 2023

balazske updated the diff for D143751: [clang][analyzer][NFC] Refactor code of StdLibraryFunctionsChecker..

removed "IsLast"

Feb 13 2023, 3:53 AM · Restricted Project, Restricted Project
balazske updated the diff for D143751: [clang][analyzer][NFC] Refactor code of StdLibraryFunctionsChecker..

small problem fix

Feb 13 2023, 2:11 AM · Restricted Project, Restricted Project

Feb 10 2023

balazske requested review of D143751: [clang][analyzer][NFC] Refactor code of StdLibraryFunctionsChecker..
Feb 10 2023, 9:01 AM · Restricted Project, Restricted Project
balazske added inline comments to D143194: [clang][analyzer] Make messages of StdCLibraryFunctionsChecker user-friendly.
Feb 10 2023, 7:56 AM · Restricted Project, Restricted Project
balazske added a comment to D143194: [clang][analyzer] Make messages of StdCLibraryFunctionsChecker user-friendly.

I changed the text descriptions to relational operators at some places, this is similar to how other clang analyzer messages look (for example notes at if statements), it is shorter, and probably more faster to understand ("<= 0" instead of "non-positive").

Feb 10 2023, 7:53 AM · Restricted Project, Restricted Project
balazske updated the diff for D143194: [clang][analyzer] Make messages of StdCLibraryFunctionsChecker user-friendly.

fixed another comment format problem

Feb 10 2023, 7:50 AM · Restricted Project, Restricted Project
balazske updated the diff for D143194: [clang][analyzer] Make messages of StdCLibraryFunctionsChecker user-friendly.

fixed another comment format problem

Feb 10 2023, 7:48 AM · Restricted Project, Restricted Project
balazske updated the diff for D143194: [clang][analyzer] Make messages of StdCLibraryFunctionsChecker user-friendly.

change of range descriptions, align comments

Feb 10 2023, 7:45 AM · Restricted Project, Restricted Project

Feb 8 2023

balazske added a comment to D143194: [clang][analyzer] Make messages of StdCLibraryFunctionsChecker user-friendly.

Probably it is not always useful to explain why the argument is wrong. In cases when we can find out that the value is exactly between two consecutive valid ranges we can display a note, or when the exact value is known. Otherwise it may end up in something like "the value should be between 1 and 4 or between 6 and 10, but it is less than 1 or exactly 5 or greater than 10". The "good" cases are (when more information is available): "the value is less than 1", "the value is 5", "the value is greater than 10". If two bad ranges are known it may be OK too: "the value is less than 1 or it is exactly 5". The explanation may be possible to implement by test assumes for the negated ranges.

Feb 8 2023, 3:02 AM · Restricted Project, Restricted Project

Feb 7 2023

balazske added inline comments to D143347: [lldb][DWARF] Infer no_unique_address attribute.
Feb 7 2023, 3:49 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project

Feb 6 2023

balazske updated the diff for D143194: [clang][analyzer] Make messages of StdCLibraryFunctionsChecker user-friendly.

Replaced "of function" with "to" in checker messages.

Feb 6 2023, 2:08 AM · Restricted Project, Restricted Project

Feb 3 2023

balazske added a comment to D142822: [clang] ASTImporter: Fix importing of va_list types and declarations.

I looked at some of the failing tests but can not decide how to fix the problems. The problem seems to be with the extra namespace std that was not there before. I do not know what the tests are exactly testing. A part of the tests can be fixed by adding new expect lines but these must be platform specific.

Feb 3 2023, 8:37 AM · Restricted Project, Restricted Project, Restricted Project
balazske added a comment to D143194: [clang][analyzer] Make messages of StdCLibraryFunctionsChecker user-friendly.

I had the plan to add a note that tells the value that is out of range. In the most simple case it can work if we have a fixed value. But this may be the most obvious from the code too. Otherwise a new function can be added that can print the assumed constraint ranges.

Feb 3 2023, 6:16 AM · Restricted Project, Restricted Project

Feb 2 2023

balazske requested review of D143194: [clang][analyzer] Make messages of StdCLibraryFunctionsChecker user-friendly.
Feb 2 2023, 8:34 AM · Restricted Project, Restricted Project

Jan 30 2023

balazske committed rGe31ee6417c33: [clang][ASTImporter] Handle UsingType in friend declarations. (authored by balazske).
[clang][ASTImporter] Handle UsingType in friend declarations.
Jan 30 2023, 1:07 AM · Restricted Project, Restricted Project
balazske closed D142607: [clang][ASTImporter] Handle UsingType in friend declarations..
Jan 30 2023, 1:06 AM · Restricted Project, Restricted Project

Jan 27 2023

balazske added a comment to D136886: [clang] ASTImporter: Fix importing of va_list types and declarations.

I have a fix for the AArch64 problems in test ImportCorrectTemplatedDecl, dcl-58-cpp, and the "Declaration not emitted!" assertion. I can not find at which tests the error: reference to 'std' is ambiguous appears. Probably the AArch64 (and Arm) tests could be run again with the current fixes applied.

Jan 27 2023, 8:51 AM · Restricted Project, Restricted Project, Restricted Project
balazske added a comment to D136886: [clang] ASTImporter: Fix importing of va_list types and declarations.

I am not an expert in the frontend or ASTContext area, but I think that if a builtin declaration is created (ASTContext::getBuiltinVaListDecl) the identifier name for it should not be loaded from an external source (in function IdentifierTable::get). This load of identifier causes it to be get from ASTReader which in turn gets va_list it again from ASTContext because this is a predefined declaration. In this way 2 instances of va_list are added to the AST. The following call chain shows the problem (first create of va_list happens when Sema is initialized, second create happens when the __va_list is loaded by ASTReader as result of the first attempt to create it):

#0  clang::RecordDecl::RecordDecl (this=0x7fffd407a1c8, DK=clang::Decl::Record, TK=clang::TTK_Struct, C=..., DC=0x7fffd4041ec0, StartLoc=..., IdLoc=..., Id=0x7fffd407abb8, PrevDecl=0x0) at /local/clang/llvm2/llvm-project/clang/lib/AST/Decl.cpp:4700
#1  0x00007ffff4f26568 in clang::RecordDecl::Create (C=..., TK=clang::TTK_Struct, DC=0x7fffd4041ec0, StartLoc=..., IdLoc=..., Id=0x7fffd407abb8, PrevDecl=0x0) at /local/clang/llvm2/llvm-project/clang/lib/AST/Decl.cpp:4720
#2  0x00007ffff4ac92f6 in clang::ASTContext::buildImplicitRecord (this=0x7fffd402b110, Name=..., TK=clang::TTK_Struct) at /local/clang/llvm2/llvm-project/clang/lib/AST/ASTContext.cpp:1216
#3  0x00007ffff4b0a8e3 in CreateAArch64ABIBuiltinVaListDecl (Context=0x7fffd402b110) at /local/clang/llvm2/llvm-project/clang/lib/AST/ASTContext.cpp:8757
#4  0x00007ffff4af4be6 in CreateVaListDecl (Context=0x7fffd402b110, Kind=clang::TargetInfo::AArch64ABIBuiltinVaList) at /local/clang/llvm2/llvm-project/clang/lib/AST/ASTContext.cpp:9097
#5  0x00007ffff4af4b14 in clang::ASTContext::getBuiltinVaListDecl (this=0x7fffd402b110) at /local/clang/llvm2/llvm-project/clang/lib/AST/ASTContext.cpp:9117
#6  0x00007ffff4af4cab in clang::ASTContext::getVaListTagDecl (this=0x7fffd402b110) at /local/clang/llvm2/llvm-project/clang/lib/AST/ASTContext.cpp:9128
#7  0x00007ffff58b4461 in getPredefinedDecl (Context=..., ID=clang::serialization::PREDEF_DECL_VA_LIST_TAG) at /local/clang/llvm2/llvm-project/clang/lib/Serialization/ASTReader.cpp:7496
#8  0x00007ffff58a38e5 in clang::ASTReader::GetExistingDecl (this=0x7fffd40436e0, ID=10) at /local/clang/llvm2/llvm-project/clang/lib/Serialization/ASTReader.cpp:7525
#9  0x00007ffff58acabd in clang::ASTReader::GetDecl (this=0x7fffd40436e0, ID=10) at /local/clang/llvm2/llvm-project/clang/lib/Serialization/ASTReader.cpp:7549
#10 0x00007ffff5887f51 in clang::ASTReader::SetGloballyVisibleDecls (this=0x7fffd40436e0, II=0x7fffd407abb8, DeclIDs=..., Decls=0x7fffd4079198) at /local/clang/llvm2/llvm-project/clang/lib/Serialization/ASTReader.cpp:8596
#11 0x00007ffff58bafb5 in clang::ASTReader::finishPendingActions (this=0x7fffd40436e0) at /local/clang/llvm2/llvm-project/clang/lib/Serialization/ASTReader.cpp:9276
#12 0x00007ffff58be073 in clang::ASTReader::FinishedDeserializing (this=0x7fffd40436e0) at /local/clang/llvm2/llvm-project/clang/lib/Serialization/ASTReader.cpp:9783
#13 0x00007ffff58d093f in clang::ExternalASTSource::Deserializing::~Deserializing (this=0x7fffe2c990b0) at /local/clang/llvm2/llvm-project/clang/include/clang/AST/ExternalASTSource.h:86
#14 0x00007ffff58b7427 in clang::ASTReader::get (this=0x7fffd40436e0, Name=...) at /local/clang/llvm2/llvm-project/clang/lib/Serialization/ASTReader.cpp:8126
#15 0x00007ffff4b18c4b in clang::IdentifierTable::get (this=0x7fffd401b720, Name=...) at /local/clang/llvm2/llvm-project/clang/include/clang/Basic/IdentifierTable.h:605
#16 0x00007ffff4ac92bd in clang::ASTContext::buildImplicitRecord (this=0x7fffd402b110, Name=..., TK=clang::TTK_Struct) at /local/clang/llvm2/llvm-project/clang/lib/AST/ASTContext.cpp:1217
#17 0x00007ffff4b0a8e3 in CreateAArch64ABIBuiltinVaListDecl (Context=0x7fffd402b110) at /local/clang/llvm2/llvm-project/clang/lib/AST/ASTContext.cpp:8757
#18 0x00007ffff4af4be6 in CreateVaListDecl (Context=0x7fffd402b110, Kind=clang::TargetInfo::AArch64ABIBuiltinVaList) at /local/clang/llvm2/llvm-project/clang/lib/AST/ASTContext.cpp:9097
#19 0x00007ffff4af4b14 in clang::ASTContext::getBuiltinVaListDecl (this=0x7fffd402b110) at /local/clang/llvm2/llvm-project/clang/lib/AST/ASTContext.cpp:9117
#20 0x00007ffff4af4cab in clang::ASTContext::getVaListTagDecl (this=0x7fffd402b110) at /local/clang/llvm2/llvm-project/clang/lib/AST/ASTContext.cpp:9128
#21 0x00007fffee43a586 in clang::Sema::Initialize (this=0x7fffd406a7e0) at /local/clang/llvm2/llvm-project/clang/lib/Sema/Sema.cpp:453
#22 0x00007fffe773b432 in clang::Parser::Initialize (this=0x7fffd40753c0) at /local/clang/llvm2/llvm-project/clang/lib/Parse/Parser.cpp:562
#23 0x00007fffe75d3fd4 in clang::ParseAST (S=..., PrintStats=false, SkipFunctionBodies=false) at /local/clang/llvm2/llvm-project/clang/lib/Parse/ParseAST.cpp:155
#24 0x00007ffff6169622 in clang::ASTFrontendAction::ExecuteAction (this=0x7fffd4014c70) at /local/clang/llvm2/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1162
#25 0x00007ffff6168fe8 in clang::FrontendAction::Execute (this=0x7fffd4014c70) at /local/clang/llvm2/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1055
#26 0x00007ffff60093fc in clang::ASTUnit::Parse (this=0x7fffd40118a0, PCHContainerOps=std::shared_ptr<clang::PCHContainerOperations> (empty) = {...}, OverrideMainBuffer=std::unique_ptr<llvm::MemoryBuffer> = {...}, VFS=...)
    at /local/clang/llvm2/llvm-project/clang/lib/Frontend/ASTUnit.cpp:1237
#27 0x00007ffff600cf5f in clang::ASTUnit::LoadFromCompilerInvocation (this=0x7fffd40118a0, PCHContainerOps=std::shared_ptr<clang::PCHContainerOperations> (empty) = {...}, PrecompilePreambleAfterNParses=2, VFS=...)
    at /local/clang/llvm2/llvm-project/clang/lib/Frontend/ASTUnit.cpp:1696
#28 0x00007ffff600dfc0 in clang::ASTUnit::LoadFromCommandLine (ArgBegin=0x7fffd4003440, ArgEnd=0x7fffd40034c0, PCHContainerOps=std::shared_ptr<clang::PCHContainerOperations> (empty) = {...}, Diags=..., ResourceFilesPath=..., OnlyLocalDecls=true,
    CaptureDiagnostics=clang::CaptureDiagsKind::All, RemappedFiles=..., RemappedFilesKeepOriginalName=true, PrecompilePreambleAfterNParses=2, TUKind=clang::TU_Complete, CacheCodeCompletionResults=false, IncludeBriefCommentsInCodeCompletion=false,
    AllowPCHWithCompilerErrors=true, SkipFunctionBodies=clang::SkipFunctionBodiesScope::None, SingleFileParse=false, UserFilesAreVolatile=true, ForSerialization=false, RetainExcludedConditionalBlocks=false, ModuleFormat=std::optional<llvm::StringRef> = {...},
    ErrAST=0x7fffe2c9ba20, VFS=...) at /local/clang/llvm2/llvm-project/clang/lib/Frontend/ASTUnit.cpp:1820
#29 0x00007ffff79ed60c in clang_parseTranslationUnit_Impl (CIdx=0x7fffdc0151f0, source_filename=0x7fffffffe797 "-error-on-deserialized-decl=TopVar", command_line_args=0x7fffdc015520, num_command_line_args=11, unsaved_files=..., options=5, out_TU=0x7fffe349cc38)
    at /local/clang/llvm2/llvm-project/clang/tools/libclang/CIndex.cpp:3890
#30 0x00007ffff79ecbef in clang_parseTranslationUnit2FullArgv::$_1::operator() (this=0x7fffe349c9b8) at /local/clang/llvm2/llvm-project/clang/tools/libclang/CIndex.cpp:3973
#31 0x00007ffff79ecb45 in llvm::function_ref<void ()>::callback_fn<clang_parseTranslationUnit2FullArgv::$_1>(long) (callable=140737006651832) at /local/clang/llvm2/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45
#32 0x00007ffff359b119 in llvm::function_ref<void ()>::operator()() const (this=0x7fffe2c9bcf8) at /local/clang/llvm2/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68
#33 0x00007ffff35af7c4 in llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (this=0x7fffe349c9a0, Fn=...) at /local/clang/llvm2/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:426
#34 0x00007ffff35afbcf in RunSafelyOnThread_Dispatch (UserData=0x7fffe349c8a0) at /local/clang/llvm2/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:507
#35 0x00007ffff35b0469 in _ZZN4llvm6thread18GenericThreadProxyISt5tupleIJPFvPvEPN12_GLOBAL__N_121RunSafelyOnThreadInfoEEEEEvS3_ENKUlOT_DpOT0_E_clIRS5_JRS8_EEEDaSB_SE_ (this=0x7fffe2c9be78, F=@0x7fffdc015588: 0x7ffff35afb80 <RunSafelyOnThread_Dispatch(void*)>,
    Args=@0x7fffdc015580: 0x7fffe349c8a0) at /local/clang/llvm2/llvm-project/llvm/include/llvm/Support/thread.h:43
#36 0x00007ffff35b0417 in _ZSt13__invoke_implIvZN4llvm6thread18GenericThreadProxyISt5tupleIJPFvPvEPN12_GLOBAL__N_121RunSafelyOnThreadInfoEEEEEvS4_EUlOT_DpOT0_E_JRS6_RS9_EESB_St14__invoke_otherOT0_DpOT1_ (__f=..., __args=@0x7fffdc015580: 0x7fffe349c8a0,
    __args=@0x7fffdc015580: 0x7fffe349c8a0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/invoke.h:60
#37 0x00007ffff35b0387 in _ZSt8__invokeIZN4llvm6thread18GenericThreadProxyISt5tupleIJPFvPvEPN12_GLOBAL__N_121RunSafelyOnThreadInfoEEEEEvS4_EUlOT_DpOT0_E_JRS6_RS9_EENSt15__invoke_resultISB_JDpSD_EE4typeESC_SF_ (__fn=..., __args=@0x7fffdc015580: 0x7fffe349c8a0,
    __args=@0x7fffdc015580: 0x7fffe349c8a0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/invoke.h:95
#38 0x00007ffff35b0313 in _ZSt12__apply_implIZN4llvm6thread18GenericThreadProxyISt5tupleIJPFvPvEPN12_GLOBAL__N_121RunSafelyOnThreadInfoEEEEEvS4_EUlOT_DpOT0_E_RSA_JLm0ELm1EEEDcSC_OT0_St16integer_sequenceImJXspT1_EEE (__f=..., __t=std::tuple containing = {...})
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/tuple:1662
#39 0x00007ffff35b0292 in _ZSt5applyIZN4llvm6thread18GenericThreadProxyISt5tupleIJPFvPvEPN12_GLOBAL__N_121RunSafelyOnThreadInfoEEEEEvS4_EUlOT_DpOT0_E_RSA_EDcSC_OT0_ (__f=..., __t=std::tuple containing = {...})
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/tuple:1671
#40 0x00007ffff35b0251 in llvm::thread::GenericThreadProxy<std::tuple<void (*)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*> > (Ptr=0x7fffdc015580) at /local/clang/llvm2/llvm-project/llvm/include/llvm/Support/thread.h:41
#41 0x00007ffff35afee5 in llvm::thread::ThreadProxy<std::tuple<void (*)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*> > (Ptr=0x7fffdc015580) at /local/clang/llvm2/llvm-project/llvm/include/llvm/Support/thread.h:55
#42 0x00007ffff7bbb6db in start_thread (arg=0x7fffe2c9c700) at pthread_create.c:463
#43 0x00007ffff26e261f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Jan 27 2023, 3:32 AM · Restricted Project, Restricted Project, Restricted Project

Jan 26 2023

balazske added a comment to D136886: [clang] ASTImporter: Fix importing of va_list types and declarations.

The "Declaration not emitted" crash is reproducible by change of file "test/Index/targeted-cursor.c", the similar lines should be replaced to this (only the target aarch64 is added):

// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \
// RUN:   c-index-test -cursor-at=%s:5:10 %s -target aarch64 -include %t.h \
// RUN:    -Xclang -error-on-deserialized-decl=PreambleVar  \
// RUN:    -Xclang -error-on-deserialized-decl=NestedVar1  \
// RUN:    -Xclang -error-on-deserialized-decl=TopVar  \
// RUN:  | FileCheck %s -check-prefix=LOCAL-CURSOR1

The other "run" lines in the file can be removed to simplify the test. The run lines that are above these lines are not producing crash.

Jan 26 2023, 11:53 PM · Restricted Project, Restricted Project, Restricted Project
balazske added a comment to D136886: [clang] ASTImporter: Fix importing of va_list types and declarations.

In my previous comments I indicated how to fix the problem in the lang-tidy check, and I could reproduce the crash in ImportCorrectTemplatedDecl and have the fix for it. I can reproduce the assertion "Declaration not emitted!" but did not found the fix, the AST contains 2 unlinked instances of struct va_list definition in this case for unknown reason (I think there should be one of these declarations).

Jan 26 2023, 11:32 PM · Restricted Project, Restricted Project, Restricted Project
balazske added a comment to D136886: [clang] ASTImporter: Fix importing of va_list types and declarations.

At least a part of the failures is reproducible with -target aarch64 option. I try to fix the failures.

Jan 26 2023, 4:08 AM · Restricted Project, Restricted Project, Restricted Project
balazske added a comment to D142607: [clang][ASTImporter] Handle UsingType in friend declarations..

The test causes this assert if the fix is not applied:

Unhandled type of friend class
UNREACHABLE executed at /local/clang/llvm2/llvm-project/clang/lib/AST/ASTImporterLookupTable.cpp:71!
 #0 0x00007f4380b90e0a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /local/clang/llvm2/llvm-project/llvm/lib/Support/Unix/Signals.inc:567:11
 #1 0x00007f4380b90fdb PrintStackTraceSignalHandler(void*) /local/clang/llvm2/llvm-project/llvm/lib/Support/Unix/Signals.inc:641:1
 #2 0x00007f4380b8f58b llvm::sys::RunSignalHandlers() /local/clang/llvm2/llvm-project/llvm/lib/Support/Signals.cpp:103:5
 #3 0x00007f4380b91751 SignalHandler(int) /local/clang/llvm2/llvm-project/llvm/lib/Support/Unix/Signals.inc:412:1
 #4 0x00007f43840b1980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
 #5 0x00007f437fa40e87 raise /build/glibc-CVJwZb/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #6 0x00007f437fa427f1 abort /build/glibc-CVJwZb/glibc-2.27/stdlib/abort.c:81:0
 #7 0x00007f4380a132c4 /local/clang/llvm2/llvm-project/llvm/lib/Support/ErrorHandling.cpp:212:3
 #8 0x00007f438265cc05 clang::(anonymous namespace)::Builder::VisitFriendDecl(clang::FriendDecl*) /local/clang/llvm2/llvm-project/clang/lib/AST/ASTImporterLookupTable.cpp:0:11
 #9 0x00007f438265ca40 clang::RecursiveASTVisitor<clang::(anonymous namespace)::Builder>::WalkUpFromFriendDecl(clang::FriendDecl*) /local/clang/llvm2/build/Debug/tools/clang/include/clang/AST/DeclNodes.inc:71:1
#10 0x00007f43825e2505 clang::RecursiveASTVisitor<clang::(anonymous namespace)::Builder>::TraverseFriendDecl(clang::FriendDecl*) /local/clang/llvm2/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1550:1
#11 0x00007f43825dfa49 clang::RecursiveASTVisitor<clang::(anonymous namespace)::Builder>::TraverseDecl(clang::Decl*) /local/clang/llvm2/build/Debug/tools/clang/include/clang/AST/DeclNodes.inc:71:1
#12 0x00007f4382648488 clang::RecursiveASTVisitor<clang::(anonymous namespace)::Builder>::TraverseDeclContextHelper(clang::DeclContext*) /local/clang/llvm2/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1489:7
#13 0x00007f43825e7038 clang::RecursiveASTVisitor<clang::(anonymous namespace)::Builder>::TraverseCXXRecordDecl(clang::CXXRecordDecl*) /local/clang/llvm2/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:2015:1
#14 0x00007f43825dff7f clang::RecursiveASTVisitor<clang::(anonymous namespace)::Builder>::TraverseDecl(clang::Decl*) /local/clang/llvm2/build/Debug/tools/clang/include/clang/AST/DeclNodes.inc:295:1
#15 0x00007f4382648488 clang::RecursiveASTVisitor<clang::(anonymous namespace)::Builder>::TraverseDeclContextHelper(clang::DeclContext*) /local/clang/llvm2/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1489:7
#16 0x00007f43825ee041 clang::RecursiveASTVisitor<clang::(anonymous namespace)::Builder>::TraverseTranslationUnitDecl(clang::TranslationUnitDecl*) /local/clang/llvm2/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1599:1
#17 0x00007f43825e084d clang::RecursiveASTVisitor<clang::(anonymous namespace)::Builder>::TraverseDecl(clang::Decl*) /local/clang/llvm2/build/Debug/tools/clang/include/clang/AST/DeclNodes.inc:645:1
#18 0x00007f43825df7d4 clang::ASTImporterLookupTable::ASTImporterLookupTable(clang::TranslationUnitDecl&) /local/clang/llvm2/llvm-project/clang/lib/AST/ASTImporterLookupTable.cpp:88:1
#19 0x0000000000655a44 std::_MakeUniq<clang::ASTImporterLookupTable>::__single_object std::make_unique<clang::ASTImporterLookupTable, clang::TranslationUnitDecl&>(clang::TranslationUnitDecl&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/unique_ptr.h:821:34
#20 0x0000000000655933 clang::ASTImporterSharedState::ASTImporterSharedState(clang::TranslationUnitDecl&) /local/clang/llvm2/llvm-project/clang/include/clang/AST/ASTImporterSharedState.h:52:19
#21 0x00000000006558d1 void __gnu_cxx::new_allocator<clang::ASTImporterSharedState>::construct<clang::ASTImporterSharedState, clang::TranslationUnitDecl&>(clang::ASTImporterSharedState*, clang::TranslationUnitDecl&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/ext/new_allocator.h:136:60
#22 0x00000000006555ed void std::allocator_traits<std::allocator<clang::ASTImporterSharedState>>::construct<clang::ASTImporterSharedState, clang::TranslationUnitDecl&>(std::allocator<clang::ASTImporterSharedState>&, clang::ASTImporterSharedState*, clang::TranslationUnitDecl&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/alloc_traits.h:475:56
#23 0x000000000065544b std::__shared_ptr<clang::ASTImporterSharedState, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<clang::ASTImporterSharedState>, clang::TranslationUnitDecl&>(std::_Sp_make_shared_tag, std::allocator<clang::ASTImporterSharedState> const&, clang::TranslationUnitDecl&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:1327:4
#24 0x00000000006553ad std::shared_ptr<clang::ASTImporterSharedState>::shared_ptr<std::allocator<clang::ASTImporterSharedState>, clang::TranslationUnitDecl&>(std::_Sp_make_shared_tag, std::allocator<clang::ASTImporterSharedState> const&, clang::TranslationUnitDecl&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr.h:345:4
#25 0x0000000000655316 std::shared_ptr<clang::ASTImporterSharedState> std::allocate_shared<clang::ASTImporterSharedState, std::allocator<clang::ASTImporterSharedState>, clang::TranslationUnitDecl&>(std::allocator<clang::ASTImporterSharedState> const&, clang::TranslationUnitDecl&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr.h:690:14
#26 0x000000000064e6f3 std::shared_ptr<clang::ASTImporterSharedState> std::make_shared<clang::ASTImporterSharedState, clang::TranslationUnitDecl&>(clang::TranslationUnitDecl&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr.h:706:7
#27 0x000000000064bd3e clang::ast_matchers::ASTImporterTestBase::lazyInitSharedState(clang::TranslationUnitDecl*) /local/clang/llvm2/llvm-project/clang/unittests/AST/ASTImporterFixtures.cpp:113:22
#28 0x000000000064bf9f clang::ast_matchers::ASTImporterTestBase::lazyInitToAST(clang::TestLanguage, llvm::StringRef, llvm::StringRef) /local/clang/llvm2/llvm-project/clang/unittests/AST/ASTImporterFixtures.cpp:128:1
#29 0x000000000064c77e clang::ast_matchers::ASTImporterTestBase::getToTuDecl(llvm::StringRef, clang::TestLanguage) /local/clang/llvm2/llvm-project/clang/unittests/AST/ASTImporterFixtures.cpp:191:3
#30 0x00000000006a5a13 clang::ast_matchers::ASTImporterLookupTableTest_LookupFindsFriendClassDeclWithUsingTypeDoesNotAssert_Test::TestBody() /local/clang/llvm2/llvm-project/clang/unittests/AST/ASTImporterTest.cpp:5165:24
#31 0x00007f4380c959c4 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /local/clang/llvm2/llvm-project/third-party/unittest/googletest/src/gtest.cc:2433:3
#32 0x00007f4380c7b132 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /local/clang/llvm2/llvm-project/third-party/unittest/googletest/src/gtest.cc:2488:5
#33 0x00007f4380c63173 testing::Test::Run() /local/clang/llvm2/llvm-project/third-party/unittest/googletest/src/gtest.cc:2515:3
#34 0x00007f4380c63a4d testing::TestInfo::Run() /local/clang/llvm2/llvm-project/third-party/unittest/googletest/src/gtest.cc:2687:12
#35 0x00007f4380c6401c testing::TestSuite::Run() /local/clang/llvm2/llvm-project/third-party/unittest/googletest/src/gtest.cc:2815:44
#36 0x00007f4380c6cde1 testing::internal::UnitTestImpl::RunAllTests() /local/clang/llvm2/llvm-project/third-party/unittest/googletest/src/gtest.cc:5337:24
#37 0x00007f4380c991e4 bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /local/clang/llvm2/llvm-project/third-party/unittest/googletest/src/gtest.cc:2433:3
#38 0x00007f4380c7d472 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /local/clang/llvm2/llvm-project/third-party/unittest/googletest/src/gtest.cc:2488:5
#39 0x00007f4380c6c9aa testing::UnitTest::Run() /local/clang/llvm2/llvm-project/third-party/unittest/googletest/src/gtest.cc:4925:10
#40 0x00007f43844c4d01 RUN_ALL_TESTS() /local/clang/llvm2/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:2472:3
#41 0x00007f43844c4c40 main /local/clang/llvm2/llvm-project/third-party/unittest/UnitTestMain/TestMain.cpp:55:3
#42 0x00007f437fa23c87 __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:344:0
#43 0x00000000005ee18a _start (./tools/clang/unittests/AST/ASTTests+0x5ee18a)
Jan 26 2023, 1:12 AM · Restricted Project, Restricted Project
balazske added reviewers for D142607: [clang][ASTImporter] Handle UsingType in friend declarations.: gamesh411, donat.nagy, Szelethus.
Jan 26 2023, 1:04 AM · Restricted Project, Restricted Project
balazske requested review of D142607: [clang][ASTImporter] Handle UsingType in friend declarations..
Jan 26 2023, 12:59 AM · Restricted Project, Restricted Project

Jan 25 2023

balazske updated the diff for D140562: [clang][ASTImporter] Improve import of InjectedClassNameType..

New patch after more thorough debugging.

Jan 25 2023, 7:37 AM · Restricted Project, Restricted Project

Jan 22 2023

balazske planned changes to D140562: [clang][ASTImporter] Improve import of InjectedClassNameType..

I plan to improve the fix and change the code.

Jan 22 2023, 11:29 PM · Restricted Project, Restricted Project

Jan 9 2023

balazske committed rG570bf972f5ad: [clang][analyzer] Remove report of null stream from StreamChecker. (authored by balazske).
[clang][analyzer] Remove report of null stream from StreamChecker.
Jan 9 2023, 12:50 AM · Restricted Project, Restricted Project
balazske closed D137790: [clang][analyzer] Remove report of null stream from StreamChecker..
Jan 9 2023, 12:49 AM · Restricted Project, Restricted Project

Jan 6 2023

balazske committed rG5cf85323a078: [clang][analyzer] Extend StreamChecker with some new functions. (authored by balazske).
[clang][analyzer] Extend StreamChecker with some new functions.
Jan 6 2023, 3:23 AM · Restricted Project, Restricted Project
balazske closed D140395: [clang][analyzer] Extend StreamChecker with some new functions..
Jan 6 2023, 3:23 AM · Restricted Project, Restricted Project
balazske committed rG3c7fe7d09da1: [clang][analyzer] Add stream related functions to StdLibraryFunctionsChecker. (authored by balazske).
[clang][analyzer] Add stream related functions to StdLibraryFunctionsChecker.
Jan 6 2023, 2:05 AM · Restricted Project, Restricted Project
balazske closed D140387: [clang][analyzer] Add stream related functions to StdLibraryFunctionsChecker..
Jan 6 2023, 2:05 AM · Restricted Project, Restricted Project

Jan 5 2023

balazske updated the diff for D140387: [clang][analyzer] Add stream related functions to StdLibraryFunctionsChecker..

Adding test for summary case, change of comment.

Jan 5 2023, 7:03 AM · Restricted Project, Restricted Project

Jan 4 2023

balazske added inline comments to D137790: [clang][analyzer] Remove report of null stream from StreamChecker..
Jan 4 2023, 7:40 AM · Restricted Project, Restricted Project
balazske added inline comments to D140387: [clang][analyzer] Add stream related functions to StdLibraryFunctionsChecker..
Jan 4 2023, 7:21 AM · Restricted Project, Restricted Project
balazske updated the diff for D140387: [clang][analyzer] Add stream related functions to StdLibraryFunctionsChecker..

Removed class NotZeroConstraint.

Jan 4 2023, 6:01 AM · Restricted Project, Restricted Project

Jan 3 2023

balazske added a comment to D140387: [clang][analyzer] Add stream related functions to StdLibraryFunctionsChecker..

I suppose the tests are done in the followup patch mostly?

Yes the tests in the next patch should cover the cases.

Jan 3 2023, 9:04 AM · Restricted Project, Restricted Project
balazske added a reviewer for D140562: [clang][ASTImporter] Improve import of InjectedClassNameType.: Szelethus.
Jan 3 2023, 2:40 AM · Restricted Project, Restricted Project
balazske updated the diff for D140395: [clang][analyzer] Extend StreamChecker with some new functions..

Removed old commment, updated a test run line.

Jan 3 2023, 12:28 AM · Restricted Project, Restricted Project

Jan 2 2023

balazske added inline comments to D140387: [clang][analyzer] Add stream related functions to StdLibraryFunctionsChecker..
Jan 2 2023, 7:30 AM · Restricted Project, Restricted Project
balazske added a reviewer for D140562: [clang][ASTImporter] Improve import of InjectedClassNameType.: gamesh411.
Jan 2 2023, 12:30 AM · Restricted Project, Restricted Project

Dec 22 2022

balazske added a comment to D140562: [clang][ASTImporter] Improve import of InjectedClassNameType..

This crash is produced if the test is run without the fix:

[ RUN      ] ParameterizedTests/ASTImporterOptionSpecificTestBase.ImportInjectedClassNameType/0
ASTTests: llvm-project/clang/lib/AST/ASTContext.cpp:4678: clang::QualType clang::ASTContext::getTypedefType(const clang::TypedefNameDecl *, clang::QualType) const: Assertion `hasSameType(Decl->getUnderlyingType(), Underlying)' failed.
 #0 0x00007fd8cc15141a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) llvm-project/llvm/lib/Support/Unix/Signals.inc:567:11
 #1 0x00007fd8cc1515eb PrintStackTraceSignalHandler(void*) llvm-project/llvm/lib/Support/Unix/Signals.inc:641:1
 #2 0x00007fd8cc14fb9b llvm::sys::RunSignalHandlers() llvm-project/llvm/lib/Support/Signals.cpp:103:5
 #3 0x00007fd8cc151d61 SignalHandler(int) llvm-project/llvm/lib/Support/Unix/Signals.inc:412:1
 #4 0x00007fd8cf630980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
 #5 0x00007fd8cb018e87 raise /build/glibc-CVJwZb/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #6 0x00007fd8cb01a7f1 abort /build/glibc-CVJwZb/glibc-2.27/stdlib/abort.c:81:0
 #7 0x00007fd8cb00a3fa __assert_fail_base /build/glibc-CVJwZb/glibc-2.27/assert/assert.c:89:0
 #8 0x00007fd8cb00a472 (/lib/x86_64-linux-gnu/libc.so.6+0x30472)
 #9 0x00007fd8cd95cf20 clang::ASTContext::getTypedefType(clang::TypedefNameDecl const*, clang::QualType) const llvm-project/clang/lib/AST/ASTContext.cpp:4680:26
#10 0x00007fd8cda9a574 clang::ASTNodeImporter::VisitTypedefType(clang::TypedefType const*) llvm-project/clang/lib/AST/ASTImporter.cpp:1365:34
#11 0x00007fd8cdb05191 clang::TypeVisitor<clang::ASTNodeImporter, llvm::Expected<clang::QualType>>::Visit(clang::Type const*) build/Debug/tools/clang/include/clang/AST/TypeNodes.inc:75:1
#12 0x00007fd8cdad0d35 clang::ASTImporter::Import(clang::Type const*) llvm-project/clang/lib/AST/ASTImporter.cpp:8651:8
#13 0x00007fd8cdad0ea8 clang::ASTImporter::Import(clang::QualType) llvm-project/clang/lib/AST/ASTImporter.cpp:8665:8
#14 0x00007fd8cdadb809 llvm::Expected<clang::QualType> clang::ASTNodeImporter::import<clang::QualType>(clang::QualType const&) llvm-project/clang/lib/AST/ASTImporter.cpp:219:23
#15 0x00007fd8cda9be49 clang::ASTNodeImporter::VisitElaboratedType(clang::ElaboratedType const*) llvm-project/clang/lib/AST/ASTImporter.cpp:1595:8
#16 0x00007fd8cdb04eb9 clang::TypeVisitor<clang::ASTNodeImporter, llvm::Expected<clang::QualType>>::Visit(clang::Type const*) build/Debug/tools/clang/include/clang/AST/TypeNodes.inc:45:1
#17 0x00007fd8cdad0d35 clang::ASTImporter::Import(clang::Type const*) llvm-project/clang/lib/AST/ASTImporter.cpp:8651:8
#18 0x00007fd8cdad0ea8 clang::ASTImporter::Import(clang::QualType) llvm-project/clang/lib/AST/ASTImporter.cpp:8665:8
#19 0x00007fd8cdadb809 llvm::Expected<clang::QualType> clang::ASTNodeImporter::import<clang::QualType>(clang::QualType const&) llvm-project/clang/lib/AST/ASTImporter.cpp:219:23
#20 0x00007fd8cda98d9b clang::ASTNodeImporter::VisitPointerType(clang::PointerType const*) llvm-project/clang/lib/AST/ASTImporter.cpp:1155:8
#21 0x00007fd8cdb0505d clang::TypeVisitor<clang::ASTNodeImporter, llvm::Expected<clang::QualType>>::Visit(clang::Type const*) build/Debug/tools/clang/include/clang/AST/TypeNodes.inc:62:1
#22 0x00007fd8cdad0d35 clang::ASTImporter::Import(clang::Type const*) llvm-project/clang/lib/AST/ASTImporter.cpp:8651:8
#23 0x00007fd8cdad0ea8 clang::ASTImporter::Import(clang::QualType) llvm-project/clang/lib/AST/ASTImporter.cpp:8665:8
#24 0x00007fd8cdadb809 llvm::Expected<clang::QualType> clang::ASTNodeImporter::import<clang::QualType>(clang::QualType const&) llvm-project/clang/lib/AST/ASTImporter.cpp:219:23
#25 0x00007fd8cda99d11 clang::ASTNodeImporter::VisitFunctionProtoType(clang::FunctionProtoType const*) llvm-project/clang/lib/AST/ASTImporter.cpp:1299:10
#26 0x00007fd8cdb04ef1 clang::TypeVisitor<clang::ASTNodeImporter, llvm::Expected<clang::QualType>>::Visit(clang::Type const*) build/Debug/tools/clang/include/clang/AST/TypeNodes.inc:48:1
#27 0x00007fd8cdad0d35 clang::ASTImporter::Import(clang::Type const*) llvm-project/clang/lib/AST/ASTImporter.cpp:8651:8
#28 0x00007fd8cdad0ea8 clang::ASTImporter::Import(clang::QualType) llvm-project/clang/lib/AST/ASTImporter.cpp:8665:8
#29 0x00007fd8cdadb809 llvm::Expected<clang::QualType> clang::ASTNodeImporter::import<clang::QualType>(clang::QualType const&) llvm-project/clang/lib/AST/ASTImporter.cpp:219:23
#30 0x00007fd8cdaddb5b clang::QualType clang::ASTNodeImporter::importChecked<clang::QualType>(llvm::Error&, clang::QualType const&) llvm-project/clang/lib/AST/ASTImporter.cpp:698:12
#31 0x00007fd8cdaa8c38 clang::ASTNodeImporter::VisitFunctionDecl(clang::FunctionDecl*) llvm-project/clang/lib/AST/ASTImporter.cpp:3597:12
#32 0x00007fd8cdaaabae clang::ASTNodeImporter::VisitCXXMethodDecl(clang::CXXMethodDecl*) llvm-project/clang/lib/AST/ASTImporter.cpp:3810:10
#33 0x00007fd8cdb04361 clang::declvisitor::Base<std::add_pointer, clang::ASTNodeImporter, llvm::Expected<clang::Decl*>>::Visit(clang::Decl*) build/Debug/tools/clang/include/clang/AST/DeclNodes.inc:443:1
#34 0x00007fd8cdad0a26 clang::ASTImporter::ImportImpl(clang::Decl*) llvm-project/clang/lib/AST/ASTImporter.cpp:8619:19
#35 0x00007fd8cdab3a72 clang::ASTImporter::Import(clang::Decl*) llvm-project/clang/lib/AST/ASTImporter.cpp:9008:8
#36 0x000000000064c702 clang::ast_matchers::ASTImporterTestBase::TU::import(std::shared_ptr<clang::ASTImporterSharedState> const&, clang::ASTUnit*, clang::Decl*) llvm-project/clang/unittests/AST/ASTImporterFixtures.cpp:83:12
#37 0x000000000064d4c2 clang::ast_matchers::ASTImporterTestBase::Import(clang::Decl*, clang::TestLanguage) llvm-project/clang/unittests/AST/ASTImporterFixtures.cpp:199:9
#38 0x00000000006da446 clang::FunctionDecl* clang::ast_matchers::ASTImporterTestBase::Import<clang::FunctionDecl>(clang::FunctionDecl*, clang::TestLanguage) llvm-project/clang/unittests/AST/ASTImporterFixtures.h:185:12
#39 0x00000000006c836d clang::ast_matchers::ASTImporterOptionSpecificTestBase_ImportInjectedClassNameType_Test::TestBody() llvm-project/clang/unittests/AST/ASTImporterTest.cpp:8102:15
#40 0x00007fd8cc2559c4 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) llvm-project/third-party/unittest/googletest/src/gtest.cc:2433:3
#41 0x00007fd8cc23b132 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) llvm-project/third-party/unittest/googletest/src/gtest.cc:2488:5
#42 0x00007fd8cc223173 testing::Test::Run() llvm-project/third-party/unittest/googletest/src/gtest.cc:2515:3
#43 0x00007fd8cc223a4d testing::TestInfo::Run() llvm-project/third-party/unittest/googletest/src/gtest.cc:2687:12
#44 0x00007fd8cc22401c testing::TestSuite::Run() llvm-project/third-party/unittest/googletest/src/gtest.cc:2815:44
#45 0x00007fd8cc22cde1 testing::internal::UnitTestImpl::RunAllTests() llvm-project/third-party/unittest/googletest/src/gtest.cc:5337:24
#46 0x00007fd8cc2591e4 bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) llvm-project/third-party/unittest/googletest/src/gtest.cc:2433:3
#47 0x00007fd8cc23d472 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) llvm-project/third-party/unittest/googletest/src/gtest.cc:2488:5
#48 0x00007fd8cc22c9aa testing::UnitTest::Run() llvm-project/third-party/unittest/googletest/src/gtest.cc:4925:10
#49 0x00007fd8cfa43d01 RUN_ALL_TESTS() llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:2472:3
#50 0x00007fd8cfa43c40 main llvm-project/third-party/unittest/UnitTestMain/TestMain.cpp:55:3
#51 0x00007fd8caffbc87 __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:344:0
#52 0x00000000005eeb1a _start (tools/clang/unittests/AST/ASTTests+0x5eeb1a)
Dec 22 2022, 9:35 AM · Restricted Project, Restricted Project
balazske requested review of D140562: [clang][ASTImporter] Improve import of InjectedClassNameType..
Dec 22 2022, 9:25 AM · Restricted Project, Restricted Project

Dec 21 2022

balazske committed rG13417808474c: [clang][AST] Compare UnresolvedLookupExpr in structural equivalence. (authored by balazske).
[clang][AST] Compare UnresolvedLookupExpr in structural equivalence.
Dec 21 2022, 12:59 AM · Restricted Project, Restricted Project
balazske closed D136848: [clang][AST] Compare UnresolvedLookupExpr in structural equivalence..
Dec 21 2022, 12:59 AM · Restricted Project, Restricted Project
balazske committed rG01303f6d1bba: [clang-tidy] Fix crash in bugprone-suspicious-realloc-usage. (authored by balazske).
[clang-tidy] Fix crash in bugprone-suspicious-realloc-usage.
Dec 21 2022, 12:30 AM · Restricted Project, Restricted Project
balazske closed D140194: [clang-tidy] Fix crash in bugprone-suspicious-realloc-usage..
Dec 21 2022, 12:30 AM · Restricted Project, Restricted Project

Dec 20 2022

balazske added inline comments to D135360: [clang][analyzer] Add some more functions to StreamChecker and StdLibraryFunctionsChecker..
Dec 20 2022, 8:59 AM · Restricted Project, Restricted Project
balazske abandoned D135360: [clang][analyzer] Add some more functions to StreamChecker and StdLibraryFunctionsChecker..
Dec 20 2022, 8:53 AM · Restricted Project, Restricted Project
balazske abandoned D135247: [clang][analyzer] Add stream functions to StdLibraryFunctionsChecker..
Dec 20 2022, 8:52 AM · Restricted Project, Restricted Project
balazske added a comment to D140387: [clang][analyzer] Add stream related functions to StdLibraryFunctionsChecker..

This patch and D140395 is (almost) the same code as D135360 and D135247. The changes are separated for the different checkers. Tests are added at the second patch.

Dec 20 2022, 6:08 AM · Restricted Project, Restricted Project
balazske added a comment to D137790: [clang][analyzer] Remove report of null stream from StreamChecker..

The changes D135360 and D135247 are now replaced by D140387 and D140395. The two new patches together add out almost the same code as the two old ones, except small differences in comments.

Dec 20 2022, 6:03 AM · Restricted Project, Restricted Project