Commit Graph

59593 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis e26aea5b29 [Frontend] Fix crash when serializing diagnostics with really long text.
rdar://21896690

llvm-svn: 244245
2015-08-06 18:46:36 +00:00
David Blaikie 4c96a5ef1c Fix memory ownership in the NeonEmitter by using values instead of pointers (smart or otherwise)
Improvement to the memory leak fix in 244196.

Address validity is required for the Intrinsic objects, but since the
collections only ever grow (no elements are removed), deque provides
sufficient guarantees (that the objects will never be reallocated/moved
around) for this use case.

llvm-svn: 244241
2015-08-06 18:29:32 +00:00
Alexey Bataev a889917493 [OPENMP 4.1] Allow references in init expression for loop-based constructs.
OpenMP 4.1 allows to use variables with reference types in private clauses and, therefore, in init expressions of the cannonical loop forms.

llvm-svn: 244209
2015-08-06 12:30:57 +00:00
Michael Kuperstein 819ad33f63 Mark calls in thunk functions as tail-call optimization candidates
When a thunk is generated with a call to the original adjusted function, 
the thunk appears in the debugger call stack. We want the backend to perform
tail-call optimization on the call, to make it invisible to the debugger.

This fixes PR24235

Patch by: amjad.aboud@intel.com
Differential Revision: http://reviews.llvm.org/D11476

llvm-svn: 244207
2015-08-06 11:57:15 +00:00
Michael Kuperstein d7b9392f59 [X86] Add support for _MM_ALIGN16
Differential Revision: http://reviews.llvm.org/D11753

llvm-svn: 244201
2015-08-06 08:24:38 +00:00
Yaron Keren 9f168530a2 Plug a memory leak in NeonEmitter: Intrinsics allocated were never released.
llvm-svn: 244196
2015-08-06 07:28:36 +00:00
Alex Denisov 5dfac81c60 [ObjC] Circular containers: add support of subclasses
llvm-svn: 244193
2015-08-06 04:51:14 +00:00
Richard Smith 0f4e2c4d0f [modules] Defer setting up the lookup table for a DeclContext until we can
determine the primary context, rather than sometimes registering the lookup
table on the wrong context.

This exposed a couple of bugs:
 * the odr violation check didn't deal properly with mergeable declarations
   if the declaration retained by name lookup wasn't in the canonical
   definition of the class
 * the (broken) RewriteDecl mechanism would emit two name lookup tables for
   the same DeclContext into the same module file (one as part of the
   rewritten declaration and one as a visible update for the old declaration)
These are both fixed too.

llvm-svn: 244192
2015-08-06 04:23:48 +00:00
Argyrios Kyrtzidis 3f84b7353b [test] Another attempt to fix the test.
llvm-svn: 244187
2015-08-06 01:06:55 +00:00
Eric Christopher 02d5d86b4e Rename the non-coding style conformant functions in namespace Builtins
to match the rest of their brethren and reformat the bits that need it.

llvm-svn: 244186
2015-08-06 01:01:12 +00:00
Justin Bogner e03437c756 Driver: Strip -header-include-file and -diagnostic-log-file from crash repro scripts
These two arguments tend to refer to a local path that won't exist
when we try to reproduce a bug. Strip them.

llvm-svn: 244179
2015-08-05 23:49:44 +00:00
Eric Christopher 964a5f3b5c Rename DescriptionString -> DataLayoutString as it matches the actual
use of the string.

llvm-svn: 244178
2015-08-05 23:48:05 +00:00
Argyrios Kyrtzidis 5365532b99 [test] Fix tests in non-darwin bots.
llvm-svn: 244176
2015-08-05 23:44:06 +00:00
Diego Novillo c4b94da00e Add -fno-coverage-mapping flag.
This new flag allows the user to disable a previous instance of
-fcoverage-mapping, if needed.

llvm-svn: 244170
2015-08-05 23:27:40 +00:00
Richard Smith 3cb15729af function_ref-ize ExternalASTSource::FindExternalLexicalDecl and remove its
useless return value. Switch to using it directly when completing the
redeclaration chain for an anonymous declaration, and reduce the set of
declarations that we load in the process to just those of the right kind.

llvm-svn: 244161
2015-08-05 22:41:45 +00:00
Diego Novillo 758f3f542a Add flags to disable profile generation.
This patch adds flags -fno-profile-instr-generate and
-fno-profile-instr-use, and the GCC aliases -fno-profile-generate and
-fno-profile-use.

These flags are used in situations where users need to disable profile
generation or use for specific files in a build, without affecting other
files.

llvm-svn: 244153
2015-08-05 21:49:51 +00:00
Douglas Katzman 44f5d18587 Reword a comment about IncludeDirGroup. NFC
Referring to the groups by mixing the enumerated name
with the command-line flag was not as clear as could be.

llvm-svn: 244150
2015-08-05 21:31:54 +00:00
Eric Christopher 53645350e2 Remove unused header includes.
llvm-svn: 244131
2015-08-05 21:11:56 +00:00
Eric Christopher 35869a26cd Rename builtin_lang -> Langs to match the rest of the code a bit better.
llvm-svn: 244126
2015-08-05 21:04:28 +00:00
Eric Christopher b20d7700cc Remove unused function GetBuiltinNames.
llvm-svn: 244125
2015-08-05 21:04:24 +00:00
James Dennett 7ab178a29a Documentation: fix another typo, "arrays types" -> "array types".
Thanks to Kim Gräsman <kim.grasman@gmail.com> for pointing this out.

llvm-svn: 244124
2015-08-05 20:58:23 +00:00
Chris Bieneman 936ff96fae [CMake] Add USES_TERMINAL 1 to ExternalProject_Add_Step calls on 3.3.20150708 and later.
llvm-svn: 244119
2015-08-05 20:46:39 +00:00
Eric Christopher 27fbefde07 Remove unused comparison operators from the Builtin Info struct.
llvm-svn: 244111
2015-08-05 20:11:04 +00:00
Yaron Keren a910741cea Remove unnecessary ClangLibdirSuffix variable.
Twine + const char * is supported.

llvm-svn: 244110
2015-08-05 20:06:56 +00:00
James Dennett 2a02557b4e Documentation: fix a typo, "This flag is determines" -> "This flag determines".
No functional change.

llvm-svn: 244104
2015-08-05 19:44:47 +00:00
Reid Kleckner 124955aade Add -gcodeview and -gdwarf to control which type Clang emits
Summary:
By default, 'clang' emits dwarf and 'clang-cl' emits codeview.  You can
force emission of one or both by passing -gcodeview and -gdwarf to
either driver.

Reviewers: dblaikie, hans

Subscribers: cfe-commits

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

llvm-svn: 244097
2015-08-05 18:51:13 +00:00
Renato Golin d45c2df4ab [AArch64] Enable thread sanitizer on clang
With this option, clang can use -fsanitize=thread on AArch64.

Patch by Adhemerval Zanella.

llvm-svn: 244091
2015-08-05 18:42:41 +00:00
Douglas Katzman 8b50e0175f Claim arguments that belong to 'clang_ignored_gcc_optimization_f_Group'
This seems preferable to printing two warnings per unsupported option-
one warning about not supporting it, and one about not using it.
It also makes the '-Wno-' option do what you mean.

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

llvm-svn: 244079
2015-08-05 18:03:47 +00:00
Argyrios Kyrtzidis 09b9f0eb07 [test] Attempt a change to see if it fixes the test for the windows bot.
llvm-svn: 244076
2015-08-05 17:52:57 +00:00
Chris Bieneman f2a00e9d2a [CMake] First pass at adding support for clang bootstrap builds to CMake
Summary:
This patch adds a new CLANG_ENABLE_BOOTSTRAP option to CMake which adds targets for building a stage2 bootstrap compiler. The targets are:

bootstrap-configure
bootstrap-build
bootstrap (same as bootstrap-configure and bootstrap-build)
bootstrap-install
bootstrap-check-llvm
bootstrap-check-clang
bootstrap-check-all

If you are using 3.3.20150708 or greater it utilizes the ninja USES_TERMINAL_* settings on the external project so that the output is properly buffered.

Reviewers: bogner, chandlerc

Subscribers: filcab, cfe-commits

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

llvm-svn: 244070
2015-08-05 17:38:12 +00:00
Argyrios Kyrtzidis 819f9ffe85 [test/Index] Update libclang tests to use libclang for creating PCH files.
This is consistent and tests the primary configuration we want to test, libclang
creating and consuming PCH files.

llvm-svn: 244066
2015-08-05 17:23:59 +00:00
Chandler Carruth 9ade6a9a74 Fix a tiny bug in -no-canonical-prefixes that somehow we have never
noticed until now.

The code for setting up the driver's InstalledDir didn't respect
-no-canonical-prefixes. Because of this, there are a few places in the
driver where we would unexpectedly form absolute paths, notably when
searching for and finding GCC installations to use, etc. The fix is
straightforward, and I've added this path to '-v' both so we can test it
sanely and so that it will be substantially more obvious the next time
someone has to debug something here.

Note that there is another bug that we don't actually *canonicalize* the
installed directory! I don't really want to fix that because I don't
have a realistic way to test the usage of this mode. I suspect that
folks using the shared module cache would care about getting this right
though, and so they might want to address it. I've left the appropriate
FIXMEs so that it is clear what to change, and I've updated the test
code to make it clear what is happening here.

llvm-svn: 244065
2015-08-05 17:07:33 +00:00
James Y Knight 81167fb799 Add missing atomic libcall support.
Support for emitting libcalls for __atomic_fetch_nand and
__atomic_{add,sub,and,or,xor,nand}_fetch was missing; add it, and some
test cases.

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

llvm-svn: 244063
2015-08-05 16:57:36 +00:00
Douglas Katzman fc29f69d74 [SHAVE] uppercase the CHECK prefixes in 'lit' tests. NFC
llvm-svn: 244052
2015-08-05 15:08:54 +00:00
Douglas Katzman 31fdbfe5c8 Delete trailing whitespace
llvm-svn: 244051
2015-08-05 15:08:53 +00:00
Chad Rosier ea43d95329 Officially end my reign as owner of the driver.
llvm-svn: 244049
2015-08-05 14:52:01 +00:00
Aaron Ballman 1ca258e6a8 Add AST matchers for narrowing constructors that are default, copy, or move constructors, as well as functionality to determine whether a ctor initializer is a base initializer.
llvm-svn: 244036
2015-08-05 12:11:30 +00:00
Benjamin Kramer 9cc21065b4 [AST] ArrayRefize template param list info setters. No functionality change intended.
llvm-svn: 244028
2015-08-05 09:40:49 +00:00
Benjamin Kramer b40e4af845 [AST] ArrayRefize BlockDecl::setCaptures. No functionality change intended.
llvm-svn: 244027
2015-08-05 09:40:35 +00:00
Benjamin Kramer cce6347be5 [AST] ArrayRefize template argument packs. No functionality change intended.
llvm-svn: 244026
2015-08-05 09:40:22 +00:00
Benjamin Kramer 1f11d45a3f [Comments] Replace custom ArrayRef copying with ArrayRef::copy. NFC.
llvm-svn: 244025
2015-08-05 09:40:04 +00:00
Benjamin Kramer fa7f85523f [Parse] ArrayRefize PragmaLoopHintInfo. No functionality change.
llvm-svn: 244024
2015-08-05 09:39:57 +00:00
Filipe Cabecinhas 650d7f7dd5 Don't repeat function names in comments. NFC.
llvm-svn: 244018
2015-08-05 06:19:26 +00:00
Tanya Lattner 4a08e931b6 Update mailing list references to lists.llvm.org
llvm-svn: 244000
2015-08-05 03:55:23 +00:00
Benjamin Kramer da32cf82ba [CodeGen] Fold memcpy into SmallVector initializer. No functionality change.
llvm-svn: 243992
2015-08-04 15:38:49 +00:00
Benjamin Kramer a00e997b4f [Sema] Add a crazy test case for r243987
It's not valid code (maybe it can be made valid, but I'm not sure how).
To trigger the crash fixed in r243987 requires a friend function with
more than four template parameter lists. With this test we have at least
some coverage.

llvm-svn: 243989
2015-08-04 15:18:16 +00:00
Benjamin Kramer 9dc549b1dd [Sema] Allocate SmallVector to the right size.
SmallVector::set_size does not reallocate the vector. Sadly I have no
idea how to test this. The vector never has more than one member in all
of the regression tests.

Found by inspection.

llvm-svn: 243987
2015-08-04 14:46:06 +00:00
Benjamin Kramer c9ba1bd20a [AST] Really allocate a SmallVector to the right size.
set_size only resets the end pointer and asserts if it is used to grow
the buffer. This would crash when mangling a float with more than 80 bits,
add a test with a ppc double double (128 bits).

Found by inspection.

llvm-svn: 243979
2015-08-04 13:34:50 +00:00
Benjamin Kramer 29111d5493 [AST] Simplify code by letting ArrayRef do the copying.
No functionality change intended.

llvm-svn: 243974
2015-08-04 12:59:41 +00:00
Benjamin Kramer 6c3e4ec449 [CodeGen] Don't write into a SmallVector's uninitialized memory.
That's just ugly and not needed in this case. No functionality change.

llvm-svn: 243973
2015-08-04 12:34:30 +00:00
Benjamin Kramer 2ab0d88b91 [ASTContext] Add a templated convenience wrapper for Allocate.
This brings ASTContext closer to LLVM's Allocator concept. Ideally we
would just derive ASTContext from llvm::AllocatorBase, but that does
not work because ASTContext's allocator is mutable and we allocate using
const ASTContext& everywhere.

llvm-svn: 243972
2015-08-04 12:34:23 +00:00
Benjamin Kramer da4690ae12 [FileManager] Use StringRef::copy to store canonical paths.
No functional change intended.

llvm-svn: 243970
2015-08-04 11:27:08 +00:00
Alexey Bataev 54acd40591 [OPENMP 4.1] Support for 'linear' clause in loop directives.
OpenMP 4.1 allows 'linear' clause in loop directives. Patch adds support for it.

llvm-svn: 243969
2015-08-04 11:18:19 +00:00
Benjamin Kramer 323dc2d064 [Edit] Use StringRef's copy method. No functional change intended.
llvm-svn: 243968
2015-08-04 11:18:09 +00:00
Benjamin Kramer 8d3bfd0fa1 [AST] Use StringRef's convenient copy method. No functionality change.
llvm-svn: 243966
2015-08-04 10:22:38 +00:00
Alexey Bataev 48977c3364 [OPENMP] Fix compiler crash during data-sharing attributes analysis.
If a global variable is marked as private in OpenMP construct and then is used in of the private clauses of the same construct, it might cause compiler crash because of incorrect capturing.

llvm-svn: 243964
2015-08-04 08:10:48 +00:00
Chandler Carruth 6ac555fb71 [UB] Avoid a really broken call to realloc that would later result in
a bad call to memcpy.

When we only have a buffer from one of the two reparse calls, we can
just return that buffer rather than going through the realloc/memcpy
dance.

Found with UBsan.

llvm-svn: 243950
2015-08-04 03:53:04 +00:00
Chandler Carruth 38a45cc686 [UB] Guard two calls to memcpy in generated attribute code to handle
null StringRef objects as inputs.

Found by UBSan.

llvm-svn: 243949
2015-08-04 03:53:01 +00:00
Chandler Carruth a91ba1260a [UB] Another place where we were trying to put string data into
a BumpPtrAllocator. This at least now handles the case where there is no
concatentation without calling memcpy on a null pointer. It might be
interesting to handle the case where everything is empty without
round-tripping through the allocator, but it wasn't clear to me if the
pointer returned is significant in any way, so I've left it in
a conservatively more-correct state.

Again, found with UBSan.

llvm-svn: 243948
2015-08-04 03:53:00 +00:00
Chandler Carruth f0c627d5f8 [UB] When attaching empty strings to the AST, use an empty StringRef
rather than forcing the bump pointer allocator to produce a viable
pointer. This also fixes UB when we would try to memcpy from the null
incoming StringRef.

llvm-svn: 243947
2015-08-04 03:52:58 +00:00
Chandler Carruth b6708d8ebf [UB] Fix the two ways that we would try to memcpy from a null buffer in
the nested name specifier code.

First, skip the entire thing when the input is empty.

Next, handle the case where we started off with a null buffer and a zero
capacity to skip copying and freeing.

This was found with UBSan.

llvm-svn: 243946
2015-08-04 03:52:56 +00:00
Chandler Carruth d96e877788 [UB] Fix two cases of UB in copy/pasted code from SmallVector.
We should really stop copying and pasting code around. =/

Found by UBSan.

llvm-svn: 243945
2015-08-04 03:52:52 +00:00
Richard Smith 8cbd895947 [modules] Make IndirectFieldDecl mergeable to avoid lookup ambiguity when the same anonymous union is defined across multiple modules.
llvm-svn: 243940
2015-08-04 02:05:09 +00:00
Argyrios Kyrtzidis 0ce08b890e Remove unused header include.
llvm-svn: 243938
2015-08-04 01:44:13 +00:00
Naomi Musgrave bb4df94faa Dtor callback emitted when msan attribute not repressed for this function.
Summary: In addition to checking compiler flags, the front-end also examines the attributes of the destructor definition to ensure that the SanitizeMemory attribute is attached.

Reviewers: eugenis, kcc

Subscribers: cfe-commits

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

refactored test into new file, revised how function attribute examined

modified test to examine default dtor with and without attribute

removed attribute check

llvm-svn: 243912
2015-08-03 22:53:11 +00:00
Justin Bogner 5ff020a6b6 X86: Teach X86 builtins which target features they require
This adds the required target feature names to x86 builtins that need
particular features. Most have exactly one ("avx", "aes", etc), but some
of the avx512 features have multiple requirements, eg "avx512vl,avx512bw".

llvm-svn: 243908
2015-08-03 22:26:06 +00:00
Douglas Katzman 1e7bf36f45 Grammar: Don't imply that a program wouldn't want a person as its output.
(Because, hey, who wouldn't?)

llvm-svn: 243901
2015-08-03 20:41:31 +00:00
Douglas Katzman f607111d95 [SHAVE] Pass all -f, -g, -O, -W options through directly to moviCompile.
Differential Revision: http://reviews.llvm.org/D11581

llvm-svn: 243878
2015-08-03 14:34:22 +00:00
Nathan Wilson 8567a000b9 [CONCEPTS] Add concept to VarDecl and diagnostic for uninitialized variable concept
Summary: Add IsConcept bit to VarDecl::NonParmVarDeclBitfields and associated isConcept/setConcept member functions. Set IsConcept to true when 'concept' specifier is in variable declaration. Create diagnostic when variable concept is not initialized.

Reviewers: fraggamuffin, hubert.reinterpretcast, faisalv, aaron.ballman, rsmith

Subscribers: aemerson, cfe-commits

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

llvm-svn: 243876
2015-08-03 14:25:45 +00:00
Andrey Bokhanko d9eab9cc13 Additional fix for PR14269: Crash on vector elements / global register vars in inline assembler.
Compiler crashed when vector elements / global register vars were used in inline assembler with "m" restriction. This patch fixes this.

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

llvm-svn: 243870
2015-08-03 10:38:10 +00:00
Asaf Badouh c68e347c25 [X86][AVX512VLBW] add pack, cvt, mulhi and madd intrinsics
Differential Revision: http://reviews.llvm.org/D11642

llvm-svn: 243867
2015-08-03 07:51:00 +00:00
Simon Pilgrim 4034b9f0b9 Fix invalid shufflevector operands
This patch fixes bug 23800 ( https://llvm.org/bugs/show_bug.cgi?id=23800#c2 ). There existed a case where the index operand from extractelement was directly used to create a shufflevector mask. Since the index can be of any integral type but the mask must only contain 32 bit integers a 64 bit index operand led to an assertion error later on.

Committed on behalf of mpflanzer (Moritz Pflanzer)

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

llvm-svn: 243851
2015-08-02 15:28:10 +00:00
Asaf Badouh 73b639f650 [X86][AVX512VLDQ] add reduce/range/cvt intrinsics
add 128 & 256 width intrinsic versions of reduce/range and cvt i64 to FP and vice versa

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

llvm-svn: 243848
2015-08-02 12:43:08 +00:00
Yaron Keren ede603057e Rangify for loops, NFC.
llvm-svn: 243841
2015-08-01 19:11:36 +00:00
Davide Italiano 9e1006d785 Revert r243827.
Until I figure out what's the right way of updating this file.

llvm-svn: 243840
2015-08-01 18:25:03 +00:00
Davide Italiano f76da1dac9 [SemaExpr] Factor out common diagnostic code for remainder/division.
llvm-svn: 243832
2015-08-01 10:13:39 +00:00
David Majnemer e5c8787521 [MS ABI] Create a mangling for extended vector types
Extended vector types are mangled just like normal vector types.

llvm-svn: 243828
2015-08-01 05:51:55 +00:00
Davide Italiano 2dd004487d Convertibility of nullptr_t to bool is available in clang. Note it.
llvm-svn: 243827
2015-08-01 05:48:03 +00:00
David Majnemer e40fe37c43 Use the reserved keyword spelling of 'typeof'
No functional change intended, just a drive-by cleanup.

llvm-svn: 243826
2015-08-01 05:31:56 +00:00
Yunzhong Gao 7704ba7f97 [Tests] Add explicit -std=lang option to a number of tests.
This patch should not change the test results, but it is useful if clang's
default C++ language is ever changed from gnu++98.

Patch by: Charles Li

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150727/134667.html

llvm-svn: 243819
2015-08-01 02:55:59 +00:00
Kostya Serebryany b17e298a64 [libFuzzer] minimal documentation on data-flow-guided fuzzing
llvm-svn: 243793
2015-07-31 21:48:10 +00:00
Nathan Wilson 8fbfb01b11 test commit; wrap ellipses in comment with brackets
llvm-svn: 243776
2015-07-31 20:00:02 +00:00
Duncan P. N. Exon Smith 38a7f11a5a DI: Update testcases for LLVM assembly change
Update testcases after LLVM change r243774.

Most of these had no need to check `tag:` field, but did so as a way of
getting to the `name:` field.  In a few cases I've converted the `tag:`
checks to `arg:` or `CHECK-NOT: arg:`.

llvm-svn: 243775
2015-07-31 18:59:37 +00:00
David Majnemer dbf1045ad7 [MS ABI] Hook clang up to the new EH instructions
The new EH instructions make it possible for LLVM to generate .xdata
tables that the MSVC personality routines will be happy about.  Because
this is experimental, hide it behind a -cc1 flag (-fnew-ms-eh).

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

llvm-svn: 243767
2015-07-31 17:58:45 +00:00
Duncan P. N. Exon Smith e430654fd8 DI: Update for LLVM API change for local variables
Adjust to LLVM DIBuilder API changes in r243764, using
`createAutoVariable()` and `createParameterVariable()` in place of
`createLocalVariable()`.  No real functionality change here.

llvm-svn: 243765
2015-07-31 17:56:14 +00:00
Alexey Bataev 05c25d64c1 Outline function Parser::ParseCXXClassMemberDeclarationWithPragmas(), NFC.
Parsing of pragmas followed by a class member declaration is outlined into a separate function Parser::ParseCXXClassMemberDeclarationWithPragmas().

llvm-svn: 243739
2015-07-31 08:42:25 +00:00
Argyrios Kyrtzidis 403cbcb84d Make sure the 2 method calls are sequenced.
llvm-svn: 243727
2015-07-31 01:39:23 +00:00
Argyrios Kyrtzidis c56419ed00 [modules] Fix issue where building a module from a relative path when -working-directory option is set, results in error.
The error was "module '<name>' was built in directory '<path>' but now resides in directory '<path>'
rdar://21330027

llvm-svn: 243718
2015-07-31 00:58:32 +00:00
David Blaikie ce3e7a614a Split DWARF: Allow -gmlt/-gsplit-dwarf to override rather than complement each other
It doesn't make any sense to enable -gmlt with -gsplit-dwarf, since
-gmlt is designed for on-line symbolication (and -gsplit-dwarf normally
emits all the -gmlt data into the .o anyway - so there's nothing to
split out except redundant/duplicate info).

With this change they override each other, -gmlt -gsplit-dwarf is the
same as -gsplit-dwarf and -gsplit-dwarf -gmlt is the same as -gmlt.

llvm-svn: 243694
2015-07-30 21:42:22 +00:00
Hubert Tong 0deb694d94 Improved error recovery for _Pragma
Summary:
Currently, if the argument to _Pragma is not a parenthesised string
literal, the bad token will be consumed, as well as the ')', if present.
If additional bad tokens are passed to the _Pragma, this results in
extra error messages which may distract from the true problem.

The proposed patch causes all tokens to be consumed until the closing
')' or a new line, whichever is reached first.

Reviewers: hfinkel, rsmith

Subscribers: hubert.reinterpretcast, fraggamuffin, rnk, cfe-commits

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

Patch by Rachel Craik!

llvm-svn: 243692
2015-07-30 21:30:00 +00:00
Hubert Tong a67833bb35 [Concepts] Add diagnostic: non template declaration
Summary:
Adding diagnostic for concepts declared as non template (function
or variable)

Reviewers: faisalv, fraggamuffin, rsmith, hubert.reinterpretcast

Subscribers: nwilson, cfe-commits

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

Patch by Nathan Wilson!

llvm-svn: 243690
2015-07-30 21:20:55 +00:00
Adhemerval Zanella 76aee67150 [sanitizers] Enable dfsan for aarch64
This patch enables DFSan for aarch64/linux.

llvm-svn: 243685
2015-07-30 20:50:39 +00:00
Argyrios Kyrtzidis c0d4b00fee [sema] Allow to opt-out of overriding the super class's designated initializers by marking the initializer as unavailable in the subclass.
rdar://20281322

llvm-svn: 243676
2015-07-30 19:06:04 +00:00
Naomi Musgrave e96b85166b simplified test case
llvm-svn: 243673
2015-07-30 17:59:55 +00:00
Naomi Musgrave 9476ee947b removed hardcoding for attribute associated with dtor in test
llvm-svn: 243672
2015-07-30 17:59:54 +00:00
Naomi Musgrave 690132b344 Testing to verify function attribute disable-tail-calls applied to destructor
llvm-svn: 243671
2015-07-30 17:59:52 +00:00
Naomi Musgrave 3d451678f8 updated test to be more explicit
llvm-svn: 243670
2015-07-30 17:59:50 +00:00
Naomi Musgrave 5c79fb72fa Updated test regex and flags
llvm-svn: 243669
2015-07-30 17:59:48 +00:00
Naomi Musgrave 21792b145d repress tail call optimization when performing use-after-dtor sanitization
Reviewers: eugenis, kcc

Subscribers: cfe-commits

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

llvm-svn: 243668
2015-07-30 17:59:46 +00:00
Pete Cooper 57d3f14502 Use llvm::reverse to make a bunch of loops use foreach. NFC.
In llvm commit r243581, a reverse range adapter was added which allows
us to change code such as

  for (auto I = Fields.rbegin(), E = Fields.rend(); I != E; ++I) {

in to

  for (const FieldDecl *I : llvm::reverse(Fields))

This commit changes a few of the places in clang which are eligible to use
this new adapter.

llvm-svn: 243663
2015-07-30 17:22:52 +00:00
Pete Cooper bfcf676737 Add fmodules-cache-path to 2 tests which were missing it.
These tests were creating a modules.idx file in my clang checkout, not
the build directory or temp.

All the other tests in this directory use -fmodules-cache-path=%t so
updated these to match.

llvm-svn: 243657
2015-07-30 16:44:07 +00:00
Renato Golin 23459c61cb [ARM] Allow setting the generic features for native cpus
Copying the already existing code for x86 to ARM to set the correct CPU
features when using -mcpu=native. We can already detect the CPU name
but we were not setting the correct feature bits.

Moving fpu/hwdiv down to make sure they override whatever we set the
default to be.

No tests because this is native detection, and not all ARM-enabled builds
will hapen at a specific CPU, or even ARM. I have tested locally and it
works as expected.

Fixes PR12794.

llvm-svn: 243656
2015-07-30 16:40:17 +00:00
Ulrich Weigand d6665178a8 Fix sanitizer fallout from r243642
The memory-sanitizer build bot reported:

==5574== WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f03089e15f6 in
clang::Parser::TryAltiVecTokenOutOfLine(clang::DeclSpec&,
clang::SourceLocation, char const*&, unsigned int&, bool&)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseDecl.cpp:6290:11

This is because the "Ident_pixel" variable was uninitialized
in the getLangOpts().ZVector case, but we'd still call into
clang::Parser::TryAltiVecTokenOutOfLine, which uses the variable.

The simplest fix for this without sprinkling !getLangOpts().ZVector
checks all over the code seems to be to just initialize the variable
to nullptr; this will then do the right thing on ZVector.

Checked in to unbreak the build bots.

llvm-svn: 243644
2015-07-30 15:53:58 +00:00
Ulrich Weigand ca25643a05 [SystemZ] Add support for vecintrin.h vector built-in functions
This patch adds support for the System Z vector built-in functions.
The API-defined header file has the name vecintrin.h.

The user-level functions are defined in the same style as the clang
version of altivec.h, making heavy use of the __overloadable__ and
__always_inline__ attributes.  Where possible the functions expand to
generic operations rather than specific built-in functions, in the hope
that that form can be optimised better.

Where a built-in routine is specified to require an immediate integer
argument, the __enable_if__ attribute is used to verify the argument is
in fact constant and in the appropriate range.

Based on a patch by Richard Sandiford.

llvm-svn: 243643
2015-07-30 14:10:43 +00:00
Ulrich Weigand 3c5038a535 Add support for System z vector language extensions
The z13 vector facility has an associated language extension,
closely modeled on AltiVec/VSX.  The main differences are:

- vector long, vector float and vector pixel are not supported

- vector long long and vector double are supported (like VSX)

- comparison operators return a vector rather than a scalar integer

- shift operators behave like the OpenCL shift operators

- vector bool is only supported as argument to certain operators;
  some operators allow mixing a bool with a non-bool vector 

This patch adds clang support for the extension.  It is closely modelled
on the AltiVec support.  Similarly to the -faltivec option, there's a
new -fzvector option to enable the extensions (as well as an -mzvector
alias for compatibility with GCC).  There's also a separate LangOpt.

The extension as implemented here is intended to be compatible with
the -mzvector extension recently implemented by GCC.

Based on a patch by Richard Sandiford.

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

llvm-svn: 243642
2015-07-30 14:08:36 +00:00
Alexey Bataev 10e775f4a8 [OPENMP 4.1] Initial support for extended 'ordered' clause.
OpenMP 4.1 introduces optional argument '(n)' for 'ordered' clause, where 'n' is a number of loops that immediately follow the directive.
'n' must be constant positive integer expressions and it must be less or equal than the number of the loops in the resulting loop nest.
Patch adds parsing and semantic analysis for this optional argument.

llvm-svn: 243635
2015-07-30 11:36:16 +00:00
Michael Kuperstein 2229ca71fd [X86] Recognize "flags" as an identifier, not a register in Intel-syntax inline asm
This contains the test-case for r243630.

Patch by: marina.yatsina@intel.com
Differential Revision: http://reviews.llvm.org/D11513

llvm-svn: 243632
2015-07-30 10:10:47 +00:00
Sean Silva de3816655a Add a comment explaining differing Windows behavior.
llvm-svn: 243625
2015-07-30 07:30:24 +00:00
Sean Silva 5a45222745 Enable accidentally-disabled tests.
I think I was isolating the failure in the last RUN: line during
development, and forgot to re-enable the others.

llvm-svn: 243624
2015-07-30 07:23:17 +00:00
Asaf Badouh d6cb100bc2 [X86][AVX512BW] Remove whitespaces
llvm-svn: 243623
2015-07-30 06:52:26 +00:00
Richard Smith bdf2d93fe9 Remove some noise "this->"s left behind by r243213.
llvm-svn: 243614
2015-07-30 03:37:16 +00:00
Richard Smith f02662dec0 [modules] Remove redundant information written into DeclContext name lookup tables. We don't need to store the data length twice.
llvm-svn: 243612
2015-07-30 03:17:16 +00:00
Sean Silva 00bd0a4034 Remove bad test.
We currently don't canonicalize paths in the preprocessed files.
But we do when writing to PCH.
This causes a discrepancy on Windows with the test below.
This test fails even on unix if you change the test to use
`%S//preprocess.h`.

I am led to conclude that the invariant that this test was intending to
test has not been upheld for a while (and may never have been).

llvm-svn: 243602
2015-07-30 01:21:56 +00:00
Sean Silva 3e36e507ec Attempt to make clang-x64-ninja-win7 happy.
It looks like we were somehow relying somewhere on removing 'foo/./bar'
but *not* 'foo/../foo/bar'. Currently investigating.

llvm-svn: 243600
2015-07-30 00:52:32 +00:00
Sean Silva b963dedbe8 Avoid failure to canonicalize '..'.
Also fix completely broken and untested code which was hiding the
primary bug. The !LLVM_ON_UNIX branch of the ifdef was actually a no-op.

I ran into this in the wild. It was causing failures in our SDK build.

Ideally we'd have a perfect llvm::sys::fs::canonical, but at least this
is a step in the right direction, and fixes an obviously broken case.
In some sense the test case I've added here is an integration test. We
should have these routines thoroughly unit tested in llvm::sys::fs.

llvm-svn: 243597
2015-07-30 00:26:34 +00:00
Richard Trieu 1993dc8b15 Fix -Wredundant-move warning.
Without DR1579 implemented, the only case for -Wredundant-move is for a
parameter being returned with the same type as the function return type.  Also
include a check to verify that the move constructor will be used by matching
nodes in the AST dump.

llvm-svn: 243594
2015-07-29 23:47:19 +00:00
Richard Smith 826711d456 [modules] When performing redeclaration lookup for a using declaration, prefer
UsingShadowDecls over other declarations of the same entity in the lookup
results. This ensures that we build correct redeclaration chains for the
UsingShadowDecls (otherwise we could see assertions and other misbehavior in
modules builds, when merging combines multiple redeclaration chains for the
same entity from the same module into one chain).

llvm-svn: 243592
2015-07-29 23:38:25 +00:00
Davide Italiano 9b950d8148 [SemaAccess] Provide meaningful message when we hit llvm_unreachable().
llvm-svn: 243571
2015-07-29 20:55:04 +00:00
Douglas Katzman 57a9c7eba5 Use the AddAllArgs overload which accepts an ArrayRef of OptSpecifier.
Differential Revision: http://reviews.llvm.org/D11599

llvm-svn: 243552
2015-07-29 18:39:14 +00:00
Richard Trieu 6093d143c5 Disable -Wpessimizing-move and -Wredundant-move in template instantiations.
Dependent types can throw off the analysis for these warnings, possibly giving
conflicting warnings and fix-its.  Disabling the warning in template
instantiations will prevent this problem, and will still catch the
non-dependent cases in templates.

llvm-svn: 243538
2015-07-29 17:03:34 +00:00
Yaron Keren 04da2385cf In case of an existing GlobalVariable, the comdat is created using the name of the
new GV (usually NAME.1) instead of the correct NAME of the old GV. Moving comdat
creation after GV replacement solves this. Patch + testcase.

Reviewed by Reid Kleckner.

http://reviews.llvm.org/D11594

llvm-svn: 243525
2015-07-29 15:42:28 +00:00
Yaron Keren 63afb67992 Make this test target x86_64-pc-windows-gnu as well.
llvm-svn: 243523
2015-07-29 15:28:02 +00:00
Akira Hatanaka 085da7ecae [AArch64] Pass subtarget feature "+strict-align".
This commit changes the driver to save subtarget feature "+strict-align"
to the IR instead of using backend option "aarch64-strict-align". This is
needed for LTO.

rdar://problem/21529937

llvm-svn: 243518
2015-07-29 14:25:58 +00:00
Yaron Keren e46f7ed695 Remove unnecessary variable.
llvm-svn: 243517
2015-07-29 14:21:47 +00:00
Asaf Badouh 1998eb2077 [X86][AVX512BW] add convert i16 to i8 and unpack intrinsics
Differential Revision: http://reviews.llvm.org/D11564

llvm-svn: 243514
2015-07-29 12:34:20 +00:00
Asaf Badouh a6c31703ac [X86][AVX512BW] Replace attributes with __DEFAULT_FN_ATTRS
llvm-svn: 243512
2015-07-29 12:22:19 +00:00
Akira Hatanaka 7651dd8359 [ARM] Pass subtarget feature "+strict-align".
This commit changes the driver to save subtarget feature "+strict-align" to the
IR instead of using backend option "arm-strict-align". This is needed for LTO.

Also, move the logic in ARM backend that was deciding whether strict alignment
should be forced to the front-end.

rdar://problem/21529937

http://reviews.llvm.org/D11472

llvm-svn: 243489
2015-07-28 22:26:45 +00:00
Artem Belevich baae093e49 Silence unused argument warning for --cuda-host-only.
Differential Revision: http://reviews.llvm.org/D11575

llvm-svn: 243479
2015-07-28 21:01:30 +00:00
Artem Belevich 4242f41d8a --cuda-host-only should not disable linking phase.
Host-only cuda compilation does produce valid host object
file and in some cases users do want to proceed on to the linking phase.
The change removes special case that stopped compilation pipeline at
the Assembly phase. Device-side compilation is still stopped early
by the types::getCompilationPhases().

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

llvm-svn: 243478
2015-07-28 21:01:21 +00:00
Richard Trieu 97c45b6588 Use an iterative method instead of recursion for printing macro backtraces.
Store the locations for a macro expansion in a vector, then iterate over them
instead of using recursion.  This simplifies the logic around the backtrace
limit and gives easier access to the source locations.  No functionality change.

Patch by Zhengkai Wu.

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

llvm-svn: 243477
2015-07-28 20:53:46 +00:00
Richard Trieu 8d4006a079 Do not give a -Wredundant-move warning when removing the move will result in an
error.

If the object being moved has a move constructor and a deleted copy constructor,
std::move is required, otherwise Clang will give a deleted constructor error.

llvm-svn: 243463
2015-07-28 19:06:16 +00:00
Argyrios Kyrtzidis e159a73c76 [test] Follow-up for r243119, also add a test case using property methods.
llvm-svn: 243455
2015-07-28 17:38:51 +00:00
Nico Weber 5672e67b14 Rename -Wmsvc-include to -Wmicrosoft-include, now that -Wmicrosoft is split up.
(Keep -Wmsvc-include around as an alias.)

While here, also replace the one other mention of "MSVC" in diagnostics with
"Microsoft", for consistency.

llvm-svn: 243444
2015-07-28 16:48:12 +00:00
Chih-Hung Hsieh 2c656c9417 Add -femulated-tls flag to select the emulated TLS model.
This will be used for old targets like Android that do not
support ELF TLS models.

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

llvm-svn: 243441
2015-07-28 16:27:56 +00:00
Benjamin Kramer 9938310ab3 [CodeGen] Simplify creation of shuffle masks.
No functional change intended.

llvm-svn: 243439
2015-07-28 16:25:32 +00:00
Piotr Padlewski 44b4ce8e9b Getting rid of old iterator loops
llvm-svn: 243431
2015-07-28 16:10:58 +00:00
Manuel Klimek 9e32199861 Do not force linebreaks when MaxEmptyLinesToKeep is 0.
Previously we would format
 call(

     p);
as
 call(
     p);
with MaxEmptyLinesToKeep == 0.

Now we format it as:
  call(p);

llvm-svn: 243429
2015-07-28 15:50:24 +00:00
Benjamin Kramer c385a808b8 [CodeGen] Clean up CGBuiltin a bit.
- Use cached LLVM types
- Turn SmallVectors into Arrays/ArrayRef if the size is static
- Use ConstantInt::get's implicit splatting for vector types

No functionality change intended.

llvm-svn: 243425
2015-07-28 15:40:11 +00:00
Kristof Beyls 918f8ab7c6 RegParmMax must be 0 for AArch64, as the regparm function attribute is not supported on AArch64.
llvm-svn: 243417
2015-07-28 14:23:47 +00:00
Adhemerval Zanella 3916c910d1 [AArch64] Implement __builtin_thread_pointer
This path add the aarch64 __builtin_thread_pointer support.  It will be
lowered to llvm.aarch64.thread.pointer.

llvm-svn: 243413
2015-07-28 13:10:10 +00:00
Asaf Badouh 93aa4c808a [X86][AVX512VL] add AVX512VL intrinsics 4 out of 4
Differential Revision: http://reviews.llvm.org/D11526

llvm-svn: 243409
2015-07-28 12:04:40 +00:00
Asaf Badouh b7cf71b63d [X86][AVX512VL] add AVX512VL intrinsics 3 out of 4
http://reviews.llvm.org/D11526

llvm-svn: 243406
2015-07-28 11:14:09 +00:00
Asaf Badouh 78ee5cc8e1 [X86][AVX512VL] add AVX512VL intrinsics 2 out of 4
http://reviews.llvm.org/D11526

llvm-svn: 243402
2015-07-28 10:30:56 +00:00
Alexandros Lamprineas e5b47640ee Use TargetParser to parse -mhwdiv command line option in Driver.
Change-Id: I2ebc40f77af75ec6b43ce8364d6d5a1d29988bd6
Phabricator: http://reviews.llvm.org/D11501
llvm-svn: 243398
2015-07-28 09:08:03 +00:00
Asaf Badouh 74da38706e [X86][AVX512VL] add AVX512VL intrinsics 1 out of 4
http://reviews.llvm.org/D11526

llvm-svn: 243394
2015-07-28 08:26:14 +00:00
Argyrios Kyrtzidis c2a589169c [sema] Fix crash when typo-transforming an expression containing an ObjC super message expression.
rdar://21427916

llvm-svn: 243387
2015-07-28 06:12:24 +00:00
Yaron Keren 70bd288534 Make local function isWhitespaceExceptNL static instead of in anonymous namespace
per the coding standard. Thanks Craig Tooper for noticing this.

llvm-svn: 243381
2015-07-28 04:54:03 +00:00
Nico Weber b84c0d99b4 Fix what looks like accidentally repeated file contents. No behavior change.
llvm-svn: 243376
2015-07-28 03:37:54 +00:00
Nico Weber cee4d85faf Split -Wmicrosoft into many specific warnings.
Also move "pragma comment" warning from -Wmicrosoft to -Wignored-pragmas.

-Wmicrosoft currently covers many different areas, some more useful than
others.  Split it into many targeted flags, so that projects can choose to
enable only a subset of these warnings.  This is also useful for incrementally
fixing and turning on these warnings.

-Wno-microsoft still disables all these warnings, and -Wmicrosoft still enables
them all.  After this change, it's possible to pass `-Wno-microsoft
-Wmicrosoft-unqualified-friend` to only enable -Wmicrosoft-unqualified-friend,
and `-Wmicrosoft -Wno-microsoft-unqualified-friend` to enable all other
Microsoft warnings.

I put all the template-related warnings behind -Wmicrosoft-template; if that
turns out to be too coarse we can make that finer later on. (In practice, I
haven't seen the template-related warnings fire frequently.)

Reviewed at http://reviews.llvm.org/D11504

llvm-svn: 243371
2015-07-28 02:37:37 +00:00
Justin Bogner 203f09223b InstrProf: Fix a misuse of the FunctionDecl API when generating coverage
This was calling FD->hasBody(), meaning "Does the function that this
decl refers to have a body?", rather than
FD->doesThisDeclarationHaveABody(), meaning "Is this decl a
non-deleted definition?".

We might want to consider renaming these APIs :/

llvm-svn: 243360
2015-07-28 00:41:51 +00:00