Alexey Bataev [Tue, 15 Dec 2015 10:55:09 +0000 (10:55 +0000)]
[OPENMP 4.5] Codegen for 'hint' clause of 'critical' directive
OpenMP 4.5 defines 'hint' clause for 'critical' directive. Patch adds codegen for this clause.
NAKAMURA Takumi [Tue, 15 Dec 2015 09:37:01 +0000 (09:37 +0000)]
clang/test/Analysis/padding_c.c: Suppress a test incompatible to i686-linux.
error: 'warning' diagnostics expected but not seen:
File clang/test/Analysis/padding_c.c Line 194 (directive at clang/test/Analysis/padding_c.c:193): Excessive padding in 'struct DefaultAttrAlign'
1 error generated.
Benjamin Kramer [Tue, 15 Dec 2015 09:30:31 +0000 (09:30 +0000)]
[libclang] Add a flag to create the precompiled preamble on the first parse.
Summary:
The current default is to create the preamble on the first reparse, aka
second parse. This is useful for clients that do not want to block when
opening a file because serializing the preamble takes a bit of time.
However, this makes the reparse much more expensive and that may be on the
critical path as it's the first interaction a user has with the source code.
YouCompleteMe currently optimizes for the first code interaction by parsing
the file twice when loaded. That's just unnecessarily slow and this flag
helps to avoid that.
Alexey Bataev [Tue, 15 Dec 2015 08:19:24 +0000 (08:19 +0000)]
[OPENMP 4.5] Parsing/sema for 'hint' clause of 'critical' directive.
OpenMP 4.5 adds 'hint' clause to critical directive. Patch adds parsing/semantic analysis for this clause.
(test case update)
Profile symbols have long prefixes which waste space and creating pressure for linker.
This patch shortens the prefixes to minimal length without losing verbosity.
...In C, clang will warn you about `nn = ptr`, because you're assigning
a nonnull pointer to a nullable pointer. In C++, clang issues no such
warning. This patch helps ensure that clang doesn't ever miss an
opportunity to complain about C++ code.
N.B. Though this patch has a differential revision link, the actual
review took place over email.
Ben Craig [Mon, 14 Dec 2015 21:38:59 +0000 (21:38 +0000)]
[PATCH] Adding checker to detect excess padding in records
The intent of this checker is to generate a report for any class / structure
that could reduce its padding by reordering the fields. This results in a very
noisy checker. To reduce the noise, this checker will currently only warn when
the number of bytes over "optimal" is more than 24. This value is configurable
with -analyzer-config performance.Padding:AllowedPad=N. Small values of
AllowedPad have the potential to generate hundreds of reports, and gigabytes
of HTML reports.
The checker searches for padding violations in two main ways. First, it goes
record by record. A report is generated if the fields could be reordered in a
way that reduces the padding by more than AllowedPad bytes. Second, the
checker will generate a report if an array will cause more than AllowedPad
padding bytes to be generated.
The record checker currently skips many ABI specific cases. Classes with base
classes are skipped because base class tail padding is ABI specific. Bitfields
are just plain hard, and duplicating that code seems like a bad idea. VLAs are
both uncommon and non-trivial to fix.
The array checker isn't very thorough right now. It only checks to see if the
element type's fields could be reordered, and it doesn't recursively check to
see if any of the fields' fields could be reordered. At some point in the
future, it would be nice if "arrays" could also look at array new usages and
malloc patterns that appear to be creating arrays.
Hans Wennborg [Mon, 14 Dec 2015 18:46:11 +0000 (18:46 +0000)]
clang-cl: make /Wall turn on both -Wall and -Wextra (PR25563)
The documentation suggests /Wall should really turn on -Wextra and any
other warnings that are not enabled by default. That would correspond
to Clang's -Weverything, but is probably not what users want.
David Majnemer [Mon, 14 Dec 2015 18:34:18 +0000 (18:34 +0000)]
[MS ABI] Don't rely on terminatepad
We'd like to remove support for terminatepad from LLVM. To do this, we
need to move Clang off of it first. The intent behind terminatepad was
to carefully model exception specifications for the MSVC personality.
However, we don't support exception specifications for the MSVC
personality and neither does MSVC. Instead, MSVC supports
all-or-nothing exception specifications. We can model this limited
usage using cleanuppads which call std::terminate.
Petar Jovanovic [Mon, 14 Dec 2015 17:51:50 +0000 (17:51 +0000)]
[Power PC] add soft float support for ppc32
This patch enables soft float support for ppc32 architecture and fixes
the ABI for variadic functions. This is the first in a set of patches
for soft float support in LLVM.
- Removed support for hexagonv3 and earlier.
- Added handling of hexagonv55 and hexagonv60.
- Added handling of target features (hvx, hvx-double).
- Updated paths to reflect current directory layout.
Alexey Bataev [Mon, 14 Dec 2015 09:26:19 +0000 (09:26 +0000)]
[OPENMP] Fix debug info for 'atomic' construct.
Debug info for statement under 'atomic' construct must point exactly to that statement, not the directive itself.
Daniel Jasper [Mon, 14 Dec 2015 08:41:18 +0000 (08:41 +0000)]
clang-format: Add test for AlignAfterOpenBracket = AlwaysBreak in C++.
Revision 251405 added AlwaysBreak to support Google's JavaScript style. This
changeset complete existing AlignsAfterOpenBracket tests to exercise
AlwaysBreak for C++.
I thought this would be worthwhile. With this option we can support request
from http://lists.llvm.org/pipermail/cfe-dev/2015-May/042942.html, that had
been requested a few times. This also partially solve related Bug 23422 and is
probably sufficient for most people.
void fooWithAVeryLongParamList(
int firstParameter,
int secondParameter
int lastParameter)
{
object.alsoThisDoenstFitSoIBreakImmidiatly(
firstParameter,
secondParameter,
lastParameter);
}
Craig Topper [Sun, 13 Dec 2015 05:41:41 +0000 (05:41 +0000)]
[Sema] Add -Wparentheses warnings for '^' in '|' expressions and '&' in '^' expressions to compliment '&' in '|' that is already present. Matches gcc behavior.
Craig Topper [Sat, 12 Dec 2015 06:30:48 +0000 (06:30 +0000)]
[Sema] Simplify a couple if statements. Explicitly check up front that only one of the expressions is a comparision op. Then if we find that either is a bitwise op, we know it must be the other one. NFC
Easwaran Raman [Sat, 12 Dec 2015 00:31:02 +0000 (00:31 +0000)]
Attach maximum function count to Module when using PGO mode
This sets the maximum entry count among all functions in the program to the
module using module flags. This allows the optimizer to use this information.
Richard Smith [Fri, 11 Dec 2015 22:41:00 +0000 (22:41 +0000)]
[modules] If the semantic and lexical DC of a decl are the same, write out the
second one as 0 instead of writing the same bits to the module file twice.
This typically reduces PCM file size by about 1%.
Richard Smith [Fri, 11 Dec 2015 22:39:52 +0000 (22:39 +0000)]
Allow non-defining declarations of class template partial specializations to
have a nested name specifier. Strictly speaking, forward declarations of class
template partial specializations are not permitted at all, but that seems like
an obvious wording defect, and if we allow them without a nested name specifier
we should also allow them with a nested name specifier.
Nick Lewycky [Fri, 11 Dec 2015 21:28:55 +0000 (21:28 +0000)]
Error on redeclaring with a conflicting asm label and on redeclaring with an asm label after the first ODR-use. Detects problems like the one in PR22830 where gcc and clang both compiled the file but with different behaviour.
[PGO] Stop using invalid char in instr variable names.
(This is part-2 of the patch -- fixing test cases)
Before the patch, -fprofile-instr-generate compile will fail
if no integrated-as is specified when the file contains
any static functions (the -S output is also invalid).
This patch fixed the issue. With the change, the index format
version will be bumped up by 1. Backward compatibility is
preserved with this change.
This improves the coverage for the multilib directories used for ARM. Also add
tests covering the internal triple (thumbv7-*). The Juno board can be run in
this configuration.
Ben Langmuir [Thu, 10 Dec 2015 23:41:39 +0000 (23:41 +0000)]
[VFS] Fix status() of opened redirected file
Make RedirectedFileSystem::openFilForRead(path)->status() the same as
RedirectedFileSystem::status(path). Previously we would just get the
status of the underlying real file, which would not have the IsVFSMapped
bit set.
This fixes rebuilding a module that has an include that is relative to
the includer where we will lookup the real path of that file before we
lookup the VFS location.
John McCall [Thu, 10 Dec 2015 23:31:01 +0000 (23:31 +0000)]
In Objective-C, ignore attempts to redefine the ARC/GC qualifier macros.
This works around existing system headers which unconditionally
redefine these macros.
This is reasonably safe to do because we used to warn about it anyway
(outside of system headers). Continue to warn if the redefinition
would have changed the expansion. Still permit redefinition if the
macro is explicitly #undef'ed first.
Douglas Gregor [Thu, 10 Dec 2015 23:02:09 +0000 (23:02 +0000)]
Objective-C properties: merge attributes when redeclaring 'readonly' as 'readwrite' in an extension.
r251874 stopped back-patching the AST when an Objective-C 'readonly'
property is redeclared in a class extension as 'readwrite'. However,
it did not properly handle merging of Objective-C property attributes
(e.g., getter name, ownership, atomicity) to the redeclaration,
leading to bad metadata. Merge (and check!) those property attributes
so we get the right metadata and reasonable ASTs. Fixes
rdar://problem/23823989.
Do not generate DW_TAG_imported_module for anonymous namespaces (even nested) for all the platforms except PS4.
For PS4, generate explicit import for anonymous namespaces and mark it by DW_AT_artificial attribute.
These attributes were previously unexposed. Expose them through the libclang
interfaces. Add tests that cover both the MSVC spelling and the GNU spelling.
Alexey Bataev [Thu, 10 Dec 2015 08:20:58 +0000 (08:20 +0000)]
[OPENMP] Fixed processing of predetermined data-sharing attributes
Predetermined data-shared attributes for local variables are now considered as implicit. Also, patch prohibits changin of DSA for static memebers of classes.
Alexey Bataev [Thu, 10 Dec 2015 05:47:10 +0000 (05:47 +0000)]
[OPENMP] Make -fopenmp to turn on OpenMP support by default, clang part
Patch turns on OpenMP support in clang by default after fixing OpenMP buildbots.
Differential Revision: http://reviews.llvm.org/D13803
Faisal Vali [Thu, 10 Dec 2015 05:36:39 +0000 (05:36 +0000)]
Fix PR24694 (CWG1591): Deducing array bound and element type from initializer list
https://llvm.org/bugs/show_bug.cgi?id=24694
http://wg21.link/cwg1591
Teach DeduceFromInitializerList in SemaTemplateDeduction.cpp to deduce against array (constant and dependent sized) parameters (really, reference to arrays since they don't decay to pointers), by checking if the template parameter is either one of those kinds of arrays, and if so, deducing each initializer list element against the element type, and then deducing the array bound if needed.
In brief, this patch enables the following code:
template<class T, int N> int *f(T (&&)[N]);
int *ip = f({1, 2, 3});
Alexey Bataev [Thu, 10 Dec 2015 04:38:18 +0000 (04:38 +0000)]
[MSVC] Fix for http://llvm.org/PR25636: indexed accessor property not supported correctly.
All problems described in http://llvm.org/PR25636 are implemented except for return value of the 'put' property. This patch fixes this problem with the indexed properties
Differential Revision: http://reviews.llvm.org/D15174
Richard Smith [Thu, 10 Dec 2015 01:11:47 +0000 (01:11 +0000)]
PR25416: Improve performance of processing inline assembly consisting of many
implicitly-concatenated string literals. When looking for the start of a token
in the inline assembly, start from the end of the previous token, not the start
of the entire string.
Douglas Gregor [Wed, 9 Dec 2015 22:57:32 +0000 (22:57 +0000)]
Objective-C properties: loosen 'atomic' checking for readonly properties.
r251874 reworked the way we handle properties declared within
Objective-C class extensions, which had the effective of tightening up
property checking in a number of places. In this particular class of
cases, we end up complaining about "atomic" mismatches between an
implicitly-atomic, readonly property and a nonatomic, readwrite
property, which doesn't make sense because "atomic" is essentially
irrelevant to readonly properties.
Therefore, suppress this diagnostic when the readonly property is
implicitly atomic. Fixes rdar://problem/23803109.
Douglas Gregor [Tue, 8 Dec 2015 22:45:17 +0000 (22:45 +0000)]
Objective-C properties: fix bogus use of "isa<>" on a QualType.
The code used "isa" to check the type and then "getAs" to look through
sugar; we need to look through the sugar when checking, too, otherwise
any kind of sugar (nullability qualifiers in the example; or a
typedef) will thwart this semantic check. Fixes rdar://problem/23804250.
[Sema] Add warning when comparing nonnull and null
Currently, we emit warnings in some cases where nonnull function
parameters are compared against null. This patch extends this support
to warn when comparing the result of `returns_nonnull` functions
against null.
More specifically, we will now warn cases like:
int *foo() __attribute__((returns_nonnull));
int main() {
if (foo() == NULL) {} // warning: will always evaluate to false
}
Simon Pilgrim [Tue, 8 Dec 2015 21:16:45 +0000 (21:16 +0000)]
[X86][AVX2] Stripped backend codegen tests
As discussed on the ml, backend tests need to be put in llvm/test/CodeGen/X86 as fast-isel tests using IR that is as close to what is generated here as possible.
Alexey Bataev [Tue, 8 Dec 2015 12:06:20 +0000 (12:06 +0000)]
[OPENMP 4.5] Parsing/sema for 'num_tasks' clause.
OpenMP 4.5 adds directives 'taskloop' and 'taskloop simd'. These directives support clause 'num_tasks'. Patch adds parsing/semantic analysis for this clause.