Commit Graph

56662 Commits

Author SHA1 Message Date
David Majnemer bda8632f9b Parse: Handle __declspec in a lambda definition
llvm-svn: 228121
2015-02-04 08:22:46 +00:00
David Majnemer 631a90b6bc Sema: Add support for __declspec(restrict)
__declspec(restrict) and __attribute(malloc) are both handled
identically by clang: they are allowed to the noalias LLVM attribute.

Seeing as how noalias models the C99 notion of 'restrict', rename the
internal clang attribute to Restrict from Malloc.

llvm-svn: 228120
2015-02-04 07:23:21 +00:00
Anna Zaks a3d9534248 Register parameters have local storage.
Fixes a regression introduced in r209149.

llvm-svn: 228119
2015-02-04 07:15:12 +00:00
Sameer Sahasrabuddhe e8d2aaf320 OpenCL: handle ternary operator when the condition is a vector
When the condition is a vector, OpenCL specifies additional
requirements on the operand types, and also the operations
required to determine the result type of the operator. This is a
combination of OpenCL v1.1 s6.3.i and s6.11.6, and the semantics
remain unchanged in later versions of OpenCL.

llvm-svn: 228118
2015-02-04 06:38:18 +00:00
Alexey Bataev 8f01bb983c [MSVC2012] Allow 'mutable' references
Some standard header files from MSVC2012 use 'mutable' on references, though it is directly prohibited by the standard.
Fix for http://llvm.org/PR22444
Differential Revision: http://reviews.llvm.org/D7370

llvm-svn: 228113
2015-02-04 04:45:32 +00:00
Rafael Espindola d94d25301c Make this test stricter. NFC.
llvm-svn: 228112
2015-02-04 04:23:48 +00:00
David Majnemer df1e1aee4c Fix ARM buildbot
llvm-svn: 228111
2015-02-04 03:30:00 +00:00
Larisse Voufo 5ecfede65c Fix typo in test case.
llvm-svn: 228110
2015-02-04 03:16:46 +00:00
Larisse Voufo eebe962eda Fix typo in test case.
llvm-svn: 228108
2015-02-04 02:46:33 +00:00
Larisse Voufo 404e142ed7 Generalize r228066 to give all implicit global allocation functions default visibility.
llvm-svn: 228107
2015-02-04 02:34:32 +00:00
Richard Smith 90fff92b34 Add missing file from r228104.
llvm-svn: 228105
2015-02-04 01:51:12 +00:00
Richard Smith 7483d20e77 [modules] If we already have a fake definition for one declaration of a class,
don't think we're providing a new one in an update record adding a definition
to another declaration of the same class.

llvm-svn: 228104
2015-02-04 01:23:46 +00:00
NAKAMURA Takumi 493dae89e8 clang/test/CodeGenCXX/cxx14-implicit-sized-delete.cpp: Unbreak build to add explicit triple x86_64-unknown.
It seems incompatible to i686.

llvm-svn: 228100
2015-02-04 01:00:12 +00:00
NAKAMURA Takumi 44d96be561 clang/test/CodeGenCXX/cxx14-implicit-sized-delete.cpp: Fix for -Asserts.
llvm-svn: 228099
2015-02-04 01:00:04 +00:00
NAKAMURA Takumi 46333480f2 Add LF to EOF.
llvm-svn: 228098
2015-02-04 00:59:59 +00:00
Akira Hatanaka 96a36017f7 [inlineasm] Fix an incorrect warning about register constraint and modifier.
Previously, when the following piece of code was compiled, clang would
incorrectly warn that the size of "wide_two" does not match register size
specified by the constraint and modifier":

long wide_two = two;
asm ("%w0 %1" : "+r" (one), "+r"(wide_two));

This was caused by a miscalculation of ConstraintIdx in Sema::ActOnGCCAsmStmt.

This commit fixes PR21270 and rdar://problem/18668354.

llvm-svn: 228089
2015-02-04 00:27:13 +00:00
David Majnemer bc18d6ab05 Unbreak the MIPS buildbot
llvm-svn: 228088
2015-02-04 00:26:13 +00:00
David Majnemer 1cf22e690d Headers: Don't use attribute keywords which aren't reserved
Instead of using 'unavailable', use '__unavailable__'

llvm-svn: 228087
2015-02-04 00:26:10 +00:00
Justin Bogner fd34280b8e InstrProf: Update for LLVM API change
Update for the API change in r228075

llvm-svn: 228076
2015-02-03 23:59:48 +00:00
Larisse Voufo fce61d3fc8 PR22419: Give implicit sized deallocation functions default visibility
llvm-svn: 228066
2015-02-03 23:31:50 +00:00
David Majnemer 64b2a2628f Unbreak hexagon bot
llvm-svn: 228065
2015-02-03 23:21:21 +00:00
Nico Weber f3e46ad485 Wrap to 80 columns. No behavior change.
llvm-svn: 228063
2015-02-03 23:10:18 +00:00
David Majnemer fd1e739a44 CodeGen: Copy-ctorm must obey the destination's alignment requirement
We would synthesize memcpy intrinsics when emitting calls to trivial C++
constructors but we wouldn't take into account the alignment of the
destination.

llvm-svn: 228061
2015-02-03 23:04:06 +00:00
Reid Kleckner 11ca834bef SEH: Track users of __try so we can pick a per-func EH personality
There are four major kinds of declarations that cause code generation:
- FunctionDecl (includes CXXMethodDecl etc)
- ObjCMethodDecl
- BlockDecl
- CapturedDecl

This patch tracks __try usage on FunctionDecls and diagnoses __try usage
in other decls. If someone wants to use __try from ObjC, they can use it
from a free function, since the ObjC code will need an ObjC-style EH
personality.

Eventually we will want to look through CapturedDecls and track SEH
usage on the parent FunctionDecl, if present.

llvm-svn: 228058
2015-02-03 22:52:35 +00:00
David Blaikie 14177b748a DebugInfo: Ensure calls to functions with default arguments which themselves have default arguments, still have locations.
To handle default arguments in C++ in the debug info, we disable code
updating the debug location during the emission of default arguments.

This code was buggy in the case of default arguments which, themselves,
have default arguments - the inner default argument would re-enable
debug info when it was finished, but before the outer default argument
was finished.

This was already a bug, but got worse (because a crasher instead of just
a quality bug) with the recent improvements to debug info line quality
because... The ApplyDebugLocation scoped device would find the debug
info disabled and not save any debug location. But then in
~ApplyDebugLocation it would find the debug info had been enabled and
would then apply the no-location. Then the outer function call would be
emitted without any location. That's bad.

Arguably we could /also/ fix the ApplyDebugLocation to assert on this
situation (where debug info was disabled in the ctor and enabled in the
dtor, or the other way around) but this is at least the necessary fix
regardless.

(also, I imagine this disabling behavior might need to be in-place for
CGExprComplex and CGExprAgg too, maybe... ?)

And I seem to recall seeing some weird default arg stepping behavior
recently which might be related to this too... I'll have to look into
it.

llvm-svn: 228053
2015-02-03 22:37:17 +00:00
Weiming Zhao 71ac240620 Diagnose CXX 'this' pointer reference in funcs with naked attr
Clang asserts for this pointer reference in asms of naked functions.
This patch diagnoses if this pointer reference is used.

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

llvm-svn: 228052
2015-02-03 22:35:58 +00:00
DeLesley Hutchins ab1dc2d54d Thread Safety Analysis: add support for before/after annotations on mutexes.
These checks detect potential deadlocks caused by inconsistent lock
ordering.  The checks are implemented under the -Wthread-safety-beta flag.

This patch also replaces calls to getAttrs() with calls to attrs() throughout
ThreadSafety.cpp, which fixes the earlier issue that cause assert failures.

llvm-svn: 228051
2015-02-03 22:11:04 +00:00
Reid Kleckner 690c5baa6d Fix Driver/mg.c test when fgrep is a shell Cygwin shell script
llvm-svn: 228036
2015-02-03 21:49:15 +00:00
Justin Bogner 4da909b2b2 InstrProf: Remove CoverageMapping::HasCodeBefore, it isn't used
llvm-svn: 228035
2015-02-03 21:35:49 +00:00
Duncan P. N. Exon Smith f796a1ded0 CodeGen: Update for LLVM API change in r228030
The mock tags are no longer in `dwarf::LLVMConstants`; they're in
`dwarf::Tag`.

llvm-svn: 228032
2015-02-03 21:25:34 +00:00
Adrian Prantl 95b24e9b59 Address review feedback for r228003.
- use named constructors
- get rid of MarkAsPrologue

llvm-svn: 228021
2015-02-03 20:00:54 +00:00
Reid Kleckner 6c5e36ae3b Revert "Thread Safety Analysis: add support for before/after annotations on mutexes."
This reverts r227997, as well as r228009. It does not pass check-clang
for me locally on Linux.

llvm-svn: 228020
2015-02-03 19:51:16 +00:00
Ben Langmuir 3b7b540680 Make the default module cache user-specific
Appends the username to the first component (after the temp dir) of the
module cache path.  If the username contains a character that shouldn't
go into a path (for now conservatively allow [a-zA-Z0-9_]), we fallback
to the user id.

llvm-svn: 228013
2015-02-03 19:28:37 +00:00
Reid Kleckner e675575d1b thread safety: Add move ctor to BeforeInfo to fix MSVC build
MSVC cannot infer move ctors yet.

llvm-svn: 228009
2015-02-03 19:04:26 +00:00
Adrian Prantl 39428e74a0 Merge ArtificialLocation into ApplyDebugLocation and make a clear
distinction between the different use-cases. With the previous default
behavior we would occasionally emit empty debug locations in situations
where they actually were strictly required (= on invoke insns).
We now have a choice between defaulting to an empty location or an
artificial location.

Specifically, this fixes a bug caused by a missing debug location when
emitting C++ EH cleanup blocks from within an artificial function, such as
an ObjC destroy helper function.

rdar://problem/19670595

llvm-svn: 228003
2015-02-03 18:40:42 +00:00
Adrian Prantl 6693d0839a Add documentation to ApplyDebugLocation.
llvm-svn: 228002
2015-02-03 18:40:38 +00:00
DeLesley Hutchins 4980df623f Thread Safety Analysis: add support for before/after annotations on mutexes.
These checks detect potential deadlocks caused by inconsistent lock
ordering.  The checks are implemented under the -Wthread-safety-beta flag.

llvm-svn: 227997
2015-02-03 18:17:48 +00:00
Nico Weber b14f872269 Implement jump scope SEHmantic analysis.
Thou shall not jump into SEH blocks. Jumping out of SEH __try and __excepts
is A-ok. Jumping out of __finally blocks is B-ok (msvc doesn't error about it,
but warns that it has undefined behavior).

I've checked that clang's behavior with this patch matches msvc's behavior.
We don't have the warning on jumping out of a __finally yet, see the FIXME
in the test. clang also currently crashes on codegen for a jump out of a
__finally block, see PR22414 comment 7.

I also added a few tests for the interaction of indirect jumps and SEH blocks.
MSVC doesn't support indirect jumps, so there's no way to know if clang behave
the same way as msvc here.  clang's behavior with this patch does make sense
to me, but maybe it could be argued that it should be more permissive (see
FIXME in the indirect jump tests -- shout if you have an opinion on this).

llvm-svn: 227982
2015-02-03 17:06:08 +00:00
Rafael Espindola 3e34e6546e Use CLANG_LIBDIR_SUFFIX when looking for the gold plugin.
Patch by İsmail Dönmez!

llvm-svn: 227979
2015-02-03 16:33:53 +00:00
Daniel Jasper e03491d390 Move "inline" to the right place.
llvm-svn: 227957
2015-02-03 09:54:58 +00:00
Daniel Jasper d142381cd8 Add some overloads so that floating point literals can be AST matched properly.
I am not entirely sure whether the implemented sematics are ideal. In
particular, should floatLiteral(equals(0.5)) match "0.5f" and should
floatLiteral(equals(0.5f)) match "0.5". With the overloads in this
patch, the answer to both questions is yes, but I am happy to change
that.

llvm-svn: 227956
2015-02-03 09:45:52 +00:00
David Majnemer e1a0b2e2af MS ABI: Records with fields with required aligmnet shouldn't be common
llvm-svn: 227954
2015-02-03 08:49:32 +00:00
David Majnemer 5821ff78ef AST: Hoist RT->getDecl() into a variable
llvm-svn: 227953
2015-02-03 08:49:29 +00:00
David Majnemer 7d82131abe MS ABI: Records with required alignment can't have common linkage
This fixes PR22441.

llvm-svn: 227950
2015-02-03 07:35:55 +00:00
Ted Kremenek 0f26d132d7 [analyzer] Change ccc-analyzer to accept both -isystem <path> and -isystem<path>
Patch by Thomas Hauth!

llvm-svn: 227946
2015-02-03 06:23:36 +00:00
Richard Smith 2a9e5c57ef [modules] Be sure to load the lexical definition of a class template
specialization from an update record exactly once, even if we needed to fake up
the definition.

llvm-svn: 227939
2015-02-03 03:32:14 +00:00
Justin Bogner a432d176b5 InstrProf: Update for LLVM API change
Update for the change in r227900.

llvm-svn: 227901
2015-02-03 00:20:24 +00:00
David Majnemer 61968bc85a test: Make encode-test-5.m's output not dependent on its filename
Pipe the file into clang instead of passing the file path on the command
line.

llvm-svn: 227896
2015-02-02 23:38:27 +00:00
Daniel Jasper 05ce1eed0a Revert "Add some overloads so that floating point literals can be AST matched properly."
Apparently the build bots get angry for some reason. Can't reproduce
that in a local cmake/ninja build. Will look closer. Rolling back for
now.

llvm-svn: 227895
2015-02-02 23:35:39 +00:00
Filipe Cabecinhas 10ff1333e4 clang lit.cfg: Fix a bug pointed by Sean Silva
llvm-svn: 227894
2015-02-02 23:17:54 +00:00