Commit Graph

61444 Commits

Author SHA1 Message Date
Alexey Bataev 60520e2203 [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

llvm-svn: 255218
2015-12-10 04:38:18 +00:00
Hans Wennborg 2edb8fcf0d Mark MS inline ASM 'nodplicate' it it has labels (PR23715)
Duplicating it can lead to labels being defined twice.

Differential revision: http://reviews.llvm.org/D15399

llvm-svn: 255201
2015-12-10 01:38:04 +00:00
Yunzhong Gao eecc9e97d2 Fix a typo in the clang user manual.
-fmax-unknown-pointer-align => -fmax-type-align

llvm-svn: 255200
2015-12-10 01:37:18 +00:00
Richard Smith efb116fba6 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.

Patch by Yunlian Jiang!

llvm-svn: 255198
2015-12-10 01:11:47 +00:00
Charles Li 85dec55989 [Lit Test] Updated 20 Lit tests to be C++11 compatible.
This is the 5th Lit test patch.
Expanded expected diagnostics to vary by C++ dialect.
Expanded RUN line to: default, C++98/03 and C++11.

llvm-svn: 255196
2015-12-10 01:07:17 +00:00
Reid Kleckner 4a09e8872f Fix crash on invalid initialization with std::initializer_list
It is possible for CheckListElementTypes to fail without filling in any
initializer list elements.

llvm-svn: 255176
2015-12-09 23:18:38 +00:00
Douglas Gregor 429183e7c8 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.

llvm-svn: 255174
2015-12-09 22:57:32 +00:00
Chris Bieneman 3d9f89f04f [CMake] Pass CMAKE_MAKE_PROGRAM through to compiler-rt build.
This is needed if your make tool is overridden.

llvm-svn: 255172
2015-12-09 22:46:25 +00:00
Sanjay Patel 5690454bd6 fix typos; NFC
llvm-svn: 255163
2015-12-09 22:16:07 +00:00
David Blaikie d2725a31eb unique_ptrify some collections in FileManager
llvm-svn: 255129
2015-12-09 17:23:13 +00:00
Krzysztof Parzyszek e28d04da59 [Hexagon] Use integrated assembler by default
llvm-svn: 255127
2015-12-09 16:34:24 +00:00
Daniel Jasper 3a4ce6e1f2 clang-format: Improve documentation of AlignOperands.
llvm-svn: 255099
2015-12-09 07:56:52 +00:00
NAKAMURA Takumi aa13f94456 Reformat linefeeds.
llvm-svn: 255098
2015-12-09 07:52:46 +00:00
NAKAMURA Takumi 2d5c6ddf74 Revert r255001, "Add parse and sema for OpenMP distribute directive and all its clauses excluding dist_schedule."
It causes memory leak. Some tests in test/OpenMP would fail.

llvm-svn: 255094
2015-12-09 04:35:57 +00:00
Vedant Kumar 13e6f311af [Basic] Rangify two for loops. NFC.
llvm-svn: 255091
2015-12-09 01:44:02 +00:00
Bill Schmidt 4b8841a327 [PPC64, TSAN] Enable thread sanitizer for PPC64
Patch by Simone Atzeni.

This enables the -fsanitize=thread flag for PPC64 and PPC64LE.

llvm-svn: 255067
2015-12-08 22:48:02 +00:00
Douglas Gregor 1cbb289c7d 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.

llvm-svn: 255066
2015-12-08 22:45:17 +00:00
Douglas Gregor 8f64ca1529 Module file extensions: pass a Sema through to the extension writer.
Module file extensions are likely to need access to
Sema/Preprocessor/ASTContext, and cannot get it through other
sources.

llvm-svn: 255065
2015-12-08 22:43:32 +00:00
George Burgess IV 850269a47e [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
}

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

llvm-svn: 255058
2015-12-08 22:02:00 +00:00
Simon Pilgrim 2a4df3fd2a [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.

The llvm tests will (re)added in a future commit.

llvm-svn: 255050
2015-12-08 21:16:45 +00:00
Eugene Zelenko 5f02b777c6 Use range loops and autos in utils/TableGen/ClangAttrEmitter.cpp and generated code.
Differential revision: http://reviews.llvm.org/D15313

llvm-svn: 255042
2015-12-08 18:49:01 +00:00
Eugene Zelenko ddaa4b4990 Use range loops and autos in lib/Serialization/ASTWriter.cpp.
Differential revision: http://reviews.llvm.org/D15311

llvm-svn: 255033
2015-12-08 18:00:11 +00:00
Hans Wennborg d0edbdfad1 Update clang-format-vs README
VS2013 is requried after r231084.

llvm-svn: 255029
2015-12-08 17:54:27 +00:00
Asaf Badouh 5e4248b4e0 [x86][avx512] more changes in intrinsics to be align with gcc format
Differential Revision: http://reviews.llvm.org/D15328

llvm-svn: 255012
2015-12-08 12:34:38 +00:00
Alexey Bataev 382967a2e4 [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.

llvm-svn: 255008
2015-12-08 12:06:20 +00:00
Craig Topper 8901448aad Replace bitwise AND with logical AND in an expression that already had another logical AND. NFC
llvm-svn: 255006
2015-12-08 06:49:15 +00:00
Craig Topper bd44cd9d55 [Sema] Remove tab characters. NFC
llvm-svn: 255004
2015-12-08 04:33:04 +00:00
Carlo Bertolli b9bfa75b28 Add parse and sema for OpenMP distribute directive and all its clauses excluding dist_schedule.
llvm-svn: 255001
2015-12-08 04:21:03 +00:00
Richard Smith ce8eca578d Explicitly permit undefined behavior in constant initializers for global
variables in C, in the cases where we can constant-fold it to a value
regardless (such as floating-point division by zero and signed integer
overflow). Strictly enforcing this rule breaks too much code.

llvm-svn: 254992
2015-12-08 03:21:47 +00:00
Eric Christopher c1984075d8 Replace a bunch of duplicate conditions with the call from types::.
llvm-svn: 254986
2015-12-08 02:10:19 +00:00
Eric Christopher b0a44f70e3 Remove name from FIXME.
llvm-svn: 254985
2015-12-08 01:59:51 +00:00
Eric Christopher 379294685b Update comment to reflect that we use other tools via the toolchain to
handle more than just C.

llvm-svn: 254984
2015-12-08 01:59:47 +00:00
Reid Kleckner da30cff9ef [diagnostics] Avoid crashes while printing macro backtraces
When attempting to map a source into a given level of macro expansion,
this code was ignoring the possibility that the start and end of the
range might take wildly different paths through the tree of macro
expansions. It was assuming that the begin spelling location would
always precede the end spelling location, which is false. A macro can
easily transpose its arguments.

This also fixes a related issue where there are extra macro arguments
between the begin location and the end location. In this situation, we
now highlight the entire macro invocation.

Pair programmed with Richard Smith.

Fixes PR12818.

llvm-svn: 254981
2015-12-08 01:08:09 +00:00
Eric Christopher 3f5d2bc0bc 80-column fixup.
llvm-svn: 254973
2015-12-08 00:10:13 +00:00
Eric Christopher f5a8f49487 Update comment.
llvm-svn: 254972
2015-12-08 00:10:10 +00:00
Devin Coughlin 7bdca8b24f [analyzer] Fix crash when lambda captures a variable-length array.
When a C++ lambda captures a variable-length array, it creates a capture
field to store the size of the array. The initialization expression for this
capture is null, which led the analyzer to crash when initializing the field.
To avoid this, use the size expression from the VLA type to determine the
initialization value.

rdar://problem/23748072

llvm-svn: 254962
2015-12-07 23:01:53 +00:00
Alexey Samsonov af89de9d66 Add llvm-objdump to compiler-rt test deps.
llvm-svn: 254961
2015-12-07 22:45:36 +00:00
Eric Christopher efef8ef8f3 80-col and whitespace fixups.
llvm-svn: 254958
2015-12-07 22:43:05 +00:00
Teresa Johnson ecc8038571 Remove target specifier from new tests
Hopefully fix the remaining bot failure from r254927. Remove
target specification since it shouldn't be needed, and this causes
an error when trying to check the pass execution structure in
test/CodeGen/thinlto_backend.c on non-x86 arches.

llvm-svn: 254940
2015-12-07 20:40:36 +00:00
Teresa Johnson f5ae87d70d Adjust test to fix bot error from r254927.
Remove the part of the error message that may vary across systems.

llvm-svn: 254938
2015-12-07 20:26:57 +00:00
Justin Bogner cbc12262e3 AST: defer to TypeLoc::copy in TypeLoc::initializeFullCopy
If we're initializing a TypeLoc from one that's been allocated with
different alignment, memcpy will get the padding wrong. The `copy`
method already checks and handles this case, so we should just defer
to it.

This also drops the `const` off of the `initializeFullCopy`
declarations, since it isn't even remotely true (and the compiler
notices when we try to call copy() instead of tricking it with
memcpy).

Fixes llvm.org/pr23516.

llvm-svn: 254935
2015-12-07 20:04:57 +00:00
Daniel Jasper f901a57cda clang-format: Make wrapping after "./->" cheaper, even if the element
before it is not a closing parenthesis.

Otherwise, this frequently leads to "hanging" indents that users
perceive as "weird".

Before:
  return !soooooooooooooome_map.insert(
                                   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
              .second;

After:
  return !soooooooooooooome_map
              .insert(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
              .second;

llvm-svn: 254933
2015-12-07 19:50:48 +00:00
Teresa Johnson aff223278c [ThinLTO] Option to invoke ThinLTO backend passes and importing
Summary:
Adds new option -fthinlto-index=<file> to invoke the LTO pipeline
along with function importing via clang using the supplied function
summary index file. This supports invoking the parallel ThinLTO
backend processes in a distributed build environment via clang.

Additionally, this causes the module linker to be invoked on the bitcode
file being compiled to perform any necessary promotion and renaming of
locals that are exported via the function summary index file.

Add a couple tests that confirm we get expected errors when we try to
use the new option on a file that isn't bitcode, or specify an invalid
index file. The tests also confirm that we trigger the expected function
import pass.

Depends on D15024

Reviewers: joker.eph, dexonsmith

Subscribers: joker.eph, davidxl, cfe-commits

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

llvm-svn: 254927
2015-12-07 19:21:34 +00:00
Asaf Badouh 3e5111e313 [avx512] rename gcc intrinsics to be align with gcc format
rename the gcc intrinsics suffix : _mask ->_round

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

llvm-svn: 254906
2015-12-07 13:14:22 +00:00
Alexey Bataev 1fd4aed26b [OPENMP 4.5] parsing/sema support for 'grainsize' clause.
OpenMP 4.5 adds 'taksloop' and 'taskloop simd' directives, which have 'grainsize' clause. Patch adds parsing/sema analysis of this clause.

llvm-svn: 254903
2015-12-07 12:52:51 +00:00
Alexey Bataev b825de17b7 [OPENMP 4.5] parsing/sema support for 'nogroup' clause.
OpenMP 4.5 adds 'taskloop' and 'taskloop simd' directives. These directives have new 'nogroup' clause. Patch adds basic parsing/sema support for this clause.

llvm-svn: 254899
2015-12-07 10:51:44 +00:00
Faisal Vali 30622bb6a5 Fix PR20334: invalid assertion while diagnosing list initialization failure
https://llvm.org/bugs/show_bug.cgi?id=20334

Unfortunately, clang currently checks for a certain brokenness of implementations of std::initializer_list in CodeGen (void 
AggExprEmitter::VisitCXXStdInitializerListExpr), not in SemaInit.  Until that is fixed, make sure we don't let broken attempts that are aggregates leak through into sema, which allows maintenance of expected invariants, and avoids triggering an assertion.



 

llvm-svn: 254889
2015-12-07 02:37:44 +00:00
Serge Pavlov 3a5614599a [PGO] Instrument only base constructors and destructors.
Constructors and destructors may be represented by several functions
in IR. Only base structors correspond to source code, others are
small pieces of code and eventually call the base variant. In this
case instrumentation of non-base structors has little sense, this
fix remove it. Now profile data of a declaration corresponds to
exactly one function in IR, it agrees with the current logic of the
profile data loading.

This change fixes PR24996.

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

llvm-svn: 254876
2015-12-06 14:32:39 +00:00
Craig Topper 59c2ada25d Use llvm::make_range to reduce mentions of iterator type. NFC
llvm-svn: 254870
2015-12-06 05:07:12 +00:00
Dawn Perchik ddd03bf6a0 Fix crash in ASTDumper when dumping NamedDecl with NULL getQualifier().
Reviewed by: aaron.ballman
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D15254

llvm-svn: 254867
2015-12-05 22:37:55 +00:00
Simon Pilgrim 474f24cc5e [X86][3DNow!] 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.

The llvm tests will (re)added in a future commit

llvm-svn: 254849
2015-12-05 11:12:23 +00:00
Simon Pilgrim dfd2cf3f89 Updated test names to match the intrinsics being tested
llvm-svn: 254848
2015-12-05 11:08:51 +00:00
Simon Pilgrim efc2e45b77 [X86][F16C] 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.

The llvm tests will (re)added in a future commit

I will update PR24580 on this new plan

llvm-svn: 254847
2015-12-05 10:37:35 +00:00
Craig Topper 8fa890e4b8 [AST] Use std::copy and std::fill to simplify some memcpy and memset calls. Also const-correct some methods being used since the std::copy catches the mismatch where memcpy didn't.
llvm-svn: 254846
2015-12-05 07:41:44 +00:00
Craig Topper caf138e32b Use std::copy and std::transform instead of manual loops. NFC
llvm-svn: 254845
2015-12-05 07:41:42 +00:00
Xinliang David Li a569e24a95 Pass profile version info to name API (NFC)
llvm-svn: 254839
2015-12-05 05:37:15 +00:00
Reid Kleckner 953fe0367b Revert "[x86] Exclusion of incorrect include headers paths for MCU target"
This reverts commit r254195.

From the description, I suspect that the wrong patch was committed here,
and this is causing assertion failures in EmitDeferred() when the global
value ends up being a bitcast of a global.

llvm-svn: 254823
2015-12-05 01:52:14 +00:00
Dan Gohman 4b971e4463 [WebAssembly] Remove an obsolete TODO comment.
llvm-svn: 254817
2015-12-05 01:36:31 +00:00
Devin Coughlin 46089867de [analyzer] Fix MemRegion crash casting non-struct to derived struct (PR25426).
This commit prevents MemRegion::getAsOffset() from crashing when the analyzed
program casts a symbolic region of a non-record type to some derived type and
then attempts to access a field of the base type.

rdar://problem/23458069

llvm-svn: 254806
2015-12-05 00:22:36 +00:00
Alexey Samsonov b6761c2e1e [Docs] One more cleanup of -fsanitize= section.
Describe -fsanitize-blacklist flags in separate paragraphs, move
notes about importance of clang++ for vptr down to UBSan docs.

llvm-svn: 254798
2015-12-04 23:13:14 +00:00
Chris Bieneman 24423e9d03 [CMake] Don't build the libclang tests unless you're building libclang
This fixes a build issue reported by users at Apple.

llvm-svn: 254797
2015-12-04 23:12:19 +00:00
Alexey Samsonov 1f7051e31b [Docs] Update MSan docs
Summary:
1. Move MSan-specific flags and features from user manual to MSan page.
2. Update current status / list of supported platforms.

Reviewers: eugenis, kcc

Subscribers: cfe-commits

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

llvm-svn: 254788
2015-12-04 22:50:44 +00:00
Alexey Samsonov 9eda64043e [Docs] Move the list of CFI schemes down to CFI doc, and update it.
Use proper headling levels in CFI doc. Before that, all sections
were considered a subsection of "Introduction".

Reviewers: pcc, kcc

Subscribers: cfe-commits

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

llvm-svn: 254771
2015-12-04 21:30:58 +00:00
Nico Weber de059e15c0 Small follow-up to 254750 to get the test added there passing...
llvm-svn: 254754
2015-12-04 19:35:45 +00:00
Nico Weber 7123bca7fb Fix debug info for Objective-C properties from class extensions after r251874
After r251874, properties from class extensions no longer show up in
ObjCInterfaceDecl::properties().  Make debug info emission explicitly
look for properties in class extensions before looking at direct properties.

Also add a test that checks for this.  There are three interesting cases:

1. A property is only declared in a class extension, and the @implementation
   is in a different file.  This used to generated a DIObjcProperty before
   r251874 and does again with this fix.

2. A property is declared as readonly in the class itself and redeclared as
   readwrite in a class extension. clang before r251874 put the DIObjcProperty
   on the first declaration. clang after r251874 didn't emit any DIObjcProperty,
   and clang with this fix puts it on the readwrite redeclaration (which is
   what lookup finds).  This seems like a progression.

3. Like 2, but with an @implementation in the same file.  In this case,
   the property debug info gets generated a second time through the ivar
   from the definition.  In this case, lookup and declaration code need
   to agree on the line number so that the DIObjcProperty isn't emitted
   twice.  In this case, clang before r251874 emitted one DIObjcProperty
   on the first declaration, clang with r251874 emitted one on the second
   declaration, and clang with this patch still does the latter.

llvm-svn: 254750
2015-12-04 19:14:14 +00:00
Alexey Samsonov 8846017dd4 [Docs] Remove false claim: UBSan can also be combined with TSan/MSan.
llvm-svn: 254734
2015-12-04 17:35:47 +00:00
Alexey Samsonov 778fc728ed Clang documentation for UBSan.
Summary:
Create a separate page describing UBSan tool, move the description of
fine-grained checks there, provide extra information about supported
platforms, symbolization etc. This text is compiled from four parts:

* Existing documentation copied from User's Manual
* Layout used in documentation for another sanitizers (ASan, MSan etc.)
* Text written from scratch
* Small parts taken from Michael Morrison's attempt at creating UBSan
  page:
  http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20141215/249503.html

Reviewers: kcc, rsmith, silvas

Subscribers: tberghammer, danalbert, srhines, kcc

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

llvm-svn: 254733
2015-12-04 17:30:29 +00:00
Filipe Cabecinhas 3e127d984f [PS4] Add an additional test for ASan+UBSan
llvm-svn: 254723
2015-12-04 16:18:03 +00:00
Gabor Horvath e86cb2e822 [analyzer] Improve modelling of nullptr_t in the analyzer. Fix PR25414.
Differential Revision: http://reviews.llvm.org/D15007

llvm-svn: 254718
2015-12-04 15:02:30 +00:00
Craig Topper 2d54c842b5 Fix an unused variable warning in released builds. While there use 'auto' to simplify code.
llvm-svn: 254704
2015-12-04 05:27:29 +00:00
Craig Topper 9ee84add63 [AST] ArrayRef-ize CompoundStmt::setStmts.
llvm-svn: 254703
2015-12-04 05:01:44 +00:00
Devin Coughlin ebeed88078 [analyzer] Support inlining lambda-converted blocks.
clang converts C++ lambdas to blocks with an implicit user-defined conversion
operator method on the lambda record. This method returns a block that captures a copy
of the lambda. To inline a lambda-converted block, the analyzer now calls the lambda
records's call operator method on the lambda captured by the block.

llvm-svn: 254702
2015-12-04 05:00:36 +00:00
Richard Smith 5c40f09b3d Don't assert if evaluation of an expression that we're syntactically required
to treat as an ICE results in undefined behavior. Instead, return the "natural"
result of the operation (signed wraparound / inf / nan).

llvm-svn: 254699
2015-12-04 03:00:44 +00:00
Stephen Hines 8267e7d456 LLDB JIT needs android vector passing rules.
Summary:
Looking into some recent issues with LLDBs expression parser highlighted that upstream clang passes vectors types differently to Android Open Source Project's clang for Arm Android targets.
This patch reflects the changes present in the AOSP and allows LLDB's JIT expression evaluation to work correctly for Arm Android targets when passing vectors.

This is submitted with consent of the original author Stephen Hines.

Reviewers: asl, rsmith, ADodds, rnk

Subscribers: rnk, aemerson, tberghammer, danalbert, srhines, cfe-commits, pirama

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

llvm-svn: 254682
2015-12-04 01:39:30 +00:00
Alexey Samsonov 2e2469d9d9 [Docs] Sanitizer docs migrated from code.google.com to github.com.
llvm-svn: 254672
2015-12-04 00:38:13 +00:00
Petar Jovanovic 402257b84e [PowerPC] Fix calculating address of arguments on stack for variadic func
Fix calculating address of arguments larger than 32 bit on stack for
variadic functions (rounding up address to alignment) on ppc32 architecture.

Patch by Strahinja Petrovic.

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

llvm-svn: 254670
2015-12-04 00:26:47 +00:00
Richard Smith 2b2a176752 PR25731: namespace alias declarations can appear at block scope; ensure that we
do scope-based lookup when looking for redeclarations of them. Add some related
missing checks for the scope-based redeclaration lookup: properly filter the
list of found declarations to match the scope, and diagnose shadowing of a
template parameter name.

llvm-svn: 254663
2015-12-03 23:24:04 +00:00
George Burgess IV 5e8701c356 Fix pass_object_size test on Windows.
The tests were failing because the types of some member functions, when
printed, unexpectedly had "__attribute__((thiscall))" at the end. The
types in question were relatively unimportant to begin with, so they
were removed/replaced with regexes.

llvm-svn: 254650
2015-12-03 21:15:22 +00:00
George Burgess IV c3ec9508ea Add tests for `&enable_if_function` diagnostics.
The introduction of pass_object_size fixed a few bugs related to taking
the address of a function with enable_if attributes. This patch adds
tests for the cases that were fixed.

llvm-svn: 254646
2015-12-03 20:54:58 +00:00
Chris Bieneman 865c4ee9cb [CMake] Removing an unnecessary layer of variable indirection
This prevents passthrough variables from having values.

llvm-svn: 254642
2015-12-03 19:47:25 +00:00
Devin Coughlin dfde655461 [analyzer] Suppress stack address escape on CK_CopyAndAutoreleaseBlockObject.
Don't warn about addresses of stack-allocated blocks escaping if the block
region was cast with CK_CopyAndAutoreleaseBlockObject. These casts, which
are introduced in the implicit conversion operator for lambda-to-block
conversions, cause the block to be copied to the heap -- so the warning is
spurious.

llvm-svn: 254639
2015-12-03 19:41:24 +00:00
George Burgess IV 08a4a8c389 Add tests for pass_object_size.
These additions were meant to go in as a part of r254554; while it's
certainly nice to have new functionality, it's nicer if we have tests to
go with it. :)

llvm-svn: 254632
2015-12-03 19:19:09 +00:00
Nico Weber 08c9333df2 Fix Objective-C metadata for properties from class extensions after r251874
After, properties from class extensions no longer show up in
ObjCInterfaceDecl::properties().  Make ObjCCommonMac::EmitPropertyList()
explicitly look for properties in class extensions before looking at
direct properties.

Also add a test that passes both with clang before r251874 and after this
patch (but fails with r251874 and without this patch).

llvm-svn: 254622
2015-12-03 17:44:51 +00:00
NAKAMURA Takumi 66389e8ff2 Fix clang/test/Sema/struct-packed-align.c. "Windows" is not MS compiler.
llvm-svn: 254614
2015-12-03 16:03:34 +00:00
Nico Weber ae92083d72 Make check-clang depend on LTO.
r249143 added test/Driver/darwin-ld-lto.c which requires libLTO.dylib
to pass, but when running `ninja check-clang` in a fresh build directory
nothing caused libLTO.dylib to be built and the test would fail.

llvm-svn: 254612
2015-12-03 15:40:23 +00:00
Krzysztof Parzyszek fceb4e7cb4 Unxfail passing test: test/CodeGenCXX/crash.cpp
llvm-svn: 254606
2015-12-03 12:03:56 +00:00
Alexander Kornienko 061900fea8 Revert "Fix for merging decls in pragma weak Calling CheckFunctionDeclaration so that 2 decls for the 'weak' are merged. Differential Revision: http://reviews.llvm.org/D13048"
This reverts commit r254143 which introduces a crash on the following input:
  f(char *);
  g(char *);
  #pragma weak f = g
  int g(char *p) {}

llvm-svn: 254605
2015-12-03 11:37:28 +00:00
Manuel Klimek 6003384ea9 Add fall-back mode for clang tools.
Run without flags if we cannot load a compilation database. This matches
the behavior of clang itself when simply called with a source file.

Based on a patch by Russell Wallace.

llvm-svn: 254599
2015-12-03 10:38:53 +00:00
Alexey Bataev 0a6ed84a0d [OPENMP 4.5] Parsing/sema support for 'omp taskloop simd' directive.
OpenMP 4.5 adds directive 'taskloop simd'. Patch adds parsing/sema analysis for 'taskloop simd' directive and its clauses.

llvm-svn: 254597
2015-12-03 09:40:15 +00:00
Alexey Bataev 830dfccfb2 PR25575: Make GCC 4.4+ comatible layout for packed bit-fileds of char type, patch by D. Polukhin
This CL is for discussion how to better fix bit-filed layout compatibility issue with GCC (see PR25575 for test case and more details). Current clang behavior is compatible with GCC 4.1-4.3 series but it was fixed in 4.4+. Ignoring packed attribute looks very odd and because it was also fixed in GCC 4.4+, it makes sense also fix it in clang.
Differential Revision: http://reviews.llvm.org/D14872

llvm-svn: 254596
2015-12-03 09:34:49 +00:00
Simon Pilgrim 068c2ce836 [X86] 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.

The llvm tests will (re)added in a future commit

I will update PR24580 on this new plan

llvm-svn: 254594
2015-12-03 08:45:21 +00:00
Nico Weber baf4b7d734 Fix a comment typo from r251874.
llvm-svn: 254579
2015-12-03 02:25:26 +00:00
Sanjay Patel 4994956f1a generalize CHECK lines to make buildbot happy
llvm-svn: 254576
2015-12-03 01:51:39 +00:00
Richard Smith 0c6124ba82 PR17381: Treat undefined behavior during expression evaluation as an unmodeled
side-effect, so that we don't allow speculative evaluation of such expressions
during code generation.

This caused a diagnostic quality regression, so fix constant expression
diagnostics to prefer either the first "can't be constant folded" diagnostic or
the first "not a constant expression" diagnostic depending on the kind of
evaluation we're doing. This was always the intent, but didn't quite work
correctly before.

This results in certain initializers that used to be constant initializers to
no longer be; in particular, things like:

  float f = 1e100;

are no longer accepted in C. This seems appropriate, as such constructs would
lead to code being executed if sanitizers are enabled.

llvm-svn: 254574
2015-12-03 01:36:22 +00:00
Sanjay Patel a30cee6272 change an assert when generating fmuladd to an ordinary 'if' check (PR25719)
We don't want to generate fmuladd if there's a use of the fmul expression, but this shouldn't be an assert.

The test case is derived from the commit message for r253337:
http://reviews.llvm.org/rL253337

That commit reverted r253269:
http://reviews.llvm.org/rL253269

...but the bug exists independently of the default fp-contract setting. It just became easier to hit with that change.

PR25719:
https://llvm.org/bugs/show_bug.cgi?id=25719

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

llvm-svn: 254573
2015-12-03 01:25:12 +00:00
Sanjay Patel ef350e6a85 fix typos; NFC
llvm-svn: 254561
2015-12-02 23:06:17 +00:00
George Burgess IV 3e3bb95b69 Add the `pass_object_size` attribute to clang.
`pass_object_size` is our way of enabling `__builtin_object_size` to
produce high quality results without requiring inlining to happen
everywhere.

A link to the design doc for this attribute is available at the
Differential review link below.

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

llvm-svn: 254554
2015-12-02 21:58:08 +00:00
Sumanth Gundapaneni b79fdff9e2 Fix the clang driver when "-nostdlib" is present
This patch is a fix to r252901 which changed the behavior of 
clang driver. In the presence of "-nostdlib" none of the standard
libraries should be passed to link line.

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

llvm-svn: 254535
2015-12-02 19:12:41 +00:00
Paul Robinson 941bc91518 Move _mm256_cvtps_ph and _mm256_cvtph_ps to immintrin.h.
This more closely matches their locations as described by Intel
documentation, and lets us remove a pair of redundant typedefs.

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

llvm-svn: 254528
2015-12-02 18:41:52 +00:00
Samuel Antao 4af1b7b693 [OpenMP] Update target directive codegen to use 4.5 implicit data mappings.
Summary:
This patch implements the 4.5 specification for the implicit data maps. OpenMP 4.5 specification changes the default way data is captured into a target region. All the non-aggregate kinds are passed by value by default. This required activating the capturing by value during SEMA for the target region. All the non-aggregate values that can be encoded in the size of a pointer are properly casted and forwarded to the runtime library. On top of fixing the previous weird behavior for mapping pointers in nested data regions (an explicit map was always required), this also improves performance as the number of allocations/transactions to the device per non-aggregate map are reduced from two to only one - instead of passing a reference and the value, only the value passed.

Explicit maps will be added later on once firstprivate, private, and map clauses' SEMA and parsing are available.

Reviewers: hfinkel, rjmccall, ABataev

Subscribers: cfe-commits, carlo.bertolli

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

llvm-svn: 254521
2015-12-02 17:44:43 +00:00
Aaron Ballman 32beedc982 Making the deleted copy constructor parameter const; NFC.
llvm-svn: 254520
2015-12-02 17:07:30 +00:00
Aaron Ballman a60bcdab92 Add a narrowing AST matcher that matches on a FunctionDecl with a non-throwing exception specification.
llvm-svn: 254516
2015-12-02 15:23:59 +00:00
Aaron Ballman 08dd61de24 Amending r254423 by deleting the copy constructor and adding a move constructor instead; NFC as neither of these constructors are currently called, but this is a safer design.
llvm-svn: 254515
2015-12-02 15:05:47 +00:00
Daniel Jasper c8f472c3a6 Traverse the NestedNameSpecifier(Loc) of NamespaceAliasDecls.
Review: http://reviews.llvm.org/D15149
llvm-svn: 254510
2015-12-02 13:57:46 +00:00
Christof Douma ba13ad58f7 Teaches clang about Cortex-A35.
Adds support for the new Cortex-A35 ARMv8-A core.

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

llvm-svn: 254505
2015-12-02 12:03:42 +00:00
NAKAMURA Takumi 2d91266473 clang/test/Driver/crash-report-modules.m: Avoid using /tmp/.
Temporary directories should be controlled with $LIT_PRESERVES_TMP.

llvm-svn: 254485
2015-12-02 03:13:50 +00:00
Kostya Serebryany 5ce81794c3 [sanitizer coverage] document -fsanitize-coverage=trace-bb
llvm-svn: 254481
2015-12-02 02:08:26 +00:00
Peter Collingbourne 9de8fc5766 docs: Add design documentation for forward-edge CFI for indirect calls.
llvm-svn: 254464
2015-12-01 21:58:54 +00:00
Adrian Prantl d6ec3bc48d Clang-format an 80-column violation.
llvm-svn: 254455
2015-12-01 20:19:44 +00:00
Adrian Prantl 354bebda48 Add an accessor to Decl::LoadedFieldsFromExternalStorage for LLDB.
Patch by Greg Clayton
Reviewed by Doug Gregor

llvm-svn: 254451
2015-12-01 19:54:07 +00:00
Rafael Espindola f0202c46be Update for llvm api change.
llvm-svn: 254450
2015-12-01 19:51:03 +00:00
Benjamin Kramer 5fecd67462 Avoid picking up system headers in unittest by providing a fake libstdc++ with a ridiculously high version number.
The host libstdc++ may be horribly broken and we want the fake one to be
picked up. This workaround is lame but I don't see a better way.

llvm-svn: 254446
2015-12-01 19:42:07 +00:00
David Majnemer f3027177bc [MS ABI] Correctly mangle nullptr member pointers for variable templates
Variable templates behave the same as class templates with regard to
nullptr memeber pointers.

llvm-svn: 254439
2015-12-01 19:13:51 +00:00
Aaron Ballman a9918e897b It appears that this horrible mutating copy constructor is unused. Kill it with fire.
llvm-svn: 254423
2015-12-01 17:15:13 +00:00
Daniel Jasper a0a5039d2e clang-format: Make it possible to turn off comment reflowing.
llvm-svn: 254414
2015-12-01 13:28:53 +00:00
Daniel Jasper a00de6366a clang-format: treat Q_SIGNALS as an access modifier
Patch by Alexander Richardson, thank you!

llvm-svn: 254407
2015-12-01 12:05:04 +00:00
Daniel Jasper ec90e51c79 This fixes https://llvm.org/bugs/show_bug.cgi?id=25329, as well as
misalignments like the following:

  int a, b = 2;
  int c    = 3;

Patch by Beren Minor, thanks!

llvm-svn: 254406
2015-12-01 12:00:43 +00:00
Alexey Bataev a056935a2f [OPENMP 4.5] Parsing/sema analysis for 'priority' clause.
OpenMP 4.5 defines new clause 'priority' for 'task', 'taskloop' and 'taskloop simd' directives. Added parsing and sema analysis for 'priority' clause in 'task' and 'taskloop' directives.

llvm-svn: 254398
2015-12-01 10:17:31 +00:00
Gabor Horvath fe2c0ff942 [analyzer] Fix IssueHash generation.
Differential Revision: http://reviews.llvm.org/D14919 

Original patch by: Gyorgy Orban!

llvm-svn: 254394
2015-12-01 09:00:41 +00:00
Yaron Keren 2c07cc70c4 Remove superfluous StringRef casts, NFC.
llvm-svn: 254392
2015-12-01 08:14:39 +00:00
Craig Topper 5ec97a7b9b [X86] Improve codegen for AVX2 gather with an all 1s mask.
Use undefined instead of setzero as the pass through input since its going to be fully overwritten. Use cmpeq of two zero vectors to produce the all 1s vector. Casting -1 to a double and vectorizing causes a constant load of a -1.0 floating point value.

llvm-svn: 254389
2015-12-01 07:12:59 +00:00
Alexey Bataev 49f6e78d71 [OPENMP 4.5] Parsing/sema analysis for 'taskloop' directive.
Adds initial parsing and semantic analysis for 'taskloop' directive.

llvm-svn: 254367
2015-12-01 04:18:41 +00:00
Richard Smith 64daf7b1a5 [modules] Don't reject multiple modules providing contents for the same embedded file.
llvm-svn: 254365
2015-12-01 03:32:49 +00:00
Richard Smith 5a99c49d2e Fix use-after-free when a C++ thread_local variable gets replaced (because its
type changes when the initializer is attached). Don't hold onto the
GlobalVariable*; recompute it from the VarDecl* instead.

llvm-svn: 254359
2015-12-01 01:10:48 +00:00
NAKAMURA Takumi 58a7577491 [PR25661] Revert part of r217213 according to r254323.
llvm-svn: 254346
2015-11-30 23:46:32 +00:00
Kostya Serebryany a94e6e7eb0 [libFuzzer] clarify the limitation of fsanitize-coverage=trace-cmp
llvm-svn: 254337
2015-11-30 22:17:19 +00:00
David Majnemer a381cda78c [MS Compat] Adjust thiscall to cdecl when deducing template arguments
Function types can be extracted from member pointer types.
However, the type is not appropriate without first adjusting the calling
convention.

This fixes PR25661.

llvm-svn: 254323
2015-11-30 20:34:28 +00:00
Samuel Antao e5113bce6c Add --gcc-toolchain= to one of the libclang unitests to fix issue related to
the gcc libraries clang picks for when it was configures with a user defined 
path.

llvm-svn: 254306
2015-11-30 17:26:28 +00:00
Aaron Ballman 415c414bf2 Do not crash when dumping the objc_bridge_related attribute when its optional arguments are not supplied.
Patch thanks to Joe Ranieri!

llvm-svn: 254303
2015-11-30 15:25:34 +00:00
Craig Topper 9b2438f6d1 Use range-based for loop to avoid the need for calculating an array size. NFC
llvm-svn: 254282
2015-11-30 03:11:12 +00:00
Craig Topper ac67c05a50 Use std::begin() and std::end() instead of doing the same manually. NFC
llvm-svn: 254281
2015-11-30 03:11:10 +00:00
Craig Topper e20b8c68ed [X86] _mm256_permutevar8x32_ps should take an integer vector for its shuffle index input.
llvm-svn: 254270
2015-11-29 22:53:32 +00:00
Simon Pilgrim a5c0493ddb [X86][SSE2] Added SSE2 IR + assembly codegen builtin tests
Improved tests as discussed in PR24580

llvm-svn: 254262
2015-11-29 20:23:00 +00:00
NAKAMURA Takumi 704b795634 clang/test/CodeGen/arm-v8.1a-neon-intrinsics.c REQUIRES both arm and aarch64.
llvm-svn: 254252
2015-11-29 13:43:05 +00:00
Alexandros Lamprineas cd8d973932 ARM v8.1a adds Advanced SIMD instructions for Rounding Double Multiply
Add/Subtract.

Add missing tests that accidentally were not committed in rL254250.

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

llvm-svn: 254251
2015-11-29 10:53:28 +00:00
Alexandros Lamprineas 502592c1d4 ARM v8.1a adds Advanced SIMD instructions for Rounding Double Multiply
Add/Subtract.

The following instructions are added to AArch32 instruction set:

- VQRDMLAH: Vector Saturating Rounding Doubling Multiply Accumulate
            Returning High Half
- VQRDMLSH: Vector Saturating Rounding Doubling Multiply Subtract
            Returning High Half

The following instructions are added to AArch64 instruction set:

- SQRDMLAH: Signed Saturating Rounding Doubling Multiply Accumulate
            Returning High Half
- SQRDMLSH: Signed Saturating Rounding Doubling Multiply Subtract
            Returning High Half

This patch adds intrinsic and ACLE macro support for these instructions,
as well as corresponding tests.

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

llvm-svn: 254250
2015-11-29 10:43:59 +00:00
Craig Topper 3a71f35a67 [X86] Remove temporary variables from intrinsic macros. NFC
llvm-svn: 254247
2015-11-29 06:50:33 +00:00
Daniel Sanders 54dd84d48f Fixed default label in fully covered switch warning that was introduced in r254203.
llvm-svn: 254208
2015-11-27 19:49:24 +00:00
Kelvin Li a15fb1a110 [OpenMP] Parsing and sema support for thread_limit clause.
http://reviews.llvm.org/D15029

llvm-svn: 254207
2015-11-27 18:47:36 +00:00
Artyom Skrobov d08cb6c528 int function without a return statement is invalid C++.
Changing the return type to void.

llvm-svn: 254206
2015-11-27 18:10:49 +00:00
Daniel Sanders bd3f47f5b5 [mips] Interrupt attribute support.
Summary: This patch adds support for the interrupt attribute for mips32r2+.

Patch by Simon Dardis.

Reviewers: dsanders, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

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

llvm-svn: 254205
2015-11-27 18:03:44 +00:00
Daniel Sanders 8f8eb8f545 Revert r254203: [mips] Interrupt attribute support.
I forgot to credit the author.

llvm-svn: 254204
2015-11-27 18:00:36 +00:00
Daniel Sanders 586be02495 [mips] Interrupt attribute support.
Summary: This patch adds support for the interrupt attribute for mips32r2+.

Reviewers: dsanders, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

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

llvm-svn: 254203
2015-11-27 17:39:20 +00:00
Joerg Sonnenberger 97f4d2c47f Revert Sparc and SparcV9 to external assembler. Now that the CPU
handling is corrected, the primary reason for forcing IAS as default is
gone and the remaining issues are still somewhat problematic in common
situations.

llvm-svn: 254199
2015-11-27 13:16:33 +00:00
Andrey Bokhanko 2a4db90157 [x86] Exclusion of incorrect include headers paths for MCU target
Exclusion of /usr/include and /usr/local/include headers paths for MCU target.

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

llvm-svn: 254195
2015-11-27 12:18:22 +00:00
Pierre Gousseau 2a3ca840e3 Test commit
Remove tabs.

llvm-svn: 254181
2015-11-26 22:08:58 +00:00
Justin Bogner 98712bd771 docs: Remove references to the long-defunct LLVM_USED_LIBS
LLVM_USED_LIBS hasn't done anything since 2012, stop telling people to
set it in the docs.

llvm-svn: 254173
2015-11-26 19:52:24 +00:00
Oliver Stannard 4cc70802c7 [AArch64] Add command-line options for Statistical Profiling Extension
This adds the "+profile" and +noprofile" suffixes for the -march and
-mcpu options, to allow enabling or disabling the options Statistical
Profiling Extension to ARMv8.2-A.

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

llvm-svn: 254161
2015-11-26 15:38:54 +00:00
Oliver Stannard 76afca7617 [AArch64] Add command-line options for ARMv8.2-A
This adds new values for the -march option (armv8.2a and armv8.2-a,
which are aliases of each other), and new suffixes for the -march and
-mcpu options (+fp16 and +nofp16), to allow targeting the ARMv8.2-A
architecture and it's optional half-precision floating-point extension.

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

llvm-svn: 254160
2015-11-26 15:36:42 +00:00
Alexander Musman f97c8933cb Fix for merging decls in pragma weak
Calling CheckFunctionDeclaration so that 2 decls for the 'weak' are merged.
Differential Revision: http://reviews.llvm.org/D13048

llvm-svn: 254143
2015-11-26 09:34:30 +00:00