Commit Graph

40916 Commits

Author SHA1 Message Date
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
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
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
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
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
Yaron Keren a910741cea Remove unnecessary ClangLibdirSuffix variable.
Twine + const char * is supported.

llvm-svn: 244110
2015-08-05 20:06:56 +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
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 31fdbfe5c8 Delete trailing whitespace
llvm-svn: 244051
2015-08-05 15:08:53 +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 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
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 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 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
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
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
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