]> granicus.if.org Git - clang/log
clang
9 years agoInstrProf: Update for LLVM API change
Justin Bogner [Tue, 3 Feb 2015 23:59:48 +0000 (23:59 +0000)]
InstrProf: Update for LLVM API change

Update for the API change in r228075

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228076 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPR22419: Give implicit sized deallocation functions default visibility
Larisse Voufo [Tue, 3 Feb 2015 23:31:50 +0000 (23:31 +0000)]
PR22419: Give implicit sized deallocation functions default visibility

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228066 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUnbreak hexagon bot
David Majnemer [Tue, 3 Feb 2015 23:21:21 +0000 (23:21 +0000)]
Unbreak hexagon bot

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228065 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Tue, 3 Feb 2015 23:10:18 +0000 (23:10 +0000)]
Wrap to 80 columns. No behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228063 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCodeGen: Copy-ctorm must obey the destination's alignment requirement
David Majnemer [Tue, 3 Feb 2015 23:04:06 +0000 (23:04 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228061 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSEH: Track users of __try so we can pick a per-func EH personality
Reid Kleckner [Tue, 3 Feb 2015 22:52:35 +0000 (22:52 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228058 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Ensure calls to functions with default arguments which themselves have...
David Blaikie [Tue, 3 Feb 2015 22:37:17 +0000 (22:37 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228053 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDiagnose CXX 'this' pointer reference in funcs with naked attr
Weiming Zhao [Tue, 3 Feb 2015 22:35:58 +0000 (22:35 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228052 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThread Safety Analysis: add support for before/after annotations on mutexes.
DeLesley Hutchins [Tue, 3 Feb 2015 22:11:04 +0000 (22:11 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228051 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix Driver/mg.c test when fgrep is a shell Cygwin shell script
Reid Kleckner [Tue, 3 Feb 2015 21:49:15 +0000 (21:49 +0000)]
Fix Driver/mg.c test when fgrep is a shell Cygwin shell script

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228036 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoInstrProf: Remove CoverageMapping::HasCodeBefore, it isn't used
Justin Bogner [Tue, 3 Feb 2015 21:35:49 +0000 (21:35 +0000)]
InstrProf: Remove CoverageMapping::HasCodeBefore, it isn't used

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228035 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCodeGen: Update for LLVM API change in r228030
Duncan P. N. Exon Smith [Tue, 3 Feb 2015 21:25:34 +0000 (21:25 +0000)]
CodeGen: Update for LLVM API change in r228030

The mock tags are no longer in `dwarf::LLVMConstants`; they're in
`dwarf::Tag`.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228032 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAddress review feedback for r228003.
Adrian Prantl [Tue, 3 Feb 2015 20:00:54 +0000 (20:00 +0000)]
Address review feedback for r228003.
- use named constructors
- get rid of MarkAsPrologue

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228021 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Thread Safety Analysis: add support for before/after annotations on mutexes."
Reid Kleckner [Tue, 3 Feb 2015 19:51:16 +0000 (19:51 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228020 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake the default module cache user-specific
Ben Langmuir [Tue, 3 Feb 2015 19:28:37 +0000 (19:28 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228013 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agothread safety: Add move ctor to BeforeInfo to fix MSVC build
Reid Kleckner [Tue, 3 Feb 2015 19:04:26 +0000 (19:04 +0000)]
thread safety: Add move ctor to BeforeInfo to fix MSVC build

MSVC cannot infer move ctors yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228009 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMerge ArtificialLocation into ApplyDebugLocation and make a clear
Adrian Prantl [Tue, 3 Feb 2015 18:40:42 +0000 (18:40 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228003 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd documentation to ApplyDebugLocation.
Adrian Prantl [Tue, 3 Feb 2015 18:40:38 +0000 (18:40 +0000)]
Add documentation to ApplyDebugLocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228002 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThread Safety Analysis: add support for before/after annotations on mutexes.
DeLesley Hutchins [Tue, 3 Feb 2015 18:17:48 +0000 (18:17 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227997 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoImplement jump scope SEHmantic analysis.
Nico Weber [Tue, 3 Feb 2015 17:06:08 +0000 (17:06 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227982 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse CLANG_LIBDIR_SUFFIX when looking for the gold plugin.
Rafael Espindola [Tue, 3 Feb 2015 16:33:53 +0000 (16:33 +0000)]
Use CLANG_LIBDIR_SUFFIX when looking for the gold plugin.

Patch by İsmail Dönmez!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227979 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMove "inline" to the right place.
Daniel Jasper [Tue, 3 Feb 2015 09:54:58 +0000 (09:54 +0000)]
Move "inline" to the right place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227957 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd some overloads so that floating point literals can be AST matched properly.
Daniel Jasper [Tue, 3 Feb 2015 09:45:52 +0000 (09:45 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227956 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMS ABI: Records with fields with required aligmnet shouldn't be common
David Majnemer [Tue, 3 Feb 2015 08:49:32 +0000 (08:49 +0000)]
MS ABI: Records with fields with required aligmnet shouldn't be common

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227954 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAST: Hoist RT->getDecl() into a variable
David Majnemer [Tue, 3 Feb 2015 08:49:29 +0000 (08:49 +0000)]
AST: Hoist RT->getDecl() into a variable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227953 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMS ABI: Records with required alignment can't have common linkage
David Majnemer [Tue, 3 Feb 2015 07:35:55 +0000 (07:35 +0000)]
MS ABI: Records with required alignment can't have common linkage

This fixes PR22441.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227950 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Change ccc-analyzer to accept both -isystem <path> and -isystem<path>
Ted Kremenek [Tue, 3 Feb 2015 06:23:36 +0000 (06:23 +0000)]
[analyzer] Change ccc-analyzer to accept both -isystem <path> and -isystem<path>

Patch by Thomas Hauth!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227946 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] Be sure to load the lexical definition of a class template
Richard Smith [Tue, 3 Feb 2015 03:32:14 +0000 (03:32 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227939 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoInstrProf: Update for LLVM API change
Justin Bogner [Tue, 3 Feb 2015 00:20:24 +0000 (00:20 +0000)]
InstrProf: Update for LLVM API change

Update for the change in r227900.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227901 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agotest: Make encode-test-5.m's output not dependent on its filename
David Majnemer [Mon, 2 Feb 2015 23:38:27 +0000 (23:38 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227896 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Add some overloads so that floating point literals can be AST matched properly."
Daniel Jasper [Mon, 2 Feb 2015 23:35:39 +0000 (23:35 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227895 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang lit.cfg: Fix a bug pointed by Sean Silva
Filipe Cabecinhas [Mon, 2 Feb 2015 23:17:54 +0000 (23:17 +0000)]
clang lit.cfg: Fix a bug pointed by Sean Silva

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227894 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd some overloads so that floating point literals can be AST matched properly.
Daniel Jasper [Mon, 2 Feb 2015 23:04:00 +0000 (23:04 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227892 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPR 17421: Implemented -save-temps={obj|cwd} option
Reid Kleckner [Mon, 2 Feb 2015 22:41:48 +0000 (22:41 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227886 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSEH: Diagnose use of C++ EH and SEH in the same function
Reid Kleckner [Mon, 2 Feb 2015 22:15:31 +0000 (22:15 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227876 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd cc1 option '-fmodule-feature' to add custom values for 'requires' decls
Ben Langmuir [Mon, 2 Feb 2015 21:56:15 +0000 (21:56 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227868 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWhen generating llvm.used, we may need an addrspacecast instead of a bitcast.
Justin Holewinski [Mon, 2 Feb 2015 21:05:49 +0000 (21:05 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227861 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFileCheck'ize CodeGenObjC test
David Majnemer [Mon, 2 Feb 2015 19:30:54 +0000 (19:30 +0000)]
FileCheck'ize CodeGenObjC test

This fixes PR22437.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227843 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThe prefix 'Ms-' should be 'MS-'
David Majnemer [Mon, 2 Feb 2015 19:30:52 +0000 (19:30 +0000)]
The prefix 'Ms-' should be 'MS-'

Clang is otherwise consistent that Microsoft be abbreviated as MS, not
Ms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227842 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMS ABI: Add more documentation and tests for novtable
David Majnemer [Mon, 2 Feb 2015 19:05:46 +0000 (19:05 +0000)]
MS ABI: Add more documentation and tests for novtable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227838 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMS ABI: Implement support for 'novtable'
David Majnemer [Mon, 2 Feb 2015 10:22:20 +0000 (10:22 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227796 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Mon, 2 Feb 2015 05:38:59 +0000 (05:38 +0000)]
Wrap to 80 columns. No behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227782 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFollow-up to r217302: Don't crash on ~A::A in a postfix expr suffix followed by '<'.
Nico Weber [Mon, 2 Feb 2015 05:33:50 +0000 (05:33 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227781 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove a comment I accidentally added in r227581. No behavior change.
Nico Weber [Mon, 2 Feb 2015 04:18:38 +0000 (04:18 +0000)]
Remove a comment I accidentally added in r227581. No behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227777 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAllow objc_bridge(id) to be used on typedefs of [cv] void*.
John McCall [Sun, 1 Feb 2015 22:34:06 +0000 (22:34 +0000)]
Allow objc_bridge(id) to be used on typedefs of [cv] void*.

rdar://19678874

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227774 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Add other flavors of AVX512 cmpps/cmppd intrinsics.
Craig Topper [Sun, 1 Feb 2015 22:27:40 +0000 (22:27 +0000)]
[X86] Add other flavors of AVX512 cmpps/cmppd intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227773 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Add the AVX512 exp2a23 intrinsics.
Craig Topper [Sun, 1 Feb 2015 21:34:11 +0000 (21:34 +0000)]
[X86] Add the AVX512 exp2a23 intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227769 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove decltype in an attempt to fix the MSVC build.
Benjamin Kramer [Sun, 1 Feb 2015 21:32:12 +0000 (21:32 +0000)]
Remove decltype in an attempt to fix the MSVC build.

C++ is hard, attempt #1 of n.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227768 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoActually we can just inline the base typedef and use the injected class name for...
Benjamin Kramer [Sun, 1 Feb 2015 20:47:51 +0000 (20:47 +0000)]
Actually we can just inline the base typedef and use the injected class name for the base class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227765 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReimplement iterator wrappers on top of llvm::iterator_adaptor_base.
Benjamin Kramer [Sun, 1 Feb 2015 20:31:36 +0000 (20:31 +0000)]
Reimplement iterator wrappers on top of llvm::iterator_adaptor_base.

Eliminates a ton of boilerplate proxying the iterator methods. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227764 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Add test for avx512er builtins that I forgot to commit with changes to the...
Craig Topper [Sun, 1 Feb 2015 19:56:51 +0000 (19:56 +0000)]
[X86] Add test for avx512er builtins that I forgot to commit with changes to the header file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227762 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[multiversion] Update Clang for the API change in LLVM r227731.
Chandler Carruth [Sun, 1 Feb 2015 12:26:23 +0000 (12:26 +0000)]
[multiversion] Update Clang for the API change in LLVM r227731.

This moves all of the PassManager <-> Target communication to use the
new pass manager's TargetIRAnalysis even with the old pass manager. See
the LLVM commit for some of why things are moving in this direction, but
the short version is that this will enable us to create per-function
TargetTransformInfo objects that have correct subtarget information for
that function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227732 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Add all intrinsics for scalar rsqrt28/rcp28 to avx512erintrin.h. Add parenthese...
Craig Topper [Sun, 1 Feb 2015 10:15:11 +0000 (10:15 +0000)]
[X86] Add all intrinsics for scalar rsqrt28/rcp28 to avx512erintrin.h. Add parentheses around all macro arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227722 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Flesh out more of the avx512erintrin.h file.
Craig Topper [Sun, 1 Feb 2015 08:52:55 +0000 (08:52 +0000)]
[X86] Flesh out more of the avx512erintrin.h file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227719 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Use macros in AVX512ER header to allow ICE to be checked for immediate argument.
Craig Topper [Sun, 1 Feb 2015 08:05:12 +0000 (08:05 +0000)]
[X86] Use macros in AVX512ER header to allow ICE to be checked for immediate argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227716 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Convert some more const ints to ICE in AVX512 builtins.
Craig Topper [Sun, 1 Feb 2015 07:35:43 +0000 (07:35 +0000)]
[X86] Convert some more const ints to ICE in AVX512 builtins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227714 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Rename _mm512_valign_epi64/32 intrinsics to _mm512_alignr_epi64/32 to match...
Craig Topper [Sun, 1 Feb 2015 07:35:40 +0000 (07:35 +0000)]
[X86] Rename _mm512_valign_epi64/32 intrinsics to _mm512_alignr_epi64/32 to match Intel docs. Make immediate argument to them an ICE. Fix mask size for the alignd version.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227713 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Change rounding parameter of all the AVX512 builtins to an ICE.
Craig Topper [Sun, 1 Feb 2015 07:35:35 +0000 (07:35 +0000)]
[X86] Change rounding parameter of all the AVX512 builtins to an ICE.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227712 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix a typo
Filipe Cabecinhas [Sat, 31 Jan 2015 23:25:54 +0000 (23:25 +0000)]
Fix a typo

We're not that much into metals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227696 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTweak behavior due to -fexceptions, in C++ mode, imply -fcxx-exceptions
Filipe Cabecinhas [Sat, 31 Jan 2015 23:05:51 +0000 (23:05 +0000)]
Tweak behavior due to -fexceptions, in C++ mode, imply -fcxx-exceptions

Added test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227695 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Update Clang for the new LLVM API in r227685 for managing the
Chandler Carruth [Sat, 31 Jan 2015 11:18:46 +0000 (11:18 +0000)]
[PM] Update Clang for the new LLVM API in r227685 for managing the
TargetTransformInfo, and unify the code in a single place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227686 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Make AVX512 integer comparison builtins use unsigned types for the masks.
Craig Topper [Sat, 31 Jan 2015 08:58:36 +0000 (08:58 +0000)]
[X86] Make AVX512 integer comparison builtins use unsigned types for the masks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227681 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] AVX512 scatter/gather builtins as taking an ICE for scale instead of just a...
Craig Topper [Sat, 31 Jan 2015 08:58:30 +0000 (08:58 +0000)]
[X86] AVX512 scatter/gather builtins as taking an ICE for scale instead of just a const int.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227680 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Add immediate range checking for a couple XOP builtins.
Craig Topper [Sat, 31 Jan 2015 08:57:52 +0000 (08:57 +0000)]
[X86] Add immediate range checking for a couple XOP builtins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227679 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Fix incorrect handling of leading whitespace.
Daniel Jasper [Sat, 31 Jan 2015 07:05:46 +0000 (07:05 +0000)]
clang-format: Fix incorrect handling of leading whitespace.

Added an assertion that triggered in an existing test case (without
observable differences) and fixed the code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227677 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Remove tab characters from avxintrin.h. NFC.
Craig Topper [Sat, 31 Jan 2015 06:33:59 +0000 (06:33 +0000)]
[x86] Remove tab characters from avxintrin.h. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227676 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Make order consistent between 'const' and 'int' in one of the intrinsic header...
Craig Topper [Sat, 31 Jan 2015 06:31:30 +0000 (06:31 +0000)]
[X86] Make order consistent between 'const' and 'int' in one of the intrinsic header files. NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227675 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Add range checking to the immediate arguments of many of the SSE/AVX builtins.
Craig Topper [Sat, 31 Jan 2015 06:31:23 +0000 (06:31 +0000)]
[X86] Add range checking to the immediate arguments of many of the SSE/AVX builtins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227674 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] When we try to complete the redeclaration chain for a class template
Richard Smith [Sat, 31 Jan 2015 03:04:55 +0000 (03:04 +0000)]
[modules] When we try to complete the redeclaration chain for a class template
specialization, pull in any lazy specializations of the class template.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227668 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Fix line table for comparisons harder/better for the sake of C (& the...
David Blaikie [Sat, 31 Jan 2015 01:10:11 +0000 (01:10 +0000)]
DebugInfo: Fix line table for comparisons harder/better for the sake of C (& the GDB buildbot)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227663 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRename test file to be more accurate (& free up the file name for a more appropriate...
David Blaikie [Sat, 31 Jan 2015 01:10:09 +0000 (01:10 +0000)]
Rename test file to be more accurate (& free up the file name for a more appropriate test)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227662 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCodeGen: create a WindowsARMTargetCodeGenInfo
Saleem Abdulrasool [Fri, 30 Jan 2015 23:29:19 +0000 (23:29 +0000)]
CodeGen: create a WindowsARMTargetCodeGenInfo

Create a new TargetCodeGenInfo for Windows on ARM to permit annotating the
functions with stack-probe-size (for /Gs and -mstack-probe-support) for
generating the stack probe necessary for Windows targets.  This will be used by
the backend when lowering the frame to generate the stack probe appropriately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227641 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSEH: Don't jump to an unreachable continuation block
Reid Kleckner [Fri, 30 Jan 2015 22:16:45 +0000 (22:16 +0000)]
SEH: Don't jump to an unreachable continuation block

If both the __try and __except blocks do not return, we want to delete
the continuation block as unreachable instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227627 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWindows: Fix _CPPUNWIND definition to follow -fcxx-exceptions
Reid Kleckner [Fri, 30 Jan 2015 21:42:55 +0000 (21:42 +0000)]
Windows: Fix _CPPUNWIND definition to follow -fcxx-exceptions

This is consistent with how we interpret the MSVC /EH flag, which
controls -fcxx-exceptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227616 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSpecial-case the PS4 SDK for a clang test
Filipe Cabecinhas [Fri, 30 Jan 2015 18:25:59 +0000 (18:25 +0000)]
Special-case the PS4 SDK for a clang test

Original patch by Gao Yunzhong!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227593 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoShuffle tests around to more appropriate files
Filipe Cabecinhas [Fri, 30 Jan 2015 18:25:48 +0000 (18:25 +0000)]
Shuffle tests around to more appropriate files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227592 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix regression in r227409 where we were passing -fsyntax-only
Eric Christopher [Fri, 30 Jan 2015 18:22:23 +0000 (18:22 +0000)]
Fix regression in r227409 where we were passing -fsyntax-only
in all cases.

Patch by Artem Belevich.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227591 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Pass ABI name via -target-abi instead of target-features
Daniel Sanders [Fri, 30 Jan 2015 17:35:23 +0000 (17:35 +0000)]
[mips] Pass ABI name via -target-abi instead of target-features

Patch by Vladimir Medic

Reviewers: echristo, atanasyan, dsanders

Reviewed By: atanasyan, dsanders

Subscribers: llvm-commits, echristo, atanasyan

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227583 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFollow-up to r217302 and r227555: Don't crash on inline ~A::A() if A is an int.
Nico Weber [Fri, 30 Jan 2015 16:53:11 +0000 (16:53 +0000)]
Follow-up to r217302 and r227555: Don't crash on inline ~A::A() if A is an int.

Even with r227555, this still crashed:

  struct S {
    int A;
    ~A::A() {}
  };

That's because ParseOptionalCXXScopeSpecifier()'s call to
ActOnCXXNestedNameSpecifier() doesn't mark the scope spec as invalid if sema
thought it's a good idea to fixit-correct "::" to ":".  For the diagnostic
improvement done in r217302, we never want :: to be interpreted as :, so fix
this by setting ColonSacred to false temporarily.

Found by SLi's bot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227581 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCode cleanup
Nathan Sidwell [Fri, 30 Jan 2015 14:21:35 +0000 (14:21 +0000)]
Code cleanup
Parser::ParseLexedMethodDeclaration: Use local var for Param
Sema::MergeCXXFunctionDecls: Use hasInheritedDefaultArg

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227577 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove unneeded code
Filipe Cabecinhas [Fri, 30 Jan 2015 11:17:56 +0000 (11:17 +0000)]
Remove unneeded code

We don't really care about enabling RTTI with -fexceptions, only with
-fcxx-exceptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227567 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix OpenCL 1.2 double as an optional core feature behaviour
Fraser Cormack [Fri, 30 Jan 2015 10:51:46 +0000 (10:51 +0000)]
Fix OpenCL 1.2 double as an optional core feature behaviour

In OpenCL 1.2, using double no longer requires using the pragma cl_khr_fp64,
instead a kernel is allowed to use double, but must first have queried
clGetDeviceInfo's CL_DEVICE_DOUBLE_FP_CONFIG.

Page 197, section 6.1.1 of the OpenCL 1.2 specification has a footnote 23
describing this behaviour.

I've also added test cases such that the pragma must be used if targeting
OpenCL 1.0 or 1.1, but is ignored in 1.2 and 2.0.

Patch by Neil Henning!

Reviewers: Pekka Jääskeläinen

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227565 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSema: Disable template instantiation once a fatal error is raised
David Majnemer [Fri, 30 Jan 2015 05:01:23 +0000 (05:01 +0000)]
Sema: Disable template instantiation once a fatal error is raised

Fatal errors disable all further diagnostics.  Continuing to permit
template instantiation does nothing but make it take longer for clang to
finish with the TU.

Instead, halt all further instantiation.

Fixed in PR22396.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227556 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFollow-up to r217302: Don't crash on ~A::A() if A is undeclared.
Nico Weber [Fri, 30 Jan 2015 04:05:15 +0000 (04:05 +0000)]
Follow-up to r217302: Don't crash on ~A::A() if A is undeclared.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227555 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTypo fixo.
Nico Weber [Fri, 30 Jan 2015 03:47:03 +0000 (03:47 +0000)]
Typo fixo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227554 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWrap to 80 cols by removing trailing whitespace. No behavior change.
Nico Weber [Fri, 30 Jan 2015 02:35:21 +0000 (02:35 +0000)]
Wrap to 80 cols by removing trailing whitespace. No behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227553 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTeach AST printing to not print whitespace inside {} and () for initialization,
Richard Smith [Fri, 30 Jan 2015 02:04:26 +0000 (02:04 +0000)]
Teach AST printing to not print whitespace inside {} and () for initialization,
to match LLVM's preferred style.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227545 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWeaken an assertion that isn't true for invalid input.
Nico Weber [Fri, 30 Jan 2015 01:48:49 +0000 (01:48 +0000)]
Weaken an assertion that isn't true for invalid input.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227540 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-cl: Enable -fexceptions but not -fcxx-exceptions by default
Reid Kleckner [Fri, 30 Jan 2015 01:04:16 +0000 (01:04 +0000)]
clang-cl: Enable -fexceptions but not -fcxx-exceptions by default

This enables proper IRgen of SEH constructs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227528 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd some more PS4 driver settings related to rtti and exceptions.
Filipe Cabecinhas [Thu, 29 Jan 2015 23:56:43 +0000 (23:56 +0000)]
Add some more PS4 driver settings related to rtti and exceptions.

Summary:
The PS4 defaults to -fno-rtti, and has to have rtti enabled when enabling
exceptions.

This commit makes clang add the -fno-rtti by default on the PS4, unless
-frtti was passed in.

It also diagnoses misuses for the PS4:
- Exceptions need rtti. Warn and enable rtti if no rtti flag was passed,
  error if -fno-rtti was passed.

I also added a more general warning for when -fno-rtti is the default
(currently it's only on the PS4) and the vptr sanitizer is on.

Fixed a few tests, due to different flag order when passing cc1 arguments.

Reviewers: chandlerc

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227518 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Work around TLS linker bug
Ulrich Weigand [Thu, 29 Jan 2015 19:08:51 +0000 (19:08 +0000)]
[PowerPC] Work around TLS linker bug

Work around a bug in GNU ld (and gold) linker versions up to 2.25
that may mis-optimize code generated by this version of clang/LLVM
to access general-dynamic or local-dynamic TLS variables.

Bug is fixed here:
https://sourceware.org/ml/binutils/2015-01/msg00318.html

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227480 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThis reverts commit r227432, r227438 and r227448.
Rafael Espindola [Thu, 29 Jan 2015 17:22:53 +0000 (17:22 +0000)]
This reverts commit r227432, r227438 and r227448.

It should bring the bots back.

Original messagses:

r227448:
   Remove unnecessary default.

r227438:
   Fix Index/print-type.cpp test following r227432.

r227432:
    libclang: Add three functions useful for dealing with anonymous fields:
       clang_Cursor_getOffsetOfField
       clang_Cursor_isAnonymous
       clang_Type_visitFields
    Python: Add corresponding methods for dealing with anonymous fields.

    Patch by Loïc Jaquemet

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227472 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReverting r227453, which adds back the fuzzer library. Now excluding the clang-format...
Aaron Ballman [Thu, 29 Jan 2015 16:58:53 +0000 (16:58 +0000)]
Reverting r227453, which adds back the fuzzer library. Now excluding the clang-format fuzzer functionality based on LLVM_USE_SANITIZE_COVERAGE being set or unset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227465 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTemporarily reverting the fuzzer library as it causes too many build issues for MSVC...
Aaron Ballman [Thu, 29 Jan 2015 15:49:46 +0000 (15:49 +0000)]
Temporarily reverting the fuzzer library as it causes too many build issues for MSVC users. This reverts: 227354

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227453 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove unnecessary default.
Francois Pichet [Thu, 29 Jan 2015 15:42:56 +0000 (15:42 +0000)]
Remove unnecessary default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227448 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[xcore] Make the exceptions test actually check for the absence of -fexceptions in...
Filipe Cabecinhas [Thu, 29 Jan 2015 15:03:36 +0000 (15:03 +0000)]
[xcore] Make the exceptions test actually check for the absence of -fexceptions in the proper place

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227443 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix Index/print-type.cpp test following r227432.
Francois Pichet [Thu, 29 Jan 2015 13:33:44 +0000 (13:33 +0000)]
Fix Index/print-type.cpp test following r227432.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227438 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDisable a couple of crash-* tests for now. It seems they might be incompatible to...
NAKAMURA Takumi [Thu, 29 Jan 2015 13:23:23 +0000 (13:23 +0000)]
Disable a couple of crash-* tests for now. It seems they might be incompatible to win32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227434 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: FIXME that led to access of uninitialized memory.
Daniel Jasper [Thu, 29 Jan 2015 13:11:47 +0000 (13:11 +0000)]
clang-format: FIXME that led to access of uninitialized memory.

I have so far not succeeded in finding a nicely reduced test case or an
observable difference which could help me create a test failure without
msan.

Committing without test to unblock kcc's further fuzzing progress.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227433 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agolibclang: Add three functions useful for dealing with anonymous fields:
Francois Pichet [Thu, 29 Jan 2015 12:45:29 +0000 (12:45 +0000)]
libclang: Add three functions useful for dealing with anonymous fields:
   clang_Cursor_getOffsetOfField
   clang_Cursor_isAnonymous
   clang_Type_visitFields
Python: Add corresponding methods for dealing with anonymous fields.

Patch by Loïc Jaquemet

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227432 91177308-0d34-0410-b5e6-96231b3b80d8