Page MenuHomePhabricator
Feed Advanced Search

Thu, Mar 21

ahatanak committed rGb576c77a9ead: Don't add a tail keyword to calls to ObjC runtime functions if the calls are… (authored by ahatanak).
Don't add a tail keyword to calls to ObjC runtime functions if the calls are…
Thu, Mar 21, 1:16 PM
ahatanak committed rL356707: Don't add a tail keyword to calls to ObjC runtime functions if the calls.
Don't add a tail keyword to calls to ObjC runtime functions if the calls
Thu, Mar 21, 1:15 PM
ahatanak committed rG65bb3f92bd5f: [CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue with… (authored by ahatanak).
[CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue with…
Thu, Mar 21, 1:00 PM
ahatanak committed rL356705: [CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue.
[CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue
Thu, Mar 21, 1:00 PM
ahatanak committed rC356705: [CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue.
[CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue
Thu, Mar 21, 1:00 PM
ahatanak closed D59656: [CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue with notail on x86-64.
Thu, Mar 21, 1:00 PM · Restricted Project, Restricted Project
ahatanak updated the diff for D59656: [CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue with notail on x86-64.

Rename function.

Thu, Mar 21, 12:13 PM · Restricted Project, Restricted Project
ahatanak added a comment to D59656: [CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue with notail on x86-64.

There are existing test cases that test notail isn't added to calls on targets that aren't x86-64 (for example, test/CodeGenObjC/arc-arm.m), so I didn't write a new one.

Thu, Mar 21, 11:14 AM · Restricted Project, Restricted Project
ahatanak created D59656: [CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValue with notail on x86-64.
Thu, Mar 21, 11:09 AM · Restricted Project, Restricted Project

Thu, Mar 14

ahatanak committed rG6bc3a7703b31: [CodeGen][ObjC] Remove the leading 'l' from symbols for protocol metadata and… (authored by ahatanak).
[CodeGen][ObjC] Remove the leading 'l' from symbols for protocol metadata and…
Thu, Mar 14, 8:17 AM
ahatanak committed rC356156: [CodeGen][ObjC] Remove the leading 'l' from symbols for protocol.
[CodeGen][ObjC] Remove the leading 'l' from symbols for protocol
Thu, Mar 14, 8:17 AM
ahatanak committed rL356156: [CodeGen][ObjC] Remove the leading 'l' from symbols for protocol.
[CodeGen][ObjC] Remove the leading 'l' from symbols for protocol
Thu, Mar 14, 8:17 AM
ahatanak closed D59234: [CodeGen][ObjC] Remove the leading 'l' from symbols for protocol metadata and protocol list.
Thu, Mar 14, 8:17 AM · Restricted Project, Restricted Project
ahatanak added a comment to D59234: [CodeGen][ObjC] Remove the leading 'l' from symbols for protocol metadata and protocol list.

Okay, I'll remove the leading 'l' from other symbols and make them internal in a separate patch.

Thu, Mar 14, 8:17 AM · Restricted Project, Restricted Project

Wed, Mar 13

ahatanak added a comment to D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap.

Do you mean copying the block to the heap before assigning it to wb and releasing it after the assignment inside bar? Wouldn't the block assigned to wb be deallocated after the release?

Wed, Mar 13, 5:34 PM · Restricted Project
ahatanak added a comment to D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap.

Sorry, I misread the code. If you change the parameter type of bar to BlockTy, the code crashes. If the type is id, it doesn't crash because IRGen copies the block to the heap in foo before passing it to bar.

Wed, Mar 13, 5:10 PM · Restricted Project
ahatanak added a comment to D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap.

Seems like the chromium code is valid and shouldn't crash. John/Erik what do you think? The following code also crashes with this patch applied.

typedef void (^BlockTy)();

BlockTy sb;
__weak BlockTy wb;

void foo(id a) {
  auto b = ^{ NSLog(@"foo %@", a); };
  wb = b; // block isn't copied to the heap.
  sb = b; // block is copied to the heap.
}

int main() {
  auto x = [NSObject new];
  foo(x);
  sb();
  wb();
  return 0;
}

The assignment to wb seems like an escape of some sort. What happens for this similar code?

typedef void (^BlockTy)();

BlockTy sb;
__weak BlockTy wb;

void bar(id b) {
  wb = b;
  sb = b;
}

void foo(id a) {
  bar(^{ NSLog(@"foo %@", a); });
}

int main() {
  auto x = [NSObject new];
  foo(x);
  sb();
  wb();
  return 0;
}
Wed, Mar 13, 4:31 PM · Restricted Project
ahatanak added a comment to D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap.

Seems like the chromium code is valid and shouldn't crash. John/Erik what do you think? The following code also crashes with this patch applied.

Wed, Mar 13, 4:13 PM · Restricted Project

Mon, Mar 11

ahatanak added a comment to D59234: [CodeGen][ObjC] Remove the leading 'l' from symbols for protocol metadata and protocol list.

There are other symbols that starts with 'l' and have private linkage. I haven't made any changes to those symbols in this patch, but I think it's possible to remove the leading 'l' from those symbols and change the linkage to internal if we want to keep the symbol names.

Mon, Mar 11, 4:01 PM · Restricted Project, Restricted Project
ahatanak created D59234: [CodeGen][ObjC] Remove the leading 'l' from symbols for protocol metadata and protocol list.
Mon, Mar 11, 3:46 PM · Restricted Project, Restricted Project

Fri, Mar 8

ahatanak committed rG62d1d024ab35: Use {{.*}} in test case to match the type of wide string literals. (authored by ahatanak).
Use {{.*}} in test case to match the type of wide string literals.
Fri, Mar 8, 7:20 AM
ahatanak committed rC355700: Use {{.*}} in test case to match the type of wide string literals..
Use {{.*}} in test case to match the type of wide string literals.
Fri, Mar 8, 7:19 AM
ahatanak committed rL355700: Use {{.*}} in test case to match the type of wide string literals..
Use {{.*}} in test case to match the type of wide string literals.
Fri, Mar 8, 7:19 AM

Thu, Mar 7

ahatanak committed rGa453455cee67: Fix test case committed in r355662. (authored by ahatanak).
Fix test case committed in r355662.
Thu, Mar 7, 9:32 PM
ahatanak committed rL355664: Fix test case committed in r355662..
Fix test case committed in r355662.
Thu, Mar 7, 9:32 PM
ahatanak committed rC355664: Fix test case committed in r355662..
Fix test case committed in r355662.
Thu, Mar 7, 9:32 PM
ahatanak committed rG1488ee4bd541: [ObjC] Emit a boxed expression as a compile-time constant if the expression… (authored by ahatanak).
[ObjC] Emit a boxed expression as a compile-time constant if the expression…
Thu, Mar 7, 8:45 PM
ahatanak committed rC355662: [ObjC] Emit a boxed expression as a compile-time constant if the.
[ObjC] Emit a boxed expression as a compile-time constant if the
Thu, Mar 7, 8:45 PM
ahatanak committed rL355662: [ObjC] Emit a boxed expression as a compile-time constant if the.
[ObjC] Emit a boxed expression as a compile-time constant if the
Thu, Mar 7, 8:44 PM
ahatanak closed D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal.
Thu, Mar 7, 8:44 PM · Restricted Project, Restricted Project
ahatanak added inline comments to D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal.
Thu, Mar 7, 8:29 PM · Restricted Project, Restricted Project
ahatanak added inline comments to D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal.
Thu, Mar 7, 6:27 PM · Restricted Project, Restricted Project
ahatanak updated the diff for D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal.

Use the type of NSStringPointer in the diagnostic string.

Thu, Mar 7, 6:25 PM · Restricted Project, Restricted Project

Wed, Mar 6

ahatanak updated the diff for D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal.

Improve diagnostic message.

Wed, Mar 6, 11:46 PM · Restricted Project, Restricted Project
ahatanak updated the diff for D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal.

Diagnose invalid UTF-8 strings in boxed expressions.

Wed, Mar 6, 5:48 PM · Restricted Project, Restricted Project

Tue, Mar 5

ahatanak added inline comments to D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal.
Tue, Mar 5, 6:38 PM · Restricted Project, Restricted Project
ahatanak added inline comments to D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal.
Tue, Mar 5, 6:34 PM · Restricted Project, Restricted Project
ahatanak updated the diff for D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal.

If the string literal used for the boxed expression isn't a valid UTF-8 string, don't emit a compile-time constant.

Tue, Mar 5, 6:30 PM · Restricted Project, Restricted Project

Thu, Feb 28

ahatanak committed rG78be8b6d5322: [Sema][ObjC] Allow silencing -Wobjc-designated-initializers warnings by… (authored by ahatanak).
[Sema][ObjC] Allow silencing -Wobjc-designated-initializers warnings by…
Thu, Feb 28, 10:44 PM
ahatanak committed rC355175: [Sema][ObjC] Allow silencing -Wobjc-designated-initializers warnings by.
[Sema][ObjC] Allow silencing -Wobjc-designated-initializers warnings by
Thu, Feb 28, 10:43 PM
ahatanak committed rL355175: [Sema][ObjC] Allow silencing -Wobjc-designated-initializers warnings by.
[Sema][ObjC] Allow silencing -Wobjc-designated-initializers warnings by
Thu, Feb 28, 10:43 PM
ahatanak added inline comments to D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal.
Thu, Feb 28, 2:47 PM · Restricted Project, Restricted Project
ahatanak updated the diff for D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal.

Address review comments.

Thu, Feb 28, 2:47 PM · Restricted Project, Restricted Project

Wed, Feb 27

ahatanak added inline comments to D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal.
Wed, Feb 27, 6:35 PM · Restricted Project, Restricted Project
ahatanak accepted D58744: [CodeGen] Fix some broken IR generated by -fsanitize=unsigned-integer-overflow.

LGTM

Wed, Feb 27, 4:38 PM · Restricted Project, Restricted Project
ahatanak added inline comments to D58744: [CodeGen] Fix some broken IR generated by -fsanitize=unsigned-integer-overflow.
Wed, Feb 27, 4:12 PM · Restricted Project, Restricted Project
ahatanak added inline comments to D58744: [CodeGen] Fix some broken IR generated by -fsanitize=unsigned-integer-overflow.
Wed, Feb 27, 4:12 PM · Restricted Project, Restricted Project
ahatanak created D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal.
Wed, Feb 27, 11:10 AM · Restricted Project, Restricted Project
ahatanak committed rGb65a8ad761c3: Add triples to the test I committed in r355012 to fix windows bots. (authored by ahatanak).
Add triples to the test I committed in r355012 to fix windows bots.
Wed, Feb 27, 11:00 AM
ahatanak committed rC355017: Add triples to the test I committed in r355012 to fix windows bots..
Add triples to the test I committed in r355012 to fix windows bots.
Wed, Feb 27, 11:00 AM
ahatanak committed rL355017: Add triples to the test I committed in r355012 to fix windows bots..
Add triples to the test I committed in r355012 to fix windows bots.
Wed, Feb 27, 10:59 AM
ahatanak closed D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap.

Fixed in r355012.

Wed, Feb 27, 10:20 AM · Restricted Project
ahatanak committed rGc5792aa90fa4: Avoid needlessly copying a block to the heap when a block literal initializes a… (authored by ahatanak).
Avoid needlessly copying a block to the heap when a block literal initializes a…
Wed, Feb 27, 10:19 AM
ahatanak committed rC355012: Avoid needlessly copying a block to the heap when a block literal.
Avoid needlessly copying a block to the heap when a block literal
Wed, Feb 27, 10:18 AM
ahatanak committed rL355012: Avoid needlessly copying a block to the heap when a block literal.
Avoid needlessly copying a block to the heap when a block literal
Wed, Feb 27, 10:18 AM

Tue, Feb 26

ahatanak updated the diff for D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap.

Call IgnoreParens on the LHS too.

Tue, Feb 26, 3:51 PM · Restricted Project

Feb 22 2019

ahatanak updated the diff for D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap.

Address review comments. Add CodeGen test cases for parentheses expressions.

Feb 22 2019, 3:07 PM · Restricted Project

Feb 21 2019

ahatanak updated the diff for D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap.

Remove the code that is needed to check whether the address of a local variable is taken.

Feb 21 2019, 10:42 PM · Restricted Project
ahatanak added a comment to D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap.

For assignment, the optimization isn't performed if the local variable isn't declared in the scope that introduced the block (see the code and comment in SemaExpr.cpp).

Feb 21 2019, 10:42 PM · Restricted Project
ahatanak created D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap.
Feb 21 2019, 8:42 AM · Restricted Project

Feb 14 2019

ahatanak requested changes to D58164: Block+lambda: allow reference capture.

Sorry, I didn't mean to accept this yet. I think this is something that is better fixed in Sema.

Feb 14 2019, 9:34 PM · Restricted Project
ahatanak accepted D58164: Block+lambda: allow reference capture.

Sorry, I was misunderstanding the problem.

Feb 14 2019, 9:31 PM · Restricted Project

Feb 13 2019

ahatanak added a comment to D58164: Block+lambda: allow reference capture.

I think the root of the problem is that BlockDecl knows the captured variable but doesn't know the type of the capture. The type of the variable and the type of the capture can be different if the block is nested inside a lambda or another block, which is why CI.hasCopyExpr() can return a non-null value when VT is a lvalue reference:

Feb 13 2019, 10:31 AM · Restricted Project
ahatanak added a comment to D58164: Block+lambda: allow reference capture.

The code is crashing here because the loop in computeBlockInfo is trying to capture a variable that is captured by reference by the enclosing lambda as if it were captured by value. This is the type of VT:

Feb 13 2019, 10:26 AM · Restricted Project

Feb 8 2019

ahatanak added inline comments to D57626: Disallow trivial_abi on a class if all copy and move constructors are deleted.
Feb 8 2019, 5:35 PM · Restricted Project
ahatanak updated the diff for D57626: Disallow trivial_abi on a class if all copy and move constructors are deleted.

Improve diagnostic messages.

Feb 8 2019, 5:33 PM · Restricted Project
ahatanak accepted D57427: [CodeGen][ObjC] Fix assert on calling `__builtin_constant_p` with ObjC objects..

LGTM

Feb 8 2019, 2:32 PM · Restricted Project
ahatanak committed rG67b1b451b5f4: Pass the base element type of an array type to the visit method instead of the… (authored by ahatanak).
Pass the base element type of an array type to the visit method instead of the…
Feb 8 2019, 11:50 AM
ahatanak committed rC353556: Pass the base element type of an array type to the visit method instead.
Pass the base element type of an array type to the visit method instead
Feb 8 2019, 11:46 AM
ahatanak committed rL353556: Pass the base element type of an array type to the visit method instead.
Pass the base element type of an array type to the visit method instead
Feb 8 2019, 11:46 AM

Feb 7 2019

ahatanak committed rG5fbdccd83487: [Sema][ObjC] Disallow non-trivial C struct fields in unions. (authored by ahatanak).
[Sema][ObjC] Disallow non-trivial C struct fields in unions.
Feb 7 2019, 12:24 PM
ahatanak committed rC353459: [Sema][ObjC] Disallow non-trivial C struct fields in unions..
[Sema][ObjC] Disallow non-trivial C struct fields in unions.
Feb 7 2019, 12:22 PM
ahatanak committed rL353459: [Sema][ObjC] Disallow non-trivial C struct fields in unions..
[Sema][ObjC] Disallow non-trivial C struct fields in unions.
Feb 7 2019, 12:22 PM
ahatanak closed D55659: [Sema][ObjC] Disallow non-trivial C struct fields in unions.
Feb 7 2019, 12:21 PM · Restricted Project, Restricted Project

Feb 5 2019

ahatanak updated the diff for D55659: [Sema][ObjC] Disallow non-trivial C struct fields in unions.

Make sure that volatile trivial fields in a struct don't cause Sema to emit a diagnostic. Simplify the code in Sema::ActOnFields .

Feb 5 2019, 6:50 PM · Restricted Project, Restricted Project
ahatanak planned changes to D55659: [Sema][ObjC] Disallow non-trivial C struct fields in unions.

This patch is unnecessarily complicated and is not correct.

Feb 5 2019, 4:09 PM · Restricted Project, Restricted Project
ahatanak added inline comments to D57626: Disallow trivial_abi on a class if all copy and move constructors are deleted.
Feb 5 2019, 3:42 PM · Restricted Project

Feb 4 2019

ahatanak updated the diff for D57626: Disallow trivial_abi on a class if all copy and move constructors are deleted.

Add a note diagnostic to inform the user of the reason for not allowing annotating a class with trivial_abi.

Feb 4 2019, 2:38 PM · Restricted Project

Feb 1 2019

ahatanak committed rL352949: [Sema][ObjC] Allow declaring ObjC pointer members with non-trivial.
[Sema][ObjC] Allow declaring ObjC pointer members with non-trivial
Feb 1 2019, 6:23 PM
ahatanak committed rC352949: [Sema][ObjC] Allow declaring ObjC pointer members with non-trivial.
[Sema][ObjC] Allow declaring ObjC pointer members with non-trivial
Feb 1 2019, 6:23 PM
ahatanak closed D57438: [Sema][ObjC] Allow declaring ObjC pointer members in C++ unions under ARC.
Feb 1 2019, 6:23 PM · Restricted Project
ahatanak created D57626: Disallow trivial_abi on a class if all copy and move constructors are deleted.
Feb 1 2019, 3:10 PM · Restricted Project
ahatanak updated the diff for D57438: [Sema][ObjC] Allow declaring ObjC pointer members in C++ unions under ARC.

Add a test case for an anonymous struct nested inside an anonymous union.

Feb 1 2019, 2:50 PM · Restricted Project
ahatanak added inline comments to D57438: [Sema][ObjC] Allow declaring ObjC pointer members in C++ unions under ARC.
Feb 1 2019, 2:48 PM · Restricted Project

Jan 31 2019

ahatanak added inline comments to D57438: [Sema][ObjC] Allow declaring ObjC pointer members in C++ unions under ARC.
Jan 31 2019, 6:34 PM · Restricted Project
ahatanak updated the diff for D57438: [Sema][ObjC] Allow declaring ObjC pointer members in C++ unions under ARC.

Address review comments.

Jan 31 2019, 6:34 PM · Restricted Project
ahatanak committed rL352822: Revert "[Sema] Make canPassInRegisters return true if the CXXRecordDecl passed".
Revert "[Sema] Make canPassInRegisters return true if the CXXRecordDecl passed"
Jan 31 2019, 4:12 PM
ahatanak committed rC352822: Revert "[Sema] Make canPassInRegisters return true if the CXXRecordDecl passed".
Revert "[Sema] Make canPassInRegisters return true if the CXXRecordDecl passed"
Jan 31 2019, 4:12 PM

Jan 29 2019

ahatanak added a comment to D57427: [CodeGen][ObjC] Fix assert on calling `__builtin_constant_p` with ObjC objects..

LGTM with one minor nit.

Jan 29 2019, 10:19 PM · Restricted Project
ahatanak added inline comments to D57438: [Sema][ObjC] Allow declaring ObjC pointer members in C++ unions under ARC.
Jan 29 2019, 10:16 PM · Restricted Project
ahatanak created D57438: [Sema][ObjC] Allow declaring ObjC pointer members in C++ unions under ARC.
Jan 29 2019, 10:06 PM · Restricted Project

Jan 22 2019

ahatanak committed rL351911: [Sema][ObjC] Check whether a DelayedDiagnosticPool has been pushed.
[Sema][ObjC] Check whether a DelayedDiagnosticPool has been pushed
Jan 22 2019, 4:56 PM
ahatanak committed rC351911: [Sema][ObjC] Check whether a DelayedDiagnosticPool has been pushed.
[Sema][ObjC] Check whether a DelayedDiagnosticPool has been pushed
Jan 22 2019, 4:56 PM
ahatanak abandoned D2393: support for directive .reloc.
Jan 22 2019, 11:14 AM

Jan 10 2019

ahatanak committed rC350920: [Sema] Make canPassInRegisters return true if the CXXRecordDecl passed.
[Sema] Make canPassInRegisters return true if the CXXRecordDecl passed
Jan 10 2019, 11:10 PM
ahatanak committed rL350920: [Sema] Make canPassInRegisters return true if the CXXRecordDecl passed.
[Sema] Make canPassInRegisters return true if the CXXRecordDecl passed
Jan 10 2019, 11:10 PM
ahatanak committed rL350917: [Sema] If CheckPlaceholderExpr rewrites the initializer of an auto.
[Sema] If CheckPlaceholderExpr rewrites the initializer of an auto
Jan 10 2019, 9:01 PM
ahatanak committed rC350917: [Sema] If CheckPlaceholderExpr rewrites the initializer of an auto.
[Sema] If CheckPlaceholderExpr rewrites the initializer of an auto
Jan 10 2019, 9:01 PM
ahatanak committed rC350887: [Sema] Call CheckPlaceholderExpr to resolve typeof or decltype.
[Sema] Call CheckPlaceholderExpr to resolve typeof or decltype
Jan 10 2019, 12:16 PM
ahatanak committed rL350887: [Sema] Call CheckPlaceholderExpr to resolve typeof or decltype.
[Sema] Call CheckPlaceholderExpr to resolve typeof or decltype
Jan 10 2019, 12:16 PM