Commit Graph

56650 Commits

Author SHA1 Message Date
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
Daniel Jasper 88de3d7284 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: 227892
2015-02-02 23:04:00 +00:00
Reid Kleckner 68eb60b8c4 PR 17421: Implemented -save-temps={obj|cwd} option
-save-temps=cwd is equivalent to -save-temps
-save-temps=obj saves temporary file in the same directory as output

This helps to avoid clobbering of temp files in case of parallel
compilation with -save-temps of the files that have the same name
but located in different directories.

Patch by Artem Belevich

Reviewed By: rnk

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

llvm-svn: 227886
2015-02-02 22:41:48 +00:00
Reid Kleckner e71759103e SEH: Diagnose use of C++ EH and SEH in the same function
This check does not apply when Borland extensions are enabled, as they
have a checked in test case indicating that mixed usage of SEH and C++
is supported.

llvm-svn: 227876
2015-02-02 22:15:31 +00:00
Ben Langmuir 532d2104ce Add cc1 option '-fmodule-feature' to add custom values for 'requires' decls
This allows clang-based tools to specify custom features that can be
tested by the 'requires' declaration in a module map file.

llvm-svn: 227868
2015-02-02 21:56:15 +00:00
Justin Holewinski f37f3d35eb When generating llvm.used, we may need an addrspacecast instead of a bitcast.
Summary:
This is especially important for targets that use multiple address spaces,
and commonly place global variables in address spaces other than zero.

Fixes PR22383

Test Plan: New test case added: llvm-used.cu

Reviewers: jingyue

Subscribers: llvm-commits

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

llvm-svn: 227861
2015-02-02 21:05:49 +00:00
David Majnemer 5fc217451b FileCheck'ize CodeGenObjC test
This fixes PR22437.

llvm-svn: 227843
2015-02-02 19:30:54 +00:00
David Majnemer 8ab003a0db The prefix 'Ms-' should be 'MS-'
Clang is otherwise consistent that Microsoft be abbreviated as MS, not
Ms.

llvm-svn: 227842
2015-02-02 19:30:52 +00:00
David Majnemer 2ba2b26632 MS ABI: Add more documentation and tests for novtable
llvm-svn: 227838
2015-02-02 19:05:46 +00:00
David Majnemer 129f417efd MS ABI: Implement support for 'novtable'
It is common for COM interface classes to be marked as 'novtable' to
tell the compiler that constructors and destructors should not reference
virtual function tables.

This commit implements this feature in clang.

llvm-svn: 227796
2015-02-02 10:22:20 +00:00
Nico Weber 82d9e7ec1c Wrap to 80 columns. No behavior change.
llvm-svn: 227782
2015-02-02 05:38:59 +00:00
Nico Weber 7f8ec52067 Follow-up to r217302: Don't crash on ~A::A in a postfix expr suffix followed by '<'.
This used to crash, complaining "ObjectType and scope specifier cannot coexist":

    struct A { } b = b.~A::A <int>;

The only other caller of ParseOptionalCXXScopeSpecifier() that passes in a
non-empty ObjectType clears the ObjectType of the scope specifier comes back
non-empty (see the tok::period case in Parser::ParsePostfixExpressionSuffix()),
so do that here too.

Found by SLi's bot.

llvm-svn: 227781
2015-02-02 05:33:50 +00:00
Nico Weber 10d02b5604 Remove a comment I accidentally added in r227581. No behavior change.
llvm-svn: 227777
2015-02-02 04:18:38 +00:00