Commit Graph

40901 Commits

Author SHA1 Message Date
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
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
Nathan Wilson 8fbfb01b11 test commit; wrap ellipses in comment with brackets
llvm-svn: 243776
2015-07-31 20:00:02 +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 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