[PATCH] D27872: [APFloat] Switch from (PPCDoubleDoubleImpl, IEEEdouble) layout to (IEEEdouble, IEEEdouble)

2016-12-16 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: llvm/include/llvm/ADT/APFloat.h:773 + return U.IEEE.makeZero(Neg); +} else if (usesLayout(getSemantics())) { + return U.Double.makeZero(Neg); You don't need else after return. https://reviews.llvm.org/D2

[PATCH] D27410: Always issue vtables when generating coverage instrumentation

2016-12-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: llvm/tools/clang/test/CodeGenCXX/vtable-coverage-gen.cpp:3 +// RUN: FileCheck %s < %t +// CHECK: @_ZTV8Category = linkonce_odr unnamed_addr constant {{.*}}, comdat, + I'm not sure I understood the purpose of this test,

[PATCH] D24969: [Sema] Use the instantiated name of destructors in FindInstantiatedDecl and RebuildMemberExpr

2016-12-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. ping https://reviews.llvm.org/D24969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27478: Make ASTContext::getDeclAlign return the correct alignment for FunctionDecls

2016-12-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. ping https://reviews.llvm.org/D27478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D25206: [Parser] Correct typo after lambda capture initializer is parsed

2016-12-19 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL290156: [Parser] Correct typo after lambda capture initializer is parsed. (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D25206?vs=75819&id=82052#toc Repository: rL LLVM h

[PATCH] D25206: [Parser] Correct typo after lambda capture initializer is parsed

2016-12-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Thanks all for the review. Comment at: cfe/trunk/test/SemaCXX/lambda-expressions.cpp:572 +void foo1() { + auto s0 = S1{[name=]() {}}; // expected-error 2 {{expected expression}} + auto s1 = S1{[name=name]() {}}; // expected-error {{use of undeclared

[PATCH] D24969: [Sema] Use the instantiated name of destructors in FindInstantiatedDecl and RebuildMemberExpr

2016-12-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 82120. ahatanak added a comment. Call TransformDeclarationNameInfo unconditionally to transform NameInfo rather than doing so only for destructors. I think this is a cleaner fix. https://reviews.llvm.org/D24969 Files: lib/Sema/SemaTemplateInstantiateDec

[PATCH] D24969: [Sema] Use the instantiated name of destructors in FindInstantiatedDecl and RebuildMemberExpr

2016-12-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 82134. ahatanak marked 2 inline comments as done. ahatanak added a comment. Add code for error recovery. https://reviews.llvm.org/D24969 Files: lib/Sema/SemaTemplateInstantiateDecl.cpp lib/Sema/TreeTransform.h test/SemaCXX/destructor.cpp Index: tes

[PATCH] D24969: [Sema] Use the instantiated name of destructors in FindInstantiatedDecl and RebuildMemberExpr

2016-12-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/TreeTransform.h:8766-8767 NamedDecl *FirstQualifierInScope = nullptr; + DeclarationNameInfo MemberNameInfo = + getDerived().TransformDeclarationNameInfo(E->getMemberNameInfo()); rsmith wrote: > Likew

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2016-12-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 82142. ahatanak added a comment. Rebase and improve test cases. - Add "-mllvm -disable-llvm-optzns" to the RUN line. - Add a test case that shows lifetime.start of a variable isn't moved to the beginning of its scope when the goto leaves the scope. https:

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2016-12-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 82279. ahatanak marked an inline comment as done. ahatanak added a comment. Remove Addr and Size from CallLifetimeEnd. https://reviews.llvm.org/D27680 Files: lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CGStmt.cpp lib/CodeGen/CodeGenFu

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2016-12-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D27680#628272, @rjmccall wrote: > Wouldn't it be simpler to just record an insertion point for the beginning of > the current lexical scope and insert the lifetime.begin there instead of at > the current IP? I'm not sure I understood your

[PATCH] D25556: [Sema] Add variable captured by a block to the enclosing lambda's potential capture list

2016-12-22 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 82394. ahatanak added a comment. Rebase. r286584 changed getCurLambda to optionally skip CapturedRegionScopeInfos. This patch changes it to skip BlockScopeInfos too. https://reviews.llvm.org/D25556 Files: include/clang/Sema/Sema.h lib/Sema/Sema.cpp

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2016-12-22 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Ah, good idea. That sounds like a much simpler and less invasive approach. I agree that the performance impact would probably be small, and if it turns out to have a significant impact, we can reduce the number of times we move the lifetime.start (without moving it ret

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2016-12-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 82421. ahatanak added a comment. When compiling for C, insert lifetime.start at the beginning of the current lexical scope, rather than moving it retroactively when a goto jumps backwards over the variable declaration. Also, insert lifetime.start at a more

[PATCH] D15075: No error for conflict between inputs\outputs and clobber list

2016-12-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D15075#631237, @myatsina wrote: > In https://reviews.llvm.org/D15075#631207, @vitalybuka wrote: > > > These patches break asan tests: > > http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/528/steps/check-asan%20in%20gcc%20build/

[PATCH] D15075: No error for conflict between inputs\outputs and clobber list

2016-12-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I guess it doesn't build because output constraints need "=" (e.g., "=D")? Also, I think all registers ("D", "S", and "c") should be in both the output and input operands list. You can probably declare new variables and use them in the output operands (e.g., "=D"(newD

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2017-01-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/CodeGen/CGDecl.cpp:917 + if (!InsertPt) +Builder.SetInsertPoint(BB, BB->begin()); + // If InsertPt is a terminator, insert it before InsertPt. rjmccall wrote: > BB->begin() is not necessarily a leg

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2017-01-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/CodeGen/CGDecl.cpp:917 + if (!InsertPt) +Builder.SetInsertPoint(BB, BB->begin()); + // If InsertPt is a terminator, insert it before InsertPt. ahatanak wrote: > rjmccall wrote: > > BB->begin() is n

[PATCH] D28231: -Wunreachable-code: Avoid multiple diagnostics that are triggered by the same source range and fix the unary operator fixit source range

2017-01-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. If I change the condition to the following, if (!s->p || 1) clang suggests enclosing !s->p with a parenthesis, but the comment in ReachableCode.cpp says the parenthesis should enclose the integer literal. It seems like there is a contradiction here? Repository:

[PATCH] D25556: [Sema] Add variable captured by a block to the enclosing lambda's potential capture list

2017-01-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. ping https://reviews.llvm.org/D25556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27478: Make ASTContext::getDeclAlign return the correct alignment for FunctionDecls

2017-01-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. ping https://reviews.llvm.org/D27478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2017-01-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I found another problem with the current patch: it can generate IR that doesn't pass asan's use-after-scope check. For example, IRGen generates the following IR for function move_lifetime_start in lifetime2.c when this patch is applied: entry: %i = alloca i32, al

[PATCH] D28231: -Wunreachable-code: Avoid multiple diagnostics that are triggered by the same source range and fix the unary operator fixit source range

2017-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Analysis/ReachableCode.cpp:229 + if (SilenceableCondValNotSet && SilenceableCondVal->getBegin().isValid()) +*SilenceableCondVal = UO->getSourceRange(); + return UO->getOpcode() == UO_LNot && IsSubExprConfigValue; -

[PATCH] D28296: [ObjC] The declarator for a block literal should be a definition

2017-01-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added a comment. This revision is now accepted and ready to land. LGTM Repository: rL LLVM https://reviews.llvm.org/D28296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi

[PATCH] D27478: Make ASTContext::getDeclAlign return the correct alignment for FunctionDecls

2017-01-06 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL291253: Make ASTContext::getDeclAlign return the correct alignment for (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D27478?vs=80464&id=83378#toc Repository: rL LLVM http

[PATCH] D28344: [AVR] Add support for the full set of inline asm constraints

2017-01-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Test case? Comment at: lib/Basic/Targets.cpp:8506 + case 'N': // Integer constant (Range: -1) +Info.setRequiresImmediate(-1); + case 'O': // Integer constant (Range: 8, 16, 24) Is this meant to fall through or do you

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2017-01-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 83680. ahatanak added a comment. Herald added a subscriber: mgorny. I added an AST analysis pass that is run before IRGen and decides which VarDecls need their lifetimes to be extended or disabled. It only looks at VarDecls which have their addresses taken

[PATCH] D24969: [Sema] Use the instantiated name of destructors in FindInstantiatedDecl and RebuildMemberExpr

2017-01-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Richard, does the updated patch look OK? https://reviews.llvm.org/D24969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2017-01-11 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D27680#642770, @rjmccall wrote: > Interesting. That's a pretty heavyweight solution, and you're still missing > switches, which have exactly the same "can jump into an arbitrary variable's > scope" behavior. In addition to missing the swi

[PATCH] D28231: -Wunreachable-code: Avoid multiple diagnostics that are triggered by the same source range and fix the unary operator fixit source range

2017-01-11 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added a comment. This revision is now accepted and ready to land. Thanks, LGTM Repository: rL LLVM https://reviews.llvm.org/D28231 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm

[PATCH] D30766: Add support for attribute "enum_extensibility"

2017-03-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 91782. ahatanak marked 3 inline comments as done. ahatanak added a comment. Address review comments from Aaron. https://reviews.llvm.org/D30766 Files: include/clang/AST/Decl.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clan

[PATCH] D30766: Add support for attribute "enum_extensibility"

2017-03-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: test/Sema/enum-attr.c:27 + +enum __attribute__((enum_extensibility(arg1))) EnumInvalidArg { // expected-warning{{'enum_extensibility' attribute argument not supported: 'arg1'}} + G aaron.ballman wrote: > ahatanak wro

[PATCH] D30810: Preserve vec3 type.

2017-03-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. It looks like converting vec3 to vec4 is incorrect in some cases. In the following program, IRGen emits "store <4 x float>" to store g1 to *a, which will overwrite s1.f2. typedef __attribute__((__ext_vector_type__(3))) float float3; struct S1 { float3 f1;

[PATCH] D30810: Preserve vec3 type.

2017-03-14 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Actually, it's not a mis-compile. The record layout shows that there is a padding before field f2 and f2 starts at byte 16. So using "store <4 x float>" doesn't overwrite the field. https://reviews.llvm.org/D30810 ___ cfe

[PATCH] D30810: Preserve vec3 type.

2017-03-15 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D30810#701141, @jaykang10 wrote: > In https://reviews.llvm.org/D30810#701132, @ahatanak wrote: > > > Actually, it's not a mis-compile. The record layout shows that there is a > > padding before field f2 and f2 starts at byte 16. So using "sto

[PATCH] D30766: Add support for attribute "enum_extensibility"

2017-03-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked an inline comment as done. ahatanak added inline comments. Comment at: test/Sema/enum-attr.c:27 + +enum __attribute__((enum_extensibility(arg1))) EnumInvalidArg { // expected-warning{{'enum_extensibility' attribute argument not supported: 'arg1'}} + G -

[PATCH] D30766: Add support for attribute "enum_extensibility"

2017-03-20 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. ahatanak marked an inline comment as done. Closed by commit rL298332: Add support for attribute enum_extensibility. (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D30766?vs=91782&id=92418#toc R

[PATCH] D31177: [ARC][ObjC++] Use ObjC semantic rules for comparisons between a pointer and objective-c object pointer

2017-03-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaExpr.cpp:9431 + ? 2 + : 1)) { if (convertPointersToCompositeType(*this, Loc, LHS, RHS)) It wasn't clear to me why the code has to be added to the right hand side of the >= op

[PATCH] D31168: Set FMF for -ffp-contract=fast rather than a TargetConfig

2017-03-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I think you can add a test case in this patch (after the llvm changes are checked in)? Comment at: lib/CodeGen/CGExprScalar.cpp:262 +ApplyFPFeatures(llvm::IRBuilderBase &Builder, Expr *E) +: CGBuilderTy::FastMathFlagGuard(Builder) { +

[PATCH] D22391: [Sema] Add warning for implicitly casting a null constant to a non null pointer type

2017-03-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 92583. ahatanak added a comment. Rebase and ping. https://reviews.llvm.org/D22391 Files: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Sema/SemaChecking.cpp lib/Sema/SemaDecl.cpp

[PATCH] D25001: [Module] Merge function prototype with a non-prototype function declaration

2017-03-22 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 92742. ahatanak added a comment. Update patch. 1. In isSameEntity, call typesAreCompatible instead of hasSameType so that non-prototype function declarations are merged with function prototypes. 2. Define a function (mergeCompatibleFunctionDecls) that chang

[PATCH] D31177: [ARC][ObjC++] Use ObjC semantic rules for comparisons between a pointer and objective-c object pointer

2017-03-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added a comment. This revision is now accepted and ready to land. Thanks, LGTM. Repository: rL LLVM https://reviews.llvm.org/D31177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llv

[PATCH] D31140: [LLVMbugs] [Bug 18710] Only generate .ARM.exidx and .ARM.extab when needed in EHABI

2017-03-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Is it possible to enable cantunwind for one function and enable for another? If so, does this have to be a function attribute? https://reviews.llvm.org/D31140 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://

[PATCH] D31397: [Bug 25404] Fix crash on typedef in OpenCL 2.0

2017-03-27 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaDecl.cpp:2157 if (getDiagnostics().getSuppressSystemWarnings() && - (Context.getSourceManager().isInSystemHeader(Old->getLocation()) || + // Some standard types are defined implicitly in Clang (e.g. OpenCL). +

[PATCH] D31383: [inline asm] "=i" output constraint support - gcc compatiblity

2017-04-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Basic/TargetInfo.cpp:506 case '!': // Disparage severely. case '*': // Ignore for choosing register preferences. +case 'i': // Ignore i as output constraint (match from the other chars) If we are going

[PATCH] D31597: [ObjC++] Conversions from specialized to non-specialized objective-c object type should be preferred over conversions to other object pointers

2017-04-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added a comment. This revision is now accepted and ready to land. LGTM Repository: rL LLVM https://reviews.llvm.org/D31597 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi

[PATCH] D31673: Allow casting C pointers declared using extern "C" to ObjC pointer types

2017-04-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ARCCastChecker::VisitDeclRefExpr allows casting a constant pointer declared in a header file to an ObjC pointer type. However, it rejects a cast from a variable declared with a language linkage specification (e.g., extern "C") to an ObjC pointer type. According

[PATCH] D31591: Fix a bug which access nullptr and cause segmentation fault

2017-04-04 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: clang/test/Sema/sema-segvcheck.c:3 +// RUN: %clang_cc1 -fsyntax-only %s; test $? -eq 1 + +typedef struct { You can simplify the test case. Compiling the following code still segfaults: ``` typedef struct { unsigned l

[PATCH] D25866: [Sema] Support implicit scalar to vector conversions

2017-04-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaExpr.cpp:8024 + bool RHSNatVec = RHS.get()->IgnoreImpCasts()->getType()->isVectorType(); + + if (LHSNatVec ^ RHSNatVec) { I think "!=" is easier to understand than "^" here. Comment at:

[PATCH] D31667: [Sema] Extend GetSignedVectorType to deal with non ExtVector types

2017-04-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaExpr.cpp:9736 + } + + if (TypeSize == Context.getTypeSize(Context.LongLongTy)) This isn't particularly urgent, but can we use ASTContext ::getIntTypeForBitwidth here rather than calling getVectorType or

[PATCH] D31673: Allow casting C pointers declared using extern "C" to ObjC pointer types

2017-04-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaExprObjC.cpp:3358 var && - var->getStorageClass() == SC_Extern && + !var->isThisDeclarationADefinition() && var->getType().isConstQualified()) { rjmccall wrote: > Hmm

[PATCH] D31673: Allow casting C pointers declared using extern "C" to ObjC pointer types

2017-04-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 94460. ahatanak marked an inline comment as done. https://reviews.llvm.org/D31673 Files: lib/Sema/SemaExprObjC.cpp test/SemaObjCXX/arc-bridged-cast.mm Index: test/SemaObjCXX/arc-bridged-cast.mm ==

[PATCH] D31673: Allow casting C pointers declared using extern "C" to ObjC pointer types

2017-04-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaExprObjC.cpp:3358 var && - var->getStorageClass() == SC_Extern && + !var->isThisDeclarationADefinition() && var->getType().isConstQualified()) { rjmccall wrote: > aha

[PATCH] D31673: Allow casting C pointers declared using extern "C" to ObjC pointer types

2017-04-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 94686. ahatanak marked an inline comment as done. https://reviews.llvm.org/D31673 Files: lib/Sema/SemaExprObjC.cpp test/SemaObjCXX/arc-bridged-cast.mm Index: test/SemaObjCXX/arc-bridged-cast.mm ==

[PATCH] D31839: make -Winteger-overflow find overflows in function arguments

2017-04-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Is it possible to fix ObjCMessageExpr too while you are in here? I think clang should issue a warning when compiling the following code: @protocol NSObject @end @interface NSObject @end @interface C1 : NSObject - (void)foo:(int)i; @end @implementat

[PATCH] D31673: Allow casting C pointers declared using extern "C" to ObjC pointer types

2017-04-11 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL22: [Sema][ObjC] Check whether a variable has a definition, rather than (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D31673?vs=94686&id=94899#toc Repository: rL LLVM

[PATCH] D31839: make -Winteger-overflow find overflows in function arguments

2017-04-11 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. OK, thanks for looking into it. Warnings for ObjCMessageExpr can probably be implemented in a separate patch. It looks like clang still doesn't issue overflow warnings when the called functions have a void return. Should we try to fix it in this patch too? void foo(

[PATCH] D31976: Avoid assert when a non-static member function is qualified with __unaligned

2017-04-16 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: test/CodeGenCXX/unaligned-duplicated-mangle-name.cpp:15 + +void A::foo() // expected-error {{definition with same mangled name as another definition}} + // expected-note@-6 {{previous definition is here}}

[PATCH] D31972: Do not force the frame pointer by default for ARM EABI

2017-04-16 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Can you add a test case? https://reviews.llvm.org/D31972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32187: [CodeGen][ObjC]

2017-04-18 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. This fixes a bug in EmitObjCForCollectionStmt which is causing clang to generate malformed IR. When the following code (which I think is legal, at least when it is not compiled with ARC) is compiled: $ cat test1.m @interface Obj @end void bar(void); voi

[PATCH] D31976: Avoid assert when a non-static member function is qualified with __unaligned

2017-04-18 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I see, thank you for the explanation. https://reviews.llvm.org/D31976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32187: [CodeGen][ObjC]

2017-04-18 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 95667. ahatanak added a comment. Unconditionally ban jumping into body of ObjC fast enumeration loop. https://reviews.llvm.org/D32187 Files: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/JumpDiagnostics.cpp lib/Sema/SemaStmt.cpp test/SemaObjC

[PATCH] D32210: [Sema][ObjC] Add support for attribute "noescape"

2017-04-18 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. This patch adds support for attribute "noescape", which is used to tell the compiler that a block passed to a function will not be called after the function returns. To ensure that the block does not escape, clang imposes the following restrictions on its usage:

[PATCH] D28705: [Sema] Fix bug in handling of designated initializer

2017-01-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rsmith, rnk, arphaman. ahatanak added a subscriber: cfe-commits. CheckDesignatedInitializer wasn't taking into account the base classes when computing the index for the field in the derived class, which caused the test case to crash durin

[PATCH] D28457: Add missing const qualifier to member function Decl::isLocalExternDecl()

2017-01-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added a reviewer: ahatanak. ahatanak added a comment. This revision is now accepted and ready to land. This looks OK to commit. https://reviews.llvm.org/D28457 ___ cfe-commits mailing list cfe-commits@lists.

[PATCH] D28705: [Sema] Fix bug in handling of designated initializer

2017-01-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 84418. ahatanak marked 2 inline comments as done. ahatanak added a comment. Address review comments. https://reviews.llvm.org/D28705 Files: lib/Sema/SemaInit.cpp test/SemaCXX/designated-initializers-base-class.cpp Index: test/SemaCXX/designated-initi

[PATCH] D28705: [Sema] Fix bug in handling of designated initializer

2017-01-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D28705#646088, @rnk wrote: > What happens with virtual bases? > > struct B { int x; }; > struct D : virtual B { int y; }; > void test() { D d = {1, .y = 2}; } A class with virtual base is not considered an aggregate, so it doesn't go

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2017-01-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 84434. ahatanak added a comment. Remove lifetime markers completely for variables that are declared after a label was seen in a compound statement I tested this patch building llvm's test-suite and SPEC benchmarks with -Os. Surprisingly (maybe not so surpr

[PATCH] D25001: [Module] Merge function prototype with a non-prototype function declaration

2017-01-17 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Sorry for the delay in replying. Comment at: lib/Serialization/ASTReaderDecl.cpp:2715 return (FuncX->getLinkageInternal() == FuncY->getLinkageInternal()) && FuncX->getASTContext().hasSameType(FuncX->getType(), FuncY->getType()); } --

[PATCH] D28705: [Sema] Fix bug in handling of designated initializer

2017-01-17 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL292245: [Sema] Fix bug in handling of designated initializer. (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D28705?vs=84418&id=84714#toc Repository: rL LLVM https://revie

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-17 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaCodeComplete.cpp:961 +// then incorrectly applied to the target declaration. This can be avoided +// by resetting the declaration that's being hidden. +if (Hiding && isa(Hiding)) I'm not sure ab

[PATCH] D28467: [Sema] Add warning for unused lambda captures

2017-01-18 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D28467#649861, @krasin wrote: > This change makes Clang hardly incompatible with MSVC++. Consider the > following program: > > #include > > int main(void) { > const int kDelta = 1001; > auto g = [kDelta](int i) >

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Looks good to me, but one more comment/question. Comment at: lib/Sema/SemaLookup.cpp:3433 + // is not hidden by the using declaration. + if (isa(ND) && isa(D)) +continue; Do we have to check that ND's UsingDecl is equ

[PATCH] D25556: [Sema] Add variable captured by a block to the enclosing lambda's potential capture list

2017-01-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added reviewers: ABataev, malcolm.parsons. ahatanak added a comment. Add a few more people who have looked at this part of clang in the past to the reviewers list. https://reviews.llvm.org/D25556 ___ cfe-commits mailing list cfe-commits@li

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I had something like the following code in mind (which is not invalid). Does usingdecl Bar::C hide Foo::C ? namespace Foo { class C { }; } namespace Bar { class C { }; } using Foo::C; { using Bar::C; } Repository: rL LLVM https://reviews.l

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. This is not invalid: namespace Foo { class C { }; } namespace Bar { class C { }; } void foo1() { using Foo::C; { using Bar::C; } } Repository: rL LLVM https://reviews.llvm.org/D28514 ___ cfe-c

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In the example I showed, wouldn't the DeclContext for all the UsingDecls and UsingShadowDecls be the FunctionDecl for foo1? Maybe you can check whether UsingShadowDecl::getUsingDecl() (which returns the UsingDecl which is tied to the UsingShadowDecl) is equal to the Us

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. If they are equal, the loop can continue because a UsingDecl doesn't hide a UsingShadowDecl that is tied to it. Repository: rL LLVM https://reviews.llvm.org/D28514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added a comment. This revision is now accepted and ready to land. Thanks LGTM. Repository: rL LLVM https://reviews.llvm.org/D28514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2017-01-24 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/CodeGen/CodeGenFunction.h:217 + /// statements. + llvm::SmallVector LabelSeenStack; + rjmccall wrote: > Shouldn't this be maintained by some existing scoping structure like > LexicalScope? I think I need a struct

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2017-01-24 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/CodeGen/CodeGenFunction.h:217 + /// statements. + llvm::SmallVector LabelSeenStack; + ahatanak wrote: > rjmccall wrote: > > Shouldn't this be maintained by some existing scoping structure like > > LexicalScope? >

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2017-01-24 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 85643. ahatanak marked an inline comment as done. ahatanak added a comment. To decide whether lifetime markers should be disabled, check whether the current LexicalScope has labels instead of introducing a new structure that keeps track of labels seen in th

[PATCH] D22391: [Sema] Add warning for implicitly casting a null constant to a non null pointer type

2017-01-24 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 85651. ahatanak added a reviewer: jordan_rose. ahatanak added a comment. Rebase. https://reviews.llvm.org/D22391 Files: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Sema/Sema.cpp

[PATCH] D22391: [Sema] Add warning for implicitly casting a null constant to a non null pointer type

2017-01-24 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: include/clang/Basic/DiagnosticGroups.td:290 def NullableToNonNullConversion : DiagGroup<"nullable-to-nonnull-conversion">; +def NullConstToNonnull : DiagGroup<"null-const-to-nonnull">; def NullabilityCompletenessOnArrays : DiagGroup<

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2017-01-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 85774. ahatanak marked 2 inline comments as done. ahatanak added a comment. Yes, we can make VarBypassDetector detect variables declared after labels too if we want to put all the logic for disabling lifetime markers in one place. https://reviews.llvm.org/

[PATCH] D27680: [CodeGen] Move lifetime.start of a variable when goto jumps back past its declaration

2017-01-25 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL293106: [CodeGen] Suppress emission of lifetime markers if a label has been seen (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D27680?vs=85774&id=85817#toc Repository: rL

[PATCH] D28050: [Clang][Driver] Clean up Clang::ConstructJob a little bit, NFC

2017-01-30 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I think this patch is an improvement, but Clang::ConstructJob is still one giant function. Do you have ideas to improve readability of this function or plans to further reduce its size? Repository: rL LLVM https://reviews.llvm.org/D28050 ___

[PATCH] D24969: [Sema] Use the instantiated name of destructors in FindInstantiatedDecl and RebuildMemberExpr

2017-01-31 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL293678: [Sema] Transform a templated name before looking it up in (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D24969?vs=82134&id=86474#toc Repository: rL LLVM https://r

[PATCH] D25556: [Sema] Add variable captured by a block to the enclosing lambda's potential capture list

2017-02-02 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 86918. ahatanak added a comment. Rebase https://reviews.llvm.org/D25556 Files: include/clang/Sema/Sema.h lib/Sema/Sema.cpp lib/Sema/SemaExpr.cpp test/SemaObjCXX/blocks.mm Index: test/SemaObjCXX/blocks.mm ==

[PATCH] D22391: [Sema] Add warning for implicitly casting a null constant to a non null pointer type

2017-02-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 87016. ahatanak marked 2 inline comments as done. ahatanak added a comment. Turning the warning on by default caused clang to issue warnings in many other cases, including Objective-C methods returning nil, which was something r240153 tried to avoid. If we

[PATCH] D29542: [TargetInfo] Adjust x86-32 atomic support to the CPU used

2017-02-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Basic/Targets.cpp:4244 +} else // allow locked atomics up to 4 bytes + MaxAtomicPromoteWidth = 32; + } mgorny wrote: > dim wrote: > > Are you purposefully not setting `MaxAtomicInlineWidth` here? (It seem

[PATCH] D29542: [TargetInfo] Adjust x86-32 atomic support to the CPU used

2017-02-06 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Basic/Targets.cpp:4244 +} else // allow locked atomics up to 4 bytes + MaxAtomicPromoteWidth = 32; + } mgorny wrote: > ahatanak wrote: > > mgorny wrote: > > > dim wrote: > > > > Are you purposefully not se

[PATCH] D29724: [Driver] Report available language standards on user error

2017-02-09 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Test case? Comment at: lib/Frontend/CompilerInvocation.cpp:1709 +Diags.Report(diag::note_drv_supported_value_with_description) + << Std.getName() << Std.getDescription(); + } Is it possible to change the diagnosti

[PATCH] D33606: [Sema] Fix a crash-on-invalid when a template parameter list has a class definition or non-reference class type

2017-06-26 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL306317: [Sema] Fix a crash-on-invalid when a template parameter list has a class (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D33606?vs=100465&id=104000#toc Repository: r

[PATCH] D34574: [Sema] Disable c++17 aligned new and delete operators if not implemented in the deployment target's c++ standard library

2017-06-26 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Duncan and I had a discussion on this. We are thinking about adding a warning that tells users that aligned allocation /deallocation operators are being called but they are not defined in the library. If the users haven't defined their own aligned allocation / dealloc

[PATCH] D34665: [CodeGen] Fix assertion failure in EmitCallArg

2017-06-26 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. The assertion is checking that the types of the parameter and argument match. It fails when a method of a parameterized class is called. To fix the failure, this patch moves the assertion in EmitCallArg to its only caller EmitCallArgs. Instead of moving the asser

[PATCH] D34665: [CodeGen] Fix assertion failure in EmitCallArg

2017-06-27 Thread Akira Hatanaka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL306494: [CodeGen] Fix assertion failure in EmitCallArg. (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D34665?vs=104086&id=104327#toc Repository: rL LLVM https://reviews.l

[PATCH] D34574: [Sema] Disable c++17 aligned new and delete operators if not implemented in the deployment target's c++ standard library

2017-06-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 104579. ahatanak added a comment. The updated patch produces diagnostics if an aligned allocation function is selected that is not implemented in the c++ standard library of the deployment target (except when the function is defined by the user and its defi

[PATCH] D34574: [Sema] Disable c++17 aligned new and delete operators if not implemented in the deployment target's c++ standard library

2017-06-28 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I'll revert the changes I made to libc++ that annotates the allocation functions with availability later. https://reviews.llvm.org/D34574 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bi

<    6   7   8   9   10   11   12   13   >