]> granicus.if.org Git - clang/log
clang
7 years ago[CodeGen][ARM] Make sure the value and type used to create a bitcast
Akira Hatanaka [Thu, 1 Dec 2016 19:25:14 +0000 (19:25 +0000)]
[CodeGen][ARM] Make sure the value and type used to create a bitcast
have the same size.

This fixes an asset that is triggered when an address of a boolean
variable is passed to __builtin_arm_ldrex or __builtin_arm_strex.

rdar://problem/29269006

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288404 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[clang] Implement support for -defsym assembler option
Mandeep Singh Grang [Thu, 1 Dec 2016 18:42:16 +0000 (18:42 +0000)]
[clang] Implement support for -defsym assembler option

Summary:
Adds support for -Wa,-defsym,abc=1 option.

Related llvm patch: https://reviews.llvm.org/D26214

Reviewers: rafael, t.p.northover, colinl, echristo, compnerd, rengolin

Subscribers: mehdi_amini

Tags: #clang-c

Differential Revision: https://reviews.llvm.org/D26213

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288397 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoswiftcc: Add an api to query whether a target ABI stores swifterror in a register
Arnold Schwaighofer [Thu, 1 Dec 2016 18:07:38 +0000 (18:07 +0000)]
swiftcc: Add an api to query whether a target ABI stores swifterror in a register

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288394 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix VS2015 build of clang-format-vsix by using NuGet to pull in required assemblies
Hans Wennborg [Thu, 1 Dec 2016 18:05:41 +0000 (18:05 +0000)]
Fix VS2015 build of clang-format-vsix by using NuGet to pull in required assemblies

Also added a gitignore to help track the right items to commit.

Patch by Antonio Maiorano <amaiorano@gmail.com>!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288393 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[TableGen] Ignore fake args for parsing-related arg counts.
George Burgess IV [Thu, 1 Dec 2016 17:52:39 +0000 (17:52 +0000)]
[TableGen] Ignore fake args for parsing-related arg counts.

We should complain about the following:

```
void foo() __attribute__((unavailable("a", "b")));
```

Instead, we currently just ignore "b". (...We also end up ignoring "a",
because we assume elsewhere that this attribute can only have 1 or 0
args.)

This happens because `unavailable` has a fake enum arg, and
`AttributeList::{getMinArgs,getMaxArgs}` include fake args in their
counts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288388 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Drop explicit mention of range constraint solver
Dominic Chen [Thu, 1 Dec 2016 17:06:39 +0000 (17:06 +0000)]
[analyzer] Drop explicit mention of range constraint solver

Summary: The basic constraint solver was dropped in rL162384, leaving the range constraint solver as the default and only constraint solver. Explicitly specifying it is unnecessary, and makes it difficult to test with other solver backends.

Reviewers: zaks.anna, dcoughlin

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D26694

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288372 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdds hasUnqualifiedDesugaredType to allow matching through type sugar.
Manuel Klimek [Thu, 1 Dec 2016 15:45:06 +0000 (15:45 +0000)]
Adds hasUnqualifiedDesugaredType to allow matching through type sugar.

Differential Revision: https://reviews.llvm.org/D27207

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288366 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ObjC] Avoid a @try/@finally/@autoreleasepool fixit when parsing an expression
Alex Lorenz [Thu, 1 Dec 2016 12:14:38 +0000 (12:14 +0000)]
[ObjC] Avoid a @try/@finally/@autoreleasepool fixit when parsing an expression

This patch ensures that the typo fixit for the @try/@finally/@autoreleasepool {}
directive is shown only when we're parsing an actual statement where such
directives can actually be present.

rdar://19669565

Differential Revision: https://reviews.llvm.org/D26916

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288334 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OpenCL] Refactor read_only/write_only pipes.
Joey Gouly [Thu, 1 Dec 2016 11:30:49 +0000 (11:30 +0000)]
[OpenCL] Refactor read_only/write_only pipes.

This adds the access qualifier to the Pipe Type, rather than using a class
hierarchy.

It also fixes mergeTypes for Pipes, by disallowing merges. Only identical
pipe types can be merged. The test case in invalid-pipes-cl2.0.cl is added
to check that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288332 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix crash with unsupported architectures in Linux/Gnu target triples.
Florian Hahn [Thu, 1 Dec 2016 11:02:59 +0000 (11:02 +0000)]
Fix crash with unsupported architectures in Linux/Gnu target triples.

Summary: This patch adds a check and an error message to gnutools::Linker::ConstructJob in case the architecture is not supported. For most other operating systems, the error message is created in lib/Basic/Targets.cpp:AllocateTarget, but when construction the linker arguments for the gnutools linker a supported architecture is required.

Reviewers: rafael, joerg, echristo

Subscribers: mehdi_amini, joerg, dschuff, cfe-commits

Differential Revision: https://reviews.llvm.org/D27066

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288327 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTeach ConstantBuilder how to emit a reference to the current position
John McCall [Thu, 1 Dec 2016 05:33:30 +0000 (05:33 +0000)]
Teach ConstantBuilder how to emit a reference to the current position
that will be filled in when the initializer is set.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288313 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoP0012R1: add Itanium ABI support for throwing non-noexcept function pointers and...
Richard Smith [Thu, 1 Dec 2016 03:32:42 +0000 (03:32 +0000)]
P0012R1: add Itanium ABI support for throwing non-noexcept function pointers and catching as noexcept.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288305 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r285664, cxx-abi-dev chose to go in a different direction for the ABI here.
Richard Smith [Thu, 1 Dec 2016 03:04:07 +0000 (03:04 +0000)]
Revert r285664, cxx-abi-dev chose to go in a different direction for the ABI here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288304 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoPR31081: ignore exception specifications when deducing function template
Richard Smith [Thu, 1 Dec 2016 02:11:49 +0000 (02:11 +0000)]
PR31081: ignore exception specifications when deducing function template
arguments from a declaration; despite what the standard says, this form of
deduction should not be considering exception specifications.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288301 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[TableGen] Minor clean-ups. NFC.
George Burgess IV [Thu, 1 Dec 2016 00:13:18 +0000 (00:13 +0000)]
[TableGen] Minor clean-ups. NFC.

Primarily: try to use DenseSet<StringRef> instead of
std::set<std::string>, and use pretty range algos where we can.

Small sizes were arbitrarily chosen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288297 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoClean up CGObjCMac's APIs for deriving class references. NFC.
John McCall [Wed, 30 Nov 2016 23:54:50 +0000 (23:54 +0000)]
Clean up CGObjCMac's APIs for deriving class references.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288295 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OpenMP] Sema and parsing for 'teams distribute parallel for simd' pragma
Kelvin Li [Wed, 30 Nov 2016 23:51:03 +0000 (23:51 +0000)]
[OpenMP] Sema and parsing for 'teams distribute parallel for simd' pragma

This patch is to implement sema and parsing for 'teams distribute parallel for simd' pragma.

Differential Revision: https://reviews.llvm.org/D27084

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288294 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoIntroduce a type-safe enum for ForDefinition.
John McCall [Wed, 30 Nov 2016 23:25:13 +0000 (23:25 +0000)]
Introduce a type-safe enum for ForDefinition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288289 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix some layering violations where CGObjCMac's NSString emission was
John McCall [Wed, 30 Nov 2016 23:15:55 +0000 (23:15 +0000)]
Fix some layering violations where CGObjCMac's NSString emission was
performed at the CodeGenModule level.

Would be NFC except we now also use a different uniquing structure so
that we don't get spurious conflicts if you ask for both an NSString
and a CFString for the same content (which is possible with builtins).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288287 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoProspective MSVC workaround.
John McCall [Wed, 30 Nov 2016 20:46:55 +0000 (20:46 +0000)]
Prospective MSVC workaround.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288272 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFinish adopting ConstantInitBuilder in CGObjCGNU. NFC.
John McCall [Wed, 30 Nov 2016 20:19:46 +0000 (20:19 +0000)]
Finish adopting ConstantInitBuilder in CGObjCGNU.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288269 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Sema] Teach -Wcast-align to look at the aligned attribute of the
Akira Hatanaka [Wed, 30 Nov 2016 19:42:03 +0000 (19:42 +0000)]
[Sema] Teach -Wcast-align to look at the aligned attribute of the
declared variables.

Teach Sema to check the aligned attribute attached to variable
declarations so that it doesn't issue spurious warnings.

rdar://problem/26517471

Differential revision: https://reviews.llvm.org/D21099

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288267 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Construct temporary objects of correct types, destroy them properly.
Artem Dergachev [Wed, 30 Nov 2016 19:02:44 +0000 (19:02 +0000)]
[analyzer] Construct temporary objects of correct types, destroy them properly.

When constructing a temporary object region, which represents the result of
MaterializeTemporaryExpr, track down the sub-expression for which the temporary
is necessary with a trick similar to the approach used in CodeGen, namely
by using Expr::skipRValueSubobjectAdjustments().

Then, create the temporary object region with type of that sub-expression.
That type would propagate further in a path-sensitive manner.

During destruction of lifetime-extened temporaries, consult the type of
the temporary object region, rather than the type of the lifetime-extending
variable, in order to call the correct destructor (fixes pr17001) and,
at least, not to crash by trying to call a destructor of a plain type
(fixes pr19539).

rdar://problem/29131302
rdar://problem/29131576

Differential Revision: https://reviews.llvm.org/D26839

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288263 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] SValExplainer: Support ObjC ivars and __block variables.
Artem Dergachev [Wed, 30 Nov 2016 18:26:43 +0000 (18:26 +0000)]
[analyzer] SValExplainer: Support ObjC ivars and __block variables.

Additionally, explain the difference between normal and heap-based
symbolic regions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288260 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Minor fixes and improvements to debug.ExprInspection
Artem Dergachev [Wed, 30 Nov 2016 17:57:18 +0000 (17:57 +0000)]
[analyzer] Minor fixes and improvements to debug.ExprInspection

- Fix the bug with transition handling in ExprInspectionChecker's
  checkDeadSymbols implementation.

- Test this bug by adding a new function clang_analyzer_numTimesReached() to
  catch number of passes through the code, which should be handy for testing
  against unintended state splits.

- Add two more functions should help debugging issues quickly without running
  the debugger or dumping exploded graphs - clang_analyzer_dump() which dump()s
  an SVal argument to a warning message, and clang_analyzer_printState(), which
  dump()s the current program state to stderr.

Differential Revision: https://reviews.llvm.org/D26835

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288257 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoProspective GCC build fix: the unelaborated form of this friend
John McCall [Wed, 30 Nov 2016 04:18:19 +0000 (04:18 +0000)]
Prospective GCC build fix: the unelaborated form of this friend
declaration should find the right type, assuming it's supported
evenly across all our hosts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288231 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agomake -fprofile-instr-generate and -fprofile-instr-use work with clang-cl
Bob Haarman [Wed, 30 Nov 2016 03:25:36 +0000 (03:25 +0000)]
make -fprofile-instr-generate and -fprofile-instr-use work with clang-cl

Summary: Makes -fprofile-instr-generate and -fprofile-instr-use work
with clang-cl so that profile-guided optimization can be used.

Differential Revision: https://reviews.llvm.org/D27086

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288230 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSwitch CGObjCMac to use ConstantInitBuilder. Whew.
John McCall [Wed, 30 Nov 2016 02:39:18 +0000 (02:39 +0000)]
Switch CGObjCMac to use ConstantInitBuilder.  Whew.

Not strictly NFC because I did change the order of emission of
some global constants, but it shouldn't make any difference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288229 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix -Winconsistent-missing-override in CodeGenAction.cpp
Reid Kleckner [Wed, 30 Nov 2016 01:32:53 +0000 (01:32 +0000)]
Fix -Winconsistent-missing-override in CodeGenAction.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288227 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix formatting issue from r288207
Hans Wennborg [Wed, 30 Nov 2016 00:31:39 +0000 (00:31 +0000)]
Fix formatting issue from r288207

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288223 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoGive this test that uses Itanium mangling a triple
Reid Kleckner [Wed, 30 Nov 2016 00:31:16 +0000 (00:31 +0000)]
Give this test that uses Itanium mangling a triple

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288222 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoStop handling interesting deserialized decls after HandleTranslationUnit
Reid Kleckner [Wed, 30 Nov 2016 00:25:36 +0000 (00:25 +0000)]
Stop handling interesting deserialized decls after HandleTranslationUnit

Other AST consumers can deserialize interesting decls that we might
codegen, but they won't make it to the final object file and can trigger
assertions in debug information generation after finalization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288221 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[c++1z] Improve support for -fno-exceptions: we can't just ignore exception
Richard Smith [Wed, 30 Nov 2016 00:13:55 +0000 (00:13 +0000)]
[c++1z] Improve support for -fno-exceptions: we can't just ignore exception
specifications in this mode in C++17, since they're part of the function type,
so check and diagnose them like we would if exceptions were enabled.

Better ideas welcome.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288220 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix some Clang-tidy and Include What You Use warnings; other minor fixes (NFC).
Eugene Zelenko [Tue, 29 Nov 2016 22:44:24 +0000 (22:44 +0000)]
Fix some Clang-tidy and Include What You Use warnings; other minor fixes (NFC).

This preparation to remove SetVector.h dependency on SmallSet.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288213 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[c++1z] PR31210: ignore exception specification when matching the type of a
Richard Smith [Tue, 29 Nov 2016 22:32:05 +0000 (22:32 +0000)]
[c++1z] PR31210: ignore exception specification when matching the type of a
builtin with the type of an explicit declaration of the same function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288208 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDon't try to merge DLL attributes on redeclaration of invalid decl (PR31069)
Hans Wennborg [Tue, 29 Nov 2016 22:31:00 +0000 (22:31 +0000)]
Don't try to merge DLL attributes on redeclaration of invalid decl (PR31069)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288207 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agogetObjCEncodingForMethodDecl cannot fail. Simplify. NFC.
John McCall [Tue, 29 Nov 2016 21:57:00 +0000 (21:57 +0000)]
getObjCEncodingForMethodDecl cannot fail.  Simplify.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288203 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDon't declare IsEnumDeclComplete as extern
Reid Kleckner [Tue, 29 Nov 2016 20:46:24 +0000 (20:46 +0000)]
Don't declare IsEnumDeclComplete as extern

Otherwise MSVC and clang-cl will see "extern inline" after merging
redeclarations and emit it in all TUs that include Type.h and Decl.h.

Noticed by inspection, since it's always the first thing to get emitted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288197 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSupport constant expression evaluation for wchar_t versions of simple string
Richard Smith [Tue, 29 Nov 2016 19:45:17 +0000 (19:45 +0000)]
Support constant expression evaluation for wchar_t versions of simple string
functions, in order to support constexpr std::char_traits<wchar_t>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288193 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OpenCL] Prevent generation of globals in non-constant AS for OpenCL.
Anastasia Stulova [Tue, 29 Nov 2016 17:01:19 +0000 (17:01 +0000)]
[OpenCL] Prevent generation of globals in non-constant AS for OpenCL.

Avoid using shortcut for const qualified non-constant address space
aggregate variables while generating them on the stack such that
the alloca object is used instead of a global variable containing
initializer.

Review: https://reviews.llvm.org/D27109

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288163 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AST] Use static_assert to verify types instead of undefined classes.
Benjamin Kramer [Tue, 29 Nov 2016 12:41:21 +0000 (12:41 +0000)]
[AST] Use static_assert to verify types instead of undefined classes.

No functionliaty change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288133 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OpenCL] Prohibit using reserve_id_t in program scope.
Alexey Bader [Tue, 29 Nov 2016 10:21:40 +0000 (10:21 +0000)]
[OpenCL] Prohibit using reserve_id_t in program scope.

Patch by Egor Churaev (echuraev).

Reviewers: Anastasia

Subscribers: cfe-commits, yaxunl, bader

Differential Revision: https://reviews.llvm.org/D27099

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288126 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemoved DEBUG_TYPE from TokenAnalyzer.h
Krasimir Georgiev [Tue, 29 Nov 2016 10:21:28 +0000 (10:21 +0000)]
Removed DEBUG_TYPE from TokenAnalyzer.h

Summary:
Defining DEBUG_TYPE in a header file doesn't make sense.
It is already defined in the corresponding source file.

Reviewers: klimek, ioeric

Subscribers: klimek

Differential Revision: https://reviews.llvm.org/D27164

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288125 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCorrect comment: we are creating a canonicla decltypetype.
Yaron Keren [Tue, 29 Nov 2016 10:08:20 +0000 (10:08 +0000)]
Correct comment: we are creating a canonicla decltypetype.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288124 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoclang-format: [JS] Properly format dict literals that skip labels.
Daniel Jasper [Tue, 29 Nov 2016 09:40:36 +0000 (09:40 +0000)]
clang-format: [JS] Properly format dict literals that skip labels.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288121 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoclang-format: Wrap complex binary expressions on the RHS of a comma.
Daniel Jasper [Tue, 29 Nov 2016 09:40:32 +0000 (09:40 +0000)]
clang-format: Wrap complex binary expressions on the RHS of a comma.

Specifically, if the RHS of a comma is a complex binary expression and
spans multiple lines, insert a line break before it. This usually is
often more readable compared to producing a hanging indent. See changes
in FormatTest.cpp for examples.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288120 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoclang-format: Fix unnnecessary line break.
Daniel Jasper [Tue, 29 Nov 2016 09:40:01 +0000 (09:40 +0000)]
clang-format: Fix unnnecessary line break.

Before:
  aaaaaaaaaa(aaaa(aaaa,
  aaaa), //
     aaaa,
             aaaaa);

After:
  aaaaaaaaaa(aaaa(aaaa,
  aaaa), //
     aaaa, aaaaa);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288119 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd a warning for 'main' returning 'true' or 'false'.
Richard Smith [Tue, 29 Nov 2016 01:35:17 +0000 (01:35 +0000)]
Add a warning for 'main' returning 'true' or 'false'.

Patch by Joshua Hurwitz!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288097 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse ${:uid} to generate unique MS asm labels, not {:uid}
Reid Kleckner [Tue, 29 Nov 2016 00:39:37 +0000 (00:39 +0000)]
Use ${:uid} to generate unique MS asm labels, not {:uid}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288093 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAvoid lambdas in default member initializers to work around clang bug
Reid Kleckner [Mon, 28 Nov 2016 23:58:04 +0000 (23:58 +0000)]
Avoid lambdas in default member initializers to work around clang bug

On Windows, Clang is mangling lambdas in default member initializers
incorrectly. See PR31197.

This is causing redness on the self-host bots. Work around the problem
locally so we aren't blind to further issues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288089 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoIRGen: Remove all uses of CreateDefaultAlignedLoad.
Peter Collingbourne [Mon, 28 Nov 2016 22:30:21 +0000 (22:30 +0000)]
IRGen: Remove all uses of CreateDefaultAlignedLoad.

Differential Revision: https://reviews.llvm.org/D27157

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288083 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMake CGVTables use ConstantInitBuilder. NFC.
John McCall [Mon, 28 Nov 2016 22:18:33 +0000 (22:18 +0000)]
Make CGVTables use ConstantInitBuilder.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288081 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoHide the result of building a constant initializer. NFC.
John McCall [Mon, 28 Nov 2016 22:18:30 +0000 (22:18 +0000)]
Hide the result of building a constant initializer.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288080 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoConstantBuilder -> ConstantInitBuilder for clarity, and
John McCall [Mon, 28 Nov 2016 22:18:27 +0000 (22:18 +0000)]
ConstantBuilder -> ConstantInitBuilder for clarity, and
move the member classes up to top level to allow forward
declarations to name them.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288079 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Driver] Add unit tests for Distro detection
Michal Gorny [Mon, 28 Nov 2016 21:11:22 +0000 (21:11 +0000)]
[Driver] Add unit tests for Distro detection

Add a set of unit tests for the distro detection code. The tests use an
in-memory virtual filesystems resembling release files for various
distributions supported. All release files are provided (not only the
ones directly used) in order to guarantee that one of the rules will not
mistakenly recognize the distribution incorrectly due to the additional
files (e.g. Ubuntu as Debian).

Differential Revision: https://reviews.llvm.org/D25869

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288062 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Driver] Fix recognizing newer OpenSUSE versions
Michal Gorny [Mon, 28 Nov 2016 21:11:18 +0000 (21:11 +0000)]
[Driver] Fix recognizing newer OpenSUSE versions

Fix recognizing newer OpenSUSE versions that combine the two version
components into 'VERSION = x.y'. The check was written against an older
version that kept those two split as VERSION and PATCHLEVEL.

Differential Revision: https://reviews.llvm.org/D26850

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288061 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Driver] Refactor distro detection & classification as a separate API
Michal Gorny [Mon, 28 Nov 2016 21:11:14 +0000 (21:11 +0000)]
[Driver] Refactor distro detection & classification as a separate API

Refactor the Distro enum along with helper functions into a full-fledged
Distro class, inspired by llvm::Triple, and make it a public API.
The new class wraps the enum with necessary comparison operators, adding
the convenience Is*() methods and a constructor performing
the detection. The public API is needed to run the unit tests (D25869).

Differential Revision: https://reviews.llvm.org/D25949

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288060 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[MS] Mangle a unique ID into all MS inline asm labels
Reid Kleckner [Mon, 28 Nov 2016 20:52:19 +0000 (20:52 +0000)]
[MS] Mangle a unique ID into all MS inline asm labels

This solves PR23715 in a way that is compatible with LTO.

MSVC supports jumping to source-level labels and between inline asm
blocks, but we don't.

Also revert the old solution, r255201, which was to mark these calls as
noduplicate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288059 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Fix for PR31137: Wrong DSA for members in struct.
Alexey Bataev [Mon, 28 Nov 2016 15:55:15 +0000 (15:55 +0000)]
[OPENMP] Fix for PR31137: Wrong DSA for members in struct.

If member expression is used in the task region and the base expression
is a DeclRefExp and the variable used in this ref expression is private,
it should be marked as implicitly firstprivate inside this region. Patch
fixes this issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288039 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Sema] Set range end of constructors and destructors in template instantiations
Malcolm Parsons [Mon, 28 Nov 2016 11:11:34 +0000 (11:11 +0000)]
[Sema] Set range end of constructors and destructors in template instantiations

Summary:
clang-tidy checks frequently use source ranges of functions.
The source range of constructors and destructors in template instantiations
is currently a single token.
The factory method for constructors and destructors does not allow the
end source location to be specified.
Set end location manually after creating instantiation.

Reviewers: aaron.ballman, rsmith, arphaman

Subscribers: arphaman, cfe-commits

Differential Revision: https://reviews.llvm.org/D26849

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288025 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdjust type-trait evaluation to properly handle Using(Shadow)Decls
Hal Finkel [Sun, 27 Nov 2016 16:26:14 +0000 (16:26 +0000)]
Adjust type-trait evaluation to properly handle Using(Shadow)Decls

Since r274049, for an inheriting constructor declaration, the name of the using
declaration (and using shadow declaration comes from the using declaration) is
the name of a derived class, not the base class (line 8225-8232 of
lib/Sema/SemaDeclCXX.cpp in https://reviews.llvm.org/rL274049). Because of
this, name-based lookup performed inside Sema::LookupConstructors returns not
only CXXConstructorDecls but also Using(Shadow)Decls, which results assertion
failure reported in PR29087.

Patch by Taewook Oh, thanks!

Differential Revision: https://reviews.llvm.org/D23765

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287999 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DOXYGEN] Updated instruction names corresponding to avxintrin.h intrinsics.
Ekaterina Romanova [Sat, 26 Nov 2016 19:38:19 +0000 (19:38 +0000)]
[DOXYGEN] Updated instruction names corresponding to avxintrin.h intrinsics.

Documentation for some of the avxintrin.h's intrinsics errorneously said that
non VEX-prefixed instructions could be generated. This was fixed.

I tried several different solutions to achieve pretty printing of unordered lists (nested and non-nested) in param sections in doxygen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287990 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTypo.
Joerg Sonnenberger [Fri, 25 Nov 2016 20:15:57 +0000 (20:15 +0000)]
Typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287947 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDo not do raw name replacement when FromDecl is a class forward-declaration.
Eric Liu [Fri, 25 Nov 2016 16:02:49 +0000 (16:02 +0000)]
Do not do raw name replacement when FromDecl is a class forward-declaration.

Summary:
If the `FromDecl` is a class forward declaration, the reference is
still considered as referring to the original definition given the nature
of forward-declarations, so we can't do a raw name replacement in this case.

Reviewers: bkramer

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D27132

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287929 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDocument the arguments form of commands.
Joerg Sonnenberger [Fri, 25 Nov 2016 14:14:43 +0000 (14:14 +0000)]
Document the arguments form of commands.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287926 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoConsider nested namespaces in the canonical namespace as canonical as well.
Eric Liu [Fri, 25 Nov 2016 12:39:03 +0000 (12:39 +0000)]
Consider nested namespaces in the canonical namespace as canonical as well.

Summary:
For example, this case was missed when looking for different but canonical
namespaces. UseContext in this case should be considered as in the canonical
namespace.
```
namespace a { namespace b { <FromContext> } }
namespace a { namespace b { namespace c { <UseContext> } } }
```
Added some commenting.

Reviewers: bkramer

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D27125

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287924 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeGen] Pass objects that are expensive to copy by const ref.
Benjamin Kramer [Thu, 24 Nov 2016 16:01:20 +0000 (16:01 +0000)]
[CodeGen] Pass objects that are expensive to copy by const ref.

No functionality change. Found by clang-tidy's
performance-unnecessary-value-param.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287894 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Format] Avoid copying std::sets and simplify code a bit.
Benjamin Kramer [Thu, 24 Nov 2016 15:42:29 +0000 (15:42 +0000)]
[Format] Avoid copying std::sets and simplify code a bit.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287892 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Sema] Pass APSInts by const ref, avoiding copies.
Benjamin Kramer [Thu, 24 Nov 2016 15:36:17 +0000 (15:36 +0000)]
[Sema] Pass APSInts by const ref, avoiding copies.

No functionality change intended. Fix by clang-tidy's
performance-unnecessary-value-param check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287890 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PPC] support for arithmetic builtins in the FE
Ehsan Amiri [Thu, 24 Nov 2016 12:40:04 +0000 (12:40 +0000)]
[PPC] support for arithmetic builtins in the FE

(commit again after fixing the buildbot failures)
This adds various overloads of the following builtins to altivec.h:

    vec_neg
    vec_nabs
    vec_adde
    vec_addec
    vec_sube
    vec_subec
    vec_subc

Note that for vec_sub builtins on 32 bit integers, the semantics is similar to
what ISA describes for instructions like vsubecuq that work on quadwords: the
first operand is added to the one's complement of the second operand. (As
opposed to two's complement which I expected).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287872 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ASTDumper] Add some more character escapes for convenience.
Benjamin Kramer [Thu, 24 Nov 2016 09:41:33 +0000 (09:41 +0000)]
[ASTDumper] Add some more character escapes for convenience.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287859 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove comments (NFC)
Kelvin Li [Thu, 24 Nov 2016 03:18:07 +0000 (03:18 +0000)]
Remove comments (NFC)

Differential Revision: https://reviews.llvm.org/D27006

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287852 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMake these tests work more reliably with Release builds.
Douglas Yung [Thu, 24 Nov 2016 01:53:38 +0000 (01:53 +0000)]
Make these tests work more reliably with Release builds.

Differential Revision: https://reviews.llvm.org/D26827

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287851 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSpelling.
Joerg Sonnenberger [Thu, 24 Nov 2016 01:24:38 +0000 (01:24 +0000)]
Spelling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287847 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PPC] revert r287795
Ehsan Amiri [Wed, 23 Nov 2016 18:55:17 +0000 (18:55 +0000)]
[PPC] revert r287795

A test that passed locally is failing on one of the build bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287796 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PPC] support for arithmetic builtins in the FE
Ehsan Amiri [Wed, 23 Nov 2016 18:36:29 +0000 (18:36 +0000)]
[PPC] support for arithmetic builtins in the FE

(commit again after fixing the buildbot failures)
This adds various overloads of the following builtins to altivec.h:

    vec_neg
    vec_nabs
    vec_adde
    vec_addec
    vec_sube
    vec_subec
    vec_subc

Note that for vec_sub builtins on 32 bit integers, the semantics is similar to
what ISA describes for instructions like vsubecuq that work on quadwords: the
first operand is added to the one's complement of the second operand. (As
opposed to two's complement which I expected).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287795 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd dllexport default ctor closure PCH regression test for PR31121
Reid Kleckner [Wed, 23 Nov 2016 18:33:54 +0000 (18:33 +0000)]
Add dllexport default ctor closure PCH regression test for PR31121

Follow up to r287774

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287793 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Sema][Atomics] Treat expected pointer in compare exchange atomics as _Nonnull
Alex Lorenz [Wed, 23 Nov 2016 16:57:03 +0000 (16:57 +0000)]
[Sema][Atomics] Treat expected pointer in compare exchange atomics as _Nonnull

This commit teaches clang that is has to emit a warning when NULL is passed
as the 'expected' pointer parameter into an atomic compare exchange call.

rdar://18926650

Differential Revision: https://reviews.llvm.org/D26978

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287776 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PPC] Reverting r287772
Ehsan Amiri [Wed, 23 Nov 2016 16:56:03 +0000 (16:56 +0000)]
[PPC] Reverting r287772

Due to buildbot failure, I revert. Will recommit after investigation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287775 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove C++ default arg side table for MS ABI ctor closures
Reid Kleckner [Wed, 23 Nov 2016 16:51:30 +0000 (16:51 +0000)]
Remove C++ default arg side table for MS ABI ctor closures

Summary:
We don't need a side table in ASTContext to hold CXXDefaultArgExprs. The
important part of building the CXXDefaultArgExprs was to ODR use the
default argument expressions, not to make AST nodes. Refactor the code
to only check the default argument, and remove the side table in
ASTContext which wasn't being serialized.

Fixes PR31121

Reviewers: thakis, rsmith, majnemer

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D27007

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287774 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PPC] support for arithmetic builtins in the FE
Ehsan Amiri [Wed, 23 Nov 2016 16:32:05 +0000 (16:32 +0000)]
[PPC] support for arithmetic builtins in the FE

This adds various overloads of the following builtins to altivec.h:

    vec_neg
    vec_nabs
    vec_adde
    vec_addec
    vec_sube
    vec_subec
    vec_subc

Note that for vec_sub builtins on 32 bit integers, the semantics is similar to
what ISA describes for instructions like vsubecuq that work on quadwords: the
first operand is added to the one's complement of the second operand. (As
opposed to two's complement which I expected).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287772 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeCompletion] Fix incorrect Objective-C block parameter formatting
Alex Lorenz [Wed, 23 Nov 2016 16:28:34 +0000 (16:28 +0000)]
[CodeCompletion] Fix incorrect Objective-C block parameter formatting

This commit fixes an incorrectly formatted Objective-C block parameter
placeholder in a code completion result. The incorrect parameter had a
redundant leading parenthesis.

rdar://25224416

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287771 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ASTImporter] Added ability to import AtomicType nodes
Gabor Horvath [Wed, 23 Nov 2016 15:24:23 +0000 (15:24 +0000)]
[ASTImporter] Added ability to import AtomicType nodes

Patch by: Kareem Khazem

Differential Revision: https://reviews.llvm.org/D26328

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287763 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][AVX512VL] Add missing _mm256_maskz_alignr_epi64 shufflevector check
Simon Pilgrim [Wed, 23 Nov 2016 11:38:52 +0000 (11:38 +0000)]
[X86][AVX512VL] Add missing _mm256_maskz_alignr_epi64 shufflevector check

Missed in rL287733

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287755 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeGen] Simplify code. No functionality change intended.
Benjamin Kramer [Wed, 23 Nov 2016 11:20:27 +0000 (11:20 +0000)]
[CodeGen] Simplify code. No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287754 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Replace valignd/q builtins with appropriate __builtin_shufflevector.
Craig Topper [Wed, 23 Nov 2016 01:47:12 +0000 (01:47 +0000)]
[X86] Replace valignd/q builtins with appropriate __builtin_shufflevector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287733 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMake diagnostic for use of default member initializer before enclosing class is
Richard Smith [Tue, 22 Nov 2016 22:55:12 +0000 (22:55 +0000)]
Make diagnostic for use of default member initializer before enclosing class is
complete a little more general; it is produced in other cases than the one that
it previously talked about.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287713 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove variable only used in an assertion.
John McCall [Tue, 22 Nov 2016 20:12:32 +0000 (20:12 +0000)]
Remove variable only used in an assertion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287691 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd test for D21736.
Marcin Koscielnicki [Tue, 22 Nov 2016 20:03:40 +0000 (20:03 +0000)]
Add test for D21736.

Differential Revision: http://reviews.llvm.org/D21741

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287689 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeGen] Insert TargetLibraryInfoWrapperPass before anything else.
Marcin Koscielnicki [Tue, 22 Nov 2016 20:03:35 +0000 (20:03 +0000)]
[CodeGen] Insert TargetLibraryInfoWrapperPass before anything else.

Currently, TargetLibraryInfoWrapperPass is inserted by PMBuilder.
However, some passes are inserted manually before the PMBuilder
ones - if any of them happens to use TargetLibraryInfoWrapperPass,
it'll get a default-constructed one, with an unknown target triple.
This happens to InstrProfiling in D21736, breaking it.

Differential Revision: http://reviews.llvm.org/D21737

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287688 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agodarwin: Unconditionally pass -lto_library, remove -Wliblto warning.
Nico Weber [Tue, 22 Nov 2016 19:38:07 +0000 (19:38 +0000)]
darwin: Unconditionally pass -lto_library, remove -Wliblto warning.

https://reviews.llvm.org/D25932 made it so that clang always checks if
libLTO.dylib is present on disk, even if -flto is not being used. The
motivation for that change was that if a dependency happens to contain bitcode,
ld64 will try to load libLTO without -flto explicitly being enabled. However,
the change had the undesirable side effect of warning if libLTO.dylib doesn't
exist even if it isn't needed.

Change things so that -lto_library is always passes, independent of if it
exists or not. ld64 only looks at this flag if it uses LTO. If the dylib
exists, all is well. If it doesn't, and LTO is not being used, all is well too.
If ld64 does end up using LTO and the dylib does not exist, ld64 will print
something like

    ld: could not process llvm bitcode object file, because foo/libLTO.dylib could not be loaded file 'test.o' for architecture x86_64

https://reviews.llvm.org/D26984

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287685 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMake llvm::Error generated from replacement interfaces more specific.
Eric Liu [Tue, 22 Nov 2016 13:46:42 +0000 (13:46 +0000)]
Make llvm::Error generated from replacement interfaces more specific.

Summary:
The new error information contains the type of error (e.g. overlap or bad file path)
and the replacement(s) that is causing the error. This enables us to resolve some errors.
For example, for insertion at the same location conflict, we need to know the
existing replacement which conflicts with the new replacement in order to calculate
the new position to be insert before/after the existing replacement (for merging).

Reviewers: klimek, bkramer

Subscribers: djasper, cfe-commits

Differential Revision: https://reviews.llvm.org/D26853

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287639 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMissing initializer.
Axel Naumann [Tue, 22 Nov 2016 10:00:23 +0000 (10:00 +0000)]
Missing initializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287633 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRename option to -lto-pass-remarks-output
Adam Nemet [Tue, 22 Nov 2016 07:35:19 +0000 (07:35 +0000)]
Rename option to -lto-pass-remarks-output

The new option -pass-remarks-output broke LLVM_LINK_LLVM_DYLIB because
of the duplicate option name with opt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287628 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Fix a crash on accessing a field within a literal-initialized union.
Artem Dergachev [Tue, 22 Nov 2016 04:29:23 +0000 (04:29 +0000)]
[analyzer] Fix a crash on accessing a field within a literal-initialized union.

Because in case of unions we currently default-bind compound values in the
store, this quick fix avoids the crash for this case.

Patch by Ilya Palachev and independently by Alexander Shaposhnikov!

Differential Revision: https://reviews.llvm.org/D26442

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287618 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix -Asserts build, and add some more test cases.
Peter Collingbourne [Tue, 22 Nov 2016 00:43:30 +0000 (00:43 +0000)]
Fix -Asserts build, and add some more test cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287602 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSema, CodeGen: Ensure that an implicit copy ctor is available more often under the...
Peter Collingbourne [Tue, 22 Nov 2016 00:21:43 +0000 (00:21 +0000)]
Sema, CodeGen: Ensure that an implicit copy ctor is available more often under the Microsoft C++ ABI.

This is needed because whether the constructor is deleted can control whether
we pass structs by value directly.

To fix this properly we probably want a more direct way for CodeGen to ask
whether the constructor was deleted.

Fixes PR31049.

Differential Revision: https://reviews.llvm.org/D26822

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287600 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoIndicate in AST dump whether special member functions are defaulted and trivial.
Richard Smith [Mon, 21 Nov 2016 23:43:54 +0000 (23:43 +0000)]
Indicate in AST dump whether special member functions are defaulted and trivial.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287599 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ObjC] Prevent infinite loops when iterating over redeclaration
Alex Lorenz [Mon, 21 Nov 2016 11:16:30 +0000 (11:16 +0000)]
[ObjC] Prevent infinite loops when iterating over redeclaration
of a method that was declared in an invalid interface

This commit fixes an infinite loop that occurs when clang tries to iterate over
redeclaration of a method that was declared in an invalid @interface. The
existing validity checks don't catch this as that @interface is a duplicate of
a previously declared valid @interface declaration, so we have to verify that
the found redeclaration is in a valid declaration context.

rdar://29220965

Differential Revision: https://reviews.llvm.org/D26664

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287530 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Frontend] Add a predefined macro that describes the Objective-C bool type
Alex Lorenz [Mon, 21 Nov 2016 11:05:15 +0000 (11:05 +0000)]
[Frontend] Add a predefined macro that describes the Objective-C bool type

This commit adds a new predefined macro named __OBJC_BOOL_IS_BOOL that describes
the Objective-C boolean type: its value is zero if the Objective-C boolean uses
the signed character type, otherwise its value is one as the Objective-C boolean
uses the builtin boolean type.

rdar://21170440

Differential Revision: https://reviews.llvm.org/D26234

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287529 91177308-0d34-0410-b5e6-96231b3b80d8