]> granicus.if.org Git - clang/log
clang
9 years agoclang-format: Fix column layout with a comment in the last line.
Daniel Jasper [Wed, 15 Jul 2015 16:26:47 +0000 (16:26 +0000)]
clang-format: Fix column layout with a comment in the last line.

Before:
  int aaaaa[] = {
      1, 2,
      3, // comment
      4, 5,
      6  // comment
  };

After:
  int aaaaa[] = {
      1, 2, 3, // comment
      4, 5, 6  // comment
  };

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

9 years ago[PPC64LE] Fix vec_sld semantics for little endian
Bill Schmidt [Wed, 15 Jul 2015 15:45:53 +0000 (15:45 +0000)]
[PPC64LE] Fix vec_sld semantics for little endian

The vec_sld interface provides access to the vsldoi instruction.
Unlike most of the vec_* interfaces, we do not attempt to change the
generated code for vec_sld based on the endian mode.  It is too
difficult to correctly infer the desired semantics because of
different element types, and the corrected instruction sequence is
expensive, involving loading a permute control vector and performing a
generalized permute.

For GCC, this was implemented as "Don't touch the vec_sld"
implementation.  When it came time for the LLVM implementation, I did
the same thing.  However, this was hasty and incorrect.  In LLVM's
version of altivec.h, vec_sld was previously defined in terms of the
vec_perm interface.  Because vec_perm semantics are adjusted for
little endian, this means that leaving vec_sld untouched causes it to
generate something different for LE than for BE.  Not good.

This patch adjusts the form of vec_perm that is used for vec_sld and
vec_vsldoi, effectively undoing the modifications so that the same
vsldoi instruction will be generated for both BE and LE.

There is an accompanying back-end patch to take care of some small
ripple effects caused by these changes.

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

9 years agoSet comdat when an available_externally thunk is converted to linkonce_odr.
Rafael Espindola [Wed, 15 Jul 2015 14:48:06 +0000 (14:48 +0000)]
Set comdat when an available_externally thunk is converted to linkonce_odr.

Fixes pr24130.

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

9 years agoAdd support for armv7-windows-gnu targets to the clang front end.
Yaron Keren [Wed, 15 Jul 2015 13:32:23 +0000 (13:32 +0000)]
Add support for armv7-windows-gnu targets to the clang front end.

http://reviews.llvm.org/D11071

Patch by Martell Malone
Reviewed by Reid Kleckner

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

9 years agoCodeGen: Improve CFI type blacklisting mechanism.
Peter Collingbourne [Wed, 15 Jul 2015 12:15:56 +0000 (12:15 +0000)]
CodeGen: Improve CFI type blacklisting mechanism.

We now use the sanitizer special case list to decide which types to blacklist.
We also support a special blacklist entry for types with a uuid attribute,
which are generally COM types whose virtual tables are defined externally.

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

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

9 years ago[OPENMP] http://llvm.org/PR24121: canonical loop rejected when comparison has implici...
Alexey Bataev [Wed, 15 Jul 2015 12:14:07 +0000 (12:14 +0000)]
[OPENMP] http://llvm.org/PR24121: canonical loop rejected when comparison has implicit conversions or destruction

Allow to use complex iterators expressions in loops for C++.

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

9 years agoFix test to run under MSYS2 by disabling MSYS conversion of /C /TP /TC.
Yaron Keren [Wed, 15 Jul 2015 10:45:25 +0000 (10:45 +0000)]
Fix test to run under MSYS2 by disabling MSYS conversion of /C /TP /TC.

Thanks to Alexpux.

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

9 years agoUpdate test comment that it fails the same way on MSYS2.
Yaron Keren [Wed, 15 Jul 2015 09:41:04 +0000 (09:41 +0000)]
Update test comment that it fails the same way on MSYS2.

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

9 years agoFix comments for several methods, NFC
Alexey Bataev [Wed, 15 Jul 2015 07:53:08 +0000 (07:53 +0000)]
Fix comments for several methods, NFC

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

9 years agoRemove extra \brief comment, NFC
Alexey Bataev [Wed, 15 Jul 2015 07:48:02 +0000 (07:48 +0000)]
Remove extra \brief comment, NFC

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

9 years agoDocumentation cleanup, mostly fixing summaries. No functional change intended.
James Dennett [Wed, 15 Jul 2015 00:22:41 +0000 (00:22 +0000)]
Documentation cleanup, mostly fixing summaries.  No functional change intended.

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

9 years ago[modules] Switch to the normal reverse postorder visitation algorithm when computing...
Richard Smith [Wed, 15 Jul 2015 00:02:40 +0000 (00:02 +0000)]
[modules] Switch to the normal reverse postorder visitation algorithm when computing redeclaration chains.

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

9 years ago[Sema] Don't emit "pure virtual" warning for fully qualified calls.
Davide Italiano [Tue, 14 Jul 2015 23:36:10 +0000 (23:36 +0000)]
[Sema] Don't emit "pure virtual" warning for fully qualified calls.

-fapple-kext is an exception because calls will still go through
the vtable in that mode. Add a note to make the user aware of that.

PR:   23215
Differential Revision:  http://reviews.llvm.org/D10935

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

9 years agoUpdate cxx_dr_status.html after 3.7 branch
Hans Wennborg [Tue, 14 Jul 2015 23:21:53 +0000 (23:21 +0000)]
Update cxx_dr_status.html after 3.7 branch

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

9 years agoMake the variable names match the name of the metadata they control.
Tyler Nowicki [Tue, 14 Jul 2015 23:03:09 +0000 (23:03 +0000)]
Make the variable names match the name of the metadata they control.

Rename Vectorizer to Vectorize and VectorizeUnroll to InterleaveCount.

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

9 years agodocs/conf.py: update version to 3.8
Hans Wennborg [Tue, 14 Jul 2015 22:53:35 +0000 (22:53 +0000)]
docs/conf.py: update version to 3.8

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

9 years agoReleaseNotes.rst: Bump version to 3.8
Hans Wennborg [Tue, 14 Jul 2015 22:52:36 +0000 (22:52 +0000)]
ReleaseNotes.rst: Bump version to 3.8

The notes for 3.7 are on the 3.7 branch.

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

9 years agoDriver: Delete dead code
Justin Bogner [Tue, 14 Jul 2015 22:36:22 +0000 (22:36 +0000)]
Driver: Delete dead code

VerifyJobActions never have multiple inputs.

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

9 years agoSema.h: Just prune a redundant \brief introduced in r242133, for now. [-Wdocumentation]
NAKAMURA Takumi [Tue, 14 Jul 2015 22:35:36 +0000 (22:35 +0000)]
Sema.h: Just prune a redundant \brief introduced in r242133, for now. [-Wdocumentation]

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

9 years agoAdd a "maximum TLS alignment" characteristic to the target info, so it
Paul Robinson [Tue, 14 Jul 2015 20:52:32 +0000 (20:52 +0000)]
Add a "maximum TLS alignment" characteristic to the target info, so it
can be different from the normal variable maximum.
Add an error diagnostic for when TLS variables exceed maximum TLS alignment.
Currenty only PS4 sets an explicit maximum TLS alignment.

Patch by Charles Li!

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

9 years ago[Sema] Emit a better diagnostic when variable redeclarations disagree
David Majnemer [Tue, 14 Jul 2015 20:08:49 +0000 (20:08 +0000)]
[Sema] Emit a better diagnostic when variable redeclarations disagree

We referred to all declaration in definitions in our diagnostic messages
which is can be inaccurate.  Instead, classify the declaration and emit
an appropriate diagnostic for the new declaration and an appropriate
note pointing to the old one.

This fixes PR24116.

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

9 years agoRun cuda options test only with specific target.
Artem Belevich [Tue, 14 Jul 2015 18:49:17 +0000 (18:49 +0000)]
Run cuda options test only with specific target.
For now it's only x86_64-linux-gnu.

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

9 years ago[modules] Avoid repeatedly hashing the same name when looking it up in multiple modul...
Richard Smith [Tue, 14 Jul 2015 18:42:41 +0000 (18:42 +0000)]
[modules] Avoid repeatedly hashing the same name when looking it up in multiple module files.

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

9 years ago[clang-cl] Disable C++ exceptions a different way
Reid Kleckner [Tue, 14 Jul 2015 18:16:48 +0000 (18:16 +0000)]
[clang-cl] Disable C++ exceptions a different way

Rather than making -fexceptions a core option that enables C++ EH in
clang-cl, users can use the '-Xclang -fexceptions -Xclang
-fcxx-exceptions' flag set. We weren't going to expose -fexceptions in
clang-cl in the long run, so this way we don't add and then remove a
flag.

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

9 years agoFixed 22941: Integer template parameter as immediate 'I' expectes an integer constant
Sunil Srivastava [Tue, 14 Jul 2015 18:08:50 +0000 (18:08 +0000)]
Fixed 22941: Integer template parameter as immediate 'I' expectes an integer constant
Basically fixed premature testing of integer constraints during template parsing
Reviewed at http://reviews.llvm.org/D10452

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

9 years agoAdd missing builtins to altivec.h for ABI compliance (vol. 4)
Nemanja Ivanovic [Tue, 14 Jul 2015 17:50:27 +0000 (17:50 +0000)]
Add missing builtins to altivec.h for ABI compliance (vol. 4)

This patch corresponds to review:
http://reviews.llvm.org/D11184

A number of new interfaces for altivec.h (as mandated by the ABI):
vector float vec_cpsgn(vector float, vector float)
vector double vec_cpsgn(vector double, vector double)
vector double vec_or(vector bool long long, vector double)
vector double vec_or(vector double, vector bool long long)
vector double vec_re(vector double)
vector signed char vec_cntlz(vector signed char)
vector unsigned char vec_cntlz(vector unsigned char)
vector short vec_cntlz(vector short)
vector unsigned short vec_cntlz(vector unsigned short)
vector int vec_cntlz(vector int)
vector unsigned int vec_cntlz(vector unsigned int)
vector signed long long vec_cntlz(vector signed long long)
vector unsigned long long vec_cntlz(vector unsigned long long)
vector signed char vec_nand(vector bool signed char, vector signed char)
vector signed char vec_nand(vector signed char, vector bool signed char)
vector signed char vec_nand(vector signed char, vector signed char)
vector unsigned char vec_nand(vector bool unsigned char, vector unsigned char)
vector unsigned char vec_nand(vector unsigned char, vector bool unsigned char)
vector unsigned char vec_nand(vector unsigned char, vector unsigned char)
vector short vec_nand(vector bool short, vector short)
vector short vec_nand(vector short, vector bool short)
vector short vec_nand(vector short, vector short)
vector unsigned short vec_nand(vector bool unsigned short, vector unsigned short)
vector unsigned short vec_nand(vector unsigned short, vector bool unsigned short)
vector unsigned short vec_nand(vector unsigned short, vector unsigned short)
vector int vec_nand(vector bool int, vector int)
vector int vec_nand(vector int, vector bool int)
vector int vec_nand(vector int, vector int)
vector unsigned int vec_nand(vector bool unsigned int, vector unsigned int)
vector unsigned int vec_nand(vector unsigned int, vector bool unsigned int)
vector unsigned int vec_nand(vector unsigned int, vector unsigned int)
vector signed long long vec_nand(vector bool long long, vector signed long long)
vector signed long long vec_nand(vector signed long long, vector bool long long)
vector signed long long vec_nand(vector signed long long, vector signed long long)
vector unsigned long long vec_nand(vector bool long long, vector unsigned long long)
vector unsigned long long vec_nand(vector unsigned long long, vector bool long long)
vector unsigned long long vec_nand(vector unsigned long long, vector unsigned long long)
vector signed char vec_orc(vector bool signed char, vector signed char)
vector signed char vec_orc(vector signed char, vector bool signed char)
vector signed char vec_orc(vector signed char, vector signed char)
vector unsigned char vec_orc(vector bool unsigned char, vector unsigned char)
vector unsigned char vec_orc(vector unsigned char, vector bool unsigned char)
vector unsigned char vec_orc(vector unsigned char, vector unsigned char)
vector short vec_orc(vector bool short, vector short)
vector short vec_orc(vector short, vector bool short)
vector short vec_orc(vector short, vector short)
vector unsigned short vec_orc(vector bool unsigned short, vector unsigned short)
vector unsigned short vec_orc(vector unsigned short, vector bool unsigned short)
vector unsigned short vec_orc(vector unsigned short, vector unsigned short)
vector int vec_orc(vector bool int, vector int)
vector int vec_orc(vector int, vector bool int)
vector int vec_orc(vector int, vector int)
vector unsigned int vec_orc(vector bool unsigned int, vector unsigned int)
vector unsigned int vec_orc(vector unsigned int, vector bool unsigned int)
vector unsigned int vec_orc(vector unsigned int, vector unsigned int)
vector signed long long vec_orc(vector bool long long, vector signed long long)
vector signed long long vec_orc(vector signed long long, vector bool long long)
vector signed long long vec_orc(vector signed long long, vector signed long long)
vector unsigned long long vec_orc(vector bool long long, vector unsigned long long)
vector unsigned long long vec_orc(vector unsigned long long, vector bool long long)
vector unsigned long long vec_orc(vector unsigned long long, vector unsigned long long)
vector signed char vec_div(vector signed char, vector signed char)
vector unsigned char vec_div(vector unsigned char, vector unsigned char)
vector signed short vec_div(vector signed short, vector signed short)
vector unsigned short vec_div(vector unsigned short, vector unsigned short)
vector signed int vec_div(vector signed int, vector signed int)
vector unsigned int vec_div(vector unsigned int, vector unsigned int)
vector signed long long vec_div(vector signed long long, vector signed long long)
vector unsigned long long vec_div(vector unsigned long long, vector unsigned long long)
vector unsigned char vec_mul(vector unsigned char, vector unsigned char)
vector unsigned int vec_mul(vector unsigned int, vector unsigned int)
vector unsigned long long vec_mul(vector unsigned long long, vector unsigned long long)
vector unsigned short vec_mul(vector unsigned short, vector unsigned short)
vector signed char vec_mul(vector signed char, vector signed char)
vector signed int vec_mul(vector signed int, vector signed int)
vector signed long long vec_mul(vector signed long long, vector signed long long)
vector signed short vec_mul(vector signed short, vector signed short)
vector signed long long vec_mergeh(vector signed long long, vector signed long long)
vector signed long long vec_mergeh(vector signed long long, vector bool long long)
vector signed long long vec_mergeh(vector bool long long, vector signed long long)
vector unsigned long long vec_mergeh(vector unsigned long long, vector unsigned long long)
vector unsigned long long vec_mergeh(vector unsigned long long, vector bool long long)
vector unsigned long long vec_mergeh(vector bool long long, vector unsigned long long)
vector double vec_mergeh(vector double, vector double)
vector double vec_mergeh(vector double, vector bool long long)
vector double vec_mergeh(vector bool long long, vector double)
vector signed long long vec_mergel(vector signed long long, vector signed long long)
vector signed long long vec_mergel(vector signed long long, vector bool long long)
vector signed long long vec_mergel(vector bool long long, vector signed long long)
vector unsigned long long vec_mergel(vector unsigned long long, vector unsigned long long)
vector unsigned long long vec_mergel(vector unsigned long long, vector bool long long)
vector unsigned long long vec_mergel(vector bool long long, vector unsigned long long)
vector double vec_mergel(vector double, vector double)
vector double vec_mergel(vector double, vector bool long long)
vector double vec_mergel(vector bool long long, vector double)
vector signed int vec_pack(vector signed long long, vector signed long long)
vector unsigned int vec_pack(vector unsigned long long, vector unsigned long long)
vector bool int vec_pack(vector bool long long, vector bool long long)

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

9 years agoRely on default zero-arg value for IRBuilder::CreateCall calls to zero-arg functions
David Blaikie [Tue, 14 Jul 2015 17:27:39 +0000 (17:27 +0000)]
Rely on default zero-arg value for IRBuilder::CreateCall calls to zero-arg functions

Patch by servuswiegehtz at yahoo.de

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

9 years agoAST Matchers: pass ast_type_traits::DynTypedNode by const-ref
Hans Wennborg [Tue, 14 Jul 2015 16:50:14 +0000 (16:50 +0000)]
AST Matchers: pass ast_type_traits::DynTypedNode by const-ref

(Broken out from http://reviews.llvm.org/D11168)

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

9 years agoPull trivial SanitizerSet methods into the header.
Benjamin Kramer [Tue, 14 Jul 2015 15:34:19 +0000 (15:34 +0000)]
Pull trivial SanitizerSet methods into the header.

Inlining them is always preferable to a call. NFC.

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

9 years agoSupport mingw-w64 toolchain on openSUSE and likely other Linuxes
Yaron Keren [Tue, 14 Jul 2015 15:02:09 +0000 (15:02 +0000)]
Support mingw-w64 toolchain on openSUSE and likely other Linuxes

Thanks to Ismail Donmez for testing and to Joerg Sonnenbergerþ for his comments.

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

9 years ago[x86] add 2 bit to ObjCOrBuiltinID and new intrinsics
Asaf Badouh [Tue, 14 Jul 2015 14:02:45 +0000 (14:02 +0000)]
[x86] add 2 bit to ObjCOrBuiltinID and new intrinsics

add 2 bit to ObjCOrBuiltinID (changed from 11bits to 13bits), see discussion in
Add new intrinsics support that already covered by the BE.
All the intrinsics are covered by tests

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

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

9 years ago[Analyzer] Move FindSuperCallVisitor into an anonymous namespace.
Benjamin Kramer [Tue, 14 Jul 2015 12:37:59 +0000 (12:37 +0000)]
[Analyzer] Move FindSuperCallVisitor into an anonymous namespace.

No functionality change.

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

9 years agoclang-format: Fix formatting of multiple lambdas in initializers.
Daniel Jasper [Tue, 14 Jul 2015 11:26:14 +0000 (11:26 +0000)]
clang-format: Fix formatting of multiple lambdas in initializers.

Before:
  SomeFunction({[&] {
    // comment
  },
                [&] {
                  // comment
                }});

After:
  SomeFunction({[&] {
                  // comment
                },
                [&] {
                  // comment
                }});

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

9 years ago[OPENMP] Drop type qualifiers from private variables.
Alexey Bataev [Tue, 14 Jul 2015 10:32:29 +0000 (10:32 +0000)]
[OPENMP] Drop type qualifiers from private variables.

If the variable is marked as private in OpenMP construct, the reference to this variable should not keep type qualifiers for the original variable. Private copy is not volatile or constant, so we can use unqualified type for private copy.

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

9 years agoClasses inside lambdas are local not nested.
Serge Pavlov [Tue, 14 Jul 2015 10:02:10 +0000 (10:02 +0000)]
Classes inside lambdas are local not nested.

If a lambda used as default argument in a method declaration contained
a local class, that class was incorrectly recognized as nested class.
In this case compiler tried to postpone parsing of this class until
the enclosing class is finished, which caused crashes in some cases.

This change fixes PR13987.

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

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

9 years agoTweak clang/test/PCH/chain-openmp-threadprivate.cpp to satisfy i686-win32.
NAKAMURA Takumi [Tue, 14 Jul 2015 09:45:28 +0000 (09:45 +0000)]
Tweak clang/test/PCH/chain-openmp-threadprivate.cpp to satisfy i686-win32.

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

9 years agoFix for clang memcpyizer bugs 23911 and 23924 (patch by Denis Zobnin)
Alexey Bataev [Tue, 14 Jul 2015 07:55:48 +0000 (07:55 +0000)]
Fix for clang memcpyizer bugs 23911 and 23924 (patch by Denis Zobnin)

The fix is to remove duplicate copy-initialization of the only memcpy-able struct member and to correct the address of aggregately initialized members in destructors' calls during stack unwinding (in order to obtain address of struct member by using GEP instead of 'bitcast').
Differential Revision: http://reviews.llvm.org/D10990

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

9 years agoFix test for Visual C++ link.exe.
Yaron Keren [Tue, 14 Jul 2015 06:01:14 +0000 (06:01 +0000)]
Fix test for Visual C++ link.exe.

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

9 years agoFix test for Visual C++.
Yaron Keren [Tue, 14 Jul 2015 05:58:56 +0000 (05:58 +0000)]
Fix test for Visual C++.

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

9 years agoAdd support for -fuse-ld= in the mingw toolchain driver.
Yaron Keren [Tue, 14 Jul 2015 05:23:34 +0000 (05:23 +0000)]
Add support for -fuse-ld= in the mingw toolchain driver.
We will still default to ld until such a time lld become a
stable release. lld supports arm NT under the machine name "thumb2pe".

http://reviews.llvm.org/D11088

Patch by Martell Malone
Reviewed by Reid Kleckner

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

9 years agoMark clang/test/PCH/chain-openmp-threadprivate.cpp as REQUIRES:tls.
NAKAMURA Takumi [Tue, 14 Jul 2015 04:00:18 +0000 (04:00 +0000)]
Mark clang/test/PCH/chain-openmp-threadprivate.cpp as REQUIRES:tls.

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

9 years agoclang/test/lit.cfg: Introduce the feature "tls", for targeting cygwin.
NAKAMURA Takumi [Tue, 14 Jul 2015 03:57:11 +0000 (03:57 +0000)]
clang/test/lit.cfg: Introduce the feature "tls", for targeting cygwin.

Thread local storage is not implemented for targeting cygwin.

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

9 years agoAdd file missed from r242105.
Richard Smith [Tue, 14 Jul 2015 02:40:33 +0000 (02:40 +0000)]
Add file missed from r242105.

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

9 years ago[modules] When diagnosing errors in module map files found by 'extern module' declara...
Richard Smith [Tue, 14 Jul 2015 02:06:01 +0000 (02:06 +0000)]
[modules] When diagnosing errors in module map files found by 'extern module' declarations, show how we got to that module map file.

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

9 years agoRemove a completely redundant initialization of llvm::TimePassesIsEnabled,
Adrian Prantl [Tue, 14 Jul 2015 01:04:40 +0000 (01:04 +0000)]
Remove a completely redundant initialization of llvm::TimePassesIsEnabled,
which is actually the variable backing up the llvm -time-passes command
line argument.
llvm::TimePassesIsEnabled is actually being initialized in CodeGenAction.

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

9 years agoBasic code generation for MSan use-after-dtor.
Evgeniy Stepanov [Tue, 14 Jul 2015 00:34:50 +0000 (00:34 +0000)]
Basic code generation for MSan use-after-dtor.

Under the -fsanitize-memory-use-after-dtor (disabled by default) insert
an MSan runtime library call at the end of every destructor.

Patch by Naomi Musgrave.

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

9 years agoExtend -ftime-report to give more information about time spent reading module files.
Richard Smith [Tue, 14 Jul 2015 00:26:00 +0000 (00:26 +0000)]
Extend -ftime-report to give more information about time spent reading module files.

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

9 years ago[OpenMP] Add REQUIRES pragma to threadprivate regression tests.
Samuel Antao [Tue, 14 Jul 2015 00:09:50 +0000 (00:09 +0000)]
[OpenMP] Add REQUIRES pragma to threadprivate regression tests.

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

9 years ago[Intrin.h] Use __ATOMIC_SEQ_CST instead of '5'
David Majnemer [Mon, 13 Jul 2015 23:39:37 +0000 (23:39 +0000)]
[Intrin.h] Use __ATOMIC_SEQ_CST instead of '5'

No functionality change is intended.

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

9 years ago[Intrin.h] Make the variable names more consistent
David Majnemer [Mon, 13 Jul 2015 23:38:56 +0000 (23:38 +0000)]
[Intrin.h] Make the variable names more consistent

No functionality change intended.

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

9 years ago[cuda] Driver changes to compile and stitch together host and device-side CUDA code.
Artem Belevich [Mon, 13 Jul 2015 23:27:56 +0000 (23:27 +0000)]
[cuda] Driver changes to compile and stitch together host and device-side CUDA code.

  NOTE: reverts r242077 to reinstate r242058, r242065, 242067
        and includes fix for OS X test failures.

  - Changed driver pipeline to compile host and device side of CUDA
    files and incorporate results of device-side compilation into host
    object file.

  - Added a test for cuda pipeline creation in clang driver.

  New clang options:
  --cuda-host-only   - Do host-side compilation only.
  --cuda-device-only - Do device-side compilation only.

  --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side
    compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more
    than once in which case one device-compilation will be done per
    unique specified GPU architecture.

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

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

9 years ago[OpenMP] Add TLS-based implementation for threadprivate directive.
Samuel Antao [Mon, 13 Jul 2015 22:54:53 +0000 (22:54 +0000)]
[OpenMP] Add TLS-based implementation for threadprivate directive.

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

9 years agoThis reverts commit r242058, r242065, r242067.
Rafael Espindola [Mon, 13 Jul 2015 22:26:30 +0000 (22:26 +0000)]
This reverts commit r242058,  r242065,  r242067.

The tests were failing on OS X.

Revert "[cuda] Driver changes to compile and stitch together host and device-side CUDA code."
Revert "Fixed regex to properly match '64' in the test case."
Revert "clang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least."

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

9 years agoclang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least.
NAKAMURA Takumi [Mon, 13 Jul 2015 21:18:53 +0000 (21:18 +0000)]
clang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least.

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

9 years agoFixed regex to properly match '64' in the test case.
Artem Belevich [Mon, 13 Jul 2015 20:49:50 +0000 (20:49 +0000)]
Fixed regex to properly match '64' in the test case.

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

9 years agoMove class into an anonymous namespace. NFC.
Benjamin Kramer [Mon, 13 Jul 2015 20:42:13 +0000 (20:42 +0000)]
Move class into an anonymous namespace. NFC.

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

9 years ago[cuda] Driver changes to compile and stitch together host and device-side CUDA code.
Artem Belevich [Mon, 13 Jul 2015 20:21:06 +0000 (20:21 +0000)]
[cuda] Driver changes to compile and stitch together host and device-side CUDA code.

  - Changed driver pipeline to compile host and device side of CUDA
    files and incorporate results of device-side compilation into host
    object file.

  - Added a test for cuda pipeline creation in clang driver.

  New clang options:
  --cuda-host-only   - Do host-side compilation only.
  --cuda-device-only - Do device-side compilation only.

  --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side
    compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more
    than once in which case one device-compilation will be done per
    unique specified GPU architecture.

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

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

9 years ago[Modules] Allow missing header before a missing requirement
Ben Langmuir [Mon, 13 Jul 2015 19:48:52 +0000 (19:48 +0000)]
[Modules] Allow missing header before a missing requirement

And make the module unavailable without breaking any parent modules.

If there's a missing requirement after we've already seen a missing
header, still update the IsMissingRequiement bit correctly.  Also,
diagnose missing requirements before missing headers, since the
existence of the header is moot if there are missing requirements.

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

9 years agoclang-cl: For files setting output names, mention which flags they belong to.
Nico Weber [Mon, 13 Jul 2015 18:54:56 +0000 (18:54 +0000)]
clang-cl: For files setting output names, mention which flags they belong to.

It always takes me a while to figure out how to say "preprocess to file
foo.txt" with clang-cl. With this, it might be easier.
http://reviews.llvm.org/D10890

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

9 years agoUpdate documentation for unroll pragmas on loops with runtime trip counts.
Mark Heffernan [Mon, 13 Jul 2015 18:31:37 +0000 (18:31 +0000)]
Update documentation for unroll pragmas on loops with runtime trip counts.

This change updates the documentation for the loop unrolling pragma behavior
change in r242047. Specifically, with that change "#pragma unroll" will not
unroll loops with a runtime trip count.

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

9 years agoclang-format: Print token type name instead of number in -debug output
Birunthan Mohanathas [Mon, 13 Jul 2015 16:19:34 +0000 (16:19 +0000)]
clang-format: Print token type name instead of number in -debug output

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

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

9 years agoSupport alternate attribute spelling __enable_if__
Ulrich Weigand [Mon, 13 Jul 2015 14:13:01 +0000 (14:13 +0000)]
Support alternate attribute spelling __enable_if__

Attribute names usually support an alternate spelling that uses double
underscores before and after the attribute name, like e.g. attribute
((__aligned__)) for attribute ((aligned)). This is necessary to allow
use of attributes in system headers without polluting the name space.

However, for attribute ((enable_if)) that alternate spelling does not
work correctly. This is because of code in Parser::ParseGNUAttributeArgs
(ParseDecl.cpp) that specifically checks for the "enable_if" spelling
without allowing the alternate spelling.

Similar code in ParseDecl.cpp uses the normalizeAttrName helper to allow
both spellings. This patch adds use of that helper for the "enable_if"
check as well, which fixes attribute ((__enable_if__)).

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

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

9 years agoUpdate comment
Ulrich Weigand [Mon, 13 Jul 2015 11:52:14 +0000 (11:52 +0000)]
Update comment

As noticed by David Majnemer, update an out-of-date comment in
CGClass.cpp after the r241916 commit.

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

9 years agoSet the linkage before setting the visibility.
Rafael Espindola [Mon, 13 Jul 2015 06:07:58 +0000 (06:07 +0000)]
Set the linkage before setting the visibility.

Otherwise the visibility setting code would not know that a given
function was available_externally.

Fixes PR24097.

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

9 years agoIntrin.h: Don't invade the program's namespace
David Majnemer [Mon, 13 Jul 2015 02:53:23 +0000 (02:53 +0000)]
Intrin.h: Don't invade the program's namespace

The program is permitted to have stuff like '#define x' in it so avoid
using identifiers not reserved for the implementation.

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

9 years agoIntrin.h: Clean up our atomic intrinsics
David Majnemer [Mon, 13 Jul 2015 02:53:19 +0000 (02:53 +0000)]
Intrin.h: Clean up our atomic intrinsics

Three things:
- The atomic intrinsics mandate memory barriers, let's start emitting
  some.
- We don't need to manually create RMW operations, we can just do
  __atomic_fetch_foo instead of performing __atomic_foo_fetch and
  undoing foo.
- Don't use inline assembly, we don't need it for these intrinsics.

This fixes PR24101.

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

9 years agoFix clang/unittests/ASTMatchers/Dynamic/Makefile. clangDynamicASTMatchers should...
NAKAMURA Takumi [Mon, 13 Jul 2015 00:52:19 +0000 (00:52 +0000)]
Fix clang/unittests/ASTMatchers/Dynamic/Makefile. clangDynamicASTMatchers should be linked in advance of clangAST and clangASTMatchers.

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

9 years agoMinor simplification, no functionality change.
Richard Smith [Sun, 12 Jul 2015 23:51:20 +0000 (23:51 +0000)]
Minor simplification, no functionality change.

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

9 years ago[modules] Improve performance when there is a local declaration of an entity
Richard Smith [Sun, 12 Jul 2015 23:43:21 +0000 (23:43 +0000)]
[modules] Improve performance when there is a local declaration of an entity
before the first imported declaration.

We don't need to track all formerly-canonical declarations of an entity; it's sufficient to track those ones for which no other formerly-canonical declaration was imported into the same module. We call those ones "key declarations", and use them as our starting points for collecting redeclarations and performing namespace lookups.

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

9 years ago[Sema] If lvalue to rvalue reference cast is valid don't emit diagnostic.
Davide Italiano [Sun, 12 Jul 2015 22:10:56 +0000 (22:10 +0000)]
[Sema] If lvalue to rvalue reference cast is valid don't emit diagnostic.

In the test, y1 is not reference compatible to y2 and we currently assume
the cast is ill-formed so we emit a diagnostic. Instead, in order to honour
the standard, if y1 it's not reference-compatible to y2 then it can't be
converted using a static_cast, and a reinterpret_cast should be tried instead.
Richard Smith provided the correct interpretation of the standard and
explanation about the subtle difference between "can't be cast" and "the cast
is ill-formed". The former applies in this case.

PR: 23802

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

9 years agoTweak libclang's users, c-arcmt-test, c-index-test and libclangTests to satisfy LDFLA...
NAKAMURA Takumi [Sun, 12 Jul 2015 12:17:55 +0000 (12:17 +0000)]
Tweak libclang's users, c-arcmt-test, c-index-test and libclangTests to satisfy LDFLAGS=-static.

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

9 years agoReformat Makefile.
NAKAMURA Takumi [Sun, 12 Jul 2015 12:14:39 +0000 (12:14 +0000)]
Reformat Makefile.

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

9 years agoclang-format: Add Mozilla brace breaking style
Birunthan Mohanathas [Sun, 12 Jul 2015 03:13:54 +0000 (03:13 +0000)]
clang-format: Add Mozilla brace breaking style

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

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

9 years agoclang-format: Extend vim integration so that a line range can be passed in.
Daniel Jasper [Sat, 11 Jul 2015 06:46:26 +0000 (06:46 +0000)]
clang-format: Extend vim integration so that a line range can be passed in.

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

9 years agoSema: Allow null names to be passed in to isAcceptableTagRedeclaration
Justin Bogner [Fri, 10 Jul 2015 23:05:47 +0000 (23:05 +0000)]
Sema: Allow null names to be passed in to isAcceptableTagRedeclaration

It's possible for TagRedeclarations to involve decls without a name,
ie, anonymous enums. We hit some undefined behaviour if we bind these
null names to the reference here.

We never dereference the name, so it's harmless if it's null - make it
a pointer to allow that.

Fixes the Modules/submodules-merge-defs.cpp test under ubsan.

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

9 years ago[modules] When checking the include guard for a header, check whether it's
Richard Smith [Fri, 10 Jul 2015 22:27:17 +0000 (22:27 +0000)]
[modules] When checking the include guard for a header, check whether it's
visible in the module we're considering entering. Previously we assumed that if
we knew the include guard for a modular header, we'd already parsed it, but
that need not be the case if a header is present in the current module and one
of its dependencies; the result of getting this wrong was that the current
module's submodule for the header would end up empty.

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

9 years agoDisable C++ EH by default for clang-cl and MSVC environments
Reid Kleckner [Fri, 10 Jul 2015 22:25:44 +0000 (22:25 +0000)]
Disable C++ EH by default for clang-cl and MSVC environments

We don't need any more bug reports from users telling us that MSVC-style
C++ exceptions are broken. Developers and adventurous users can still
test the existing functionality by passing along -fexceptions to either
clang or clang-cl.

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

9 years ago[analyzer] When forced to fake a block type, do it correctly.
Jordan Rose [Fri, 10 Jul 2015 21:41:59 +0000 (21:41 +0000)]
[analyzer] When forced to fake a block type, do it correctly.

BlockDecl has a poor AST representation because it doesn't carry its type
with it. Instead, the containing BlockExpr has the full type. This almost
never matters for the analyzer, but if the block decl contains static
local variables we need to synthesize a region to put them in, and this
region will necessarily not have the right type.

Even /that/ doesn't matter, unless

(1) the block calls the function or method containing the block, and
(2) the value of the block expr is used in some interesting way.

In this case, we actually end up needing the type of the block region,
and it will be set to our synthesized type. It turns out we've been doing
a terrible job faking that type -- it wasn't a block pointer type at all.
This commit fixes that to at least guarantee a block pointer type, using
the signature written by the user if there is one.

This is not really a correct answer because the block region's type will
/still/ be wrong, but further efforts to make this right in the analyzer
would probably be silly. We should just change the AST.

rdar://problem/21698099

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

9 years ago[MS ABI] Don't generates code for unreferenced inline definitions of library builtins
David Majnemer [Fri, 10 Jul 2015 20:55:38 +0000 (20:55 +0000)]
[MS ABI] Don't generates code for unreferenced inline definitions of library builtins

We should only consider declarations which were written, implicit
declarations shouldn't be considered.

This fixes PR24084.

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

9 years ago[modules] Fix "prefer own module over others" rule when selecting a module for a...
Richard Smith [Fri, 10 Jul 2015 20:09:49 +0000 (20:09 +0000)]
[modules] Fix "prefer own module over others" rule when selecting a module for a header to work in the presence of module hierarchy.

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

9 years agoAdd an experimental flag -fsanitize-memory-use-after-dtor.
Evgeniy Stepanov [Fri, 10 Jul 2015 20:07:16 +0000 (20:07 +0000)]
Add an experimental flag -fsanitize-memory-use-after-dtor.

This flag will enable detection of use-after-destructor (but before
memory deallocation) bugs. No actual functionality yet.

https://code.google.com/p/address-sanitizer/issues/detail?id=73

Patch by Naomi Musgrave.

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

9 years agoChanged Driver::getToolChain() to use Triple as an argument.
Artem Belevich [Fri, 10 Jul 2015 19:47:55 +0000 (19:47 +0000)]
Changed Driver::getToolChain() to use Triple as an argument.

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

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

9 years ago[inlineasm] Attach readonly and readnone to inline-asm instructions.
Akira Hatanaka [Fri, 10 Jul 2015 18:44:40 +0000 (18:44 +0000)]
[inlineasm] Attach readonly and readnone to inline-asm instructions.

Previously, clang/llvm treated inline-asm instructions conservatively,
choosing not to eliminate the instructions or hoisting them out of a loop
even when it was safe to do so. This commit makes changes to attach a
readonly or readnone attribute to an inline-asm instruction, which enables
passes such as LICM and EarlyCSE to move or optimize away the instruction.

rdar://problem/11358192

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

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

9 years agoTeach clang that -no-pthread is a valid command line option
Yaron Keren [Fri, 10 Jul 2015 18:42:13 +0000 (18:42 +0000)]
Teach clang that -no-pthread is a valid command line option

The winpthreads library in mingw-w64 passes -no-pthread when building
since pthreads is not available to build itself and pthreads it is linked
by default. clang does not link to pthreads by default but did error on
unknown -no-pthread option thus stopping the winpthreads build.

http://reviews.llvm.org/D11087

Patch by Martell Malone.

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

9 years agoRefactor PPC ABI handling to accept and silently ignore -mabi=altivec.
Eric Christopher [Fri, 10 Jul 2015 18:25:54 +0000 (18:25 +0000)]
Refactor PPC ABI handling to accept and silently ignore -mabi=altivec.

All of the ABIs we support are altivec style anyhow and so the option
doesn't make much sense with the modern ABIs. We could make this a more
noisy ignore, but it would break builds for projects that just pass
it along by default because of historical reasons.

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

9 years agoFix a couple of typos: specifc->specific.
Eric Christopher [Fri, 10 Jul 2015 18:25:52 +0000 (18:25 +0000)]
Fix a couple of typos: specifc->specific.

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

9 years agoFactor PGO and coverage flag processing out of Clang::ConstructJob
Diego Novillo [Fri, 10 Jul 2015 18:00:07 +0000 (18:00 +0000)]
Factor PGO and coverage flag processing out of Clang::ConstructJob

The function is massively large and GCC is emitting stack overflow
errors when building it (stack, as counted by the compiler, grows to
more than 16Kb).

The new flag processing logic added in r241825 took it over the limit.

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

9 years agoRespect alignment of nested bitfields
Ulrich Weigand [Fri, 10 Jul 2015 17:30:00 +0000 (17:30 +0000)]
Respect alignment of nested bitfields

tools/clang/test/CodeGen/packed-nest-unpacked.c contains this test:

struct XBitfield {
  unsigned b1 : 10;
  unsigned b2 : 12;
  unsigned b3 : 10;
};
struct YBitfield {
  char x;
  struct XBitfield y;
} __attribute((packed));
struct YBitfield gbitfield;

unsigned test7() {
  // CHECK: @test7
  // CHECK: load i32, i32* getelementptr inbounds (%struct.YBitfield, %struct.YBitfield* @gbitfield, i32 0, i32 1, i32 0), align 4
  return gbitfield.y.b2;
}

The "align 4" is actually wrong.  Accessing all of "gbitfield.y" as a single
i32 is of course possible, but that still doesn't make it 4-byte aligned as
it remains packed at offset 1 in the surrounding gbitfield object.

This alignment was changed by commit r169489, which also introduced changes
to bitfield access code in CGExpr.cpp.  Code before that change used to take
into account *both* the alignment of the field to be accessed within the
current struct, *and* the alignment of that outer struct itself; this logic
was removed by the above commit.

Neglecting to consider both values can cause incorrect code to be generated
(I've seen an unaligned access crash on SystemZ due to this bug).

In order to always use the best known alignment value, this patch removes
the CGBitFieldInfo::StorageAlignment member and replaces it with a
StorageOffset member specifying the offset from the start of the surrounding
struct to the bitfield's underlying storage.  This offset can then be combined
with the best-known alignment for a bitfield access lvalue to determine the
alignment to use when accessing the bitfield's storage.

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

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

9 years agoAdd a missing dependency to unittests/Frontend.
Adrian Prantl [Fri, 10 Jul 2015 15:47:36 +0000 (15:47 +0000)]
Add a missing dependency to unittests/Frontend.
PR24067.

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

9 years agoThe test case still runs on non-ppc targets. Added -target triple.
Nemanja Ivanovic [Fri, 10 Jul 2015 14:11:38 +0000 (14:11 +0000)]
The test case still runs on non-ppc targets. Added -target triple.

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

9 years agoclang-format: [JS] Assign proper penalties when breaking a type annotation
Daniel Jasper [Fri, 10 Jul 2015 13:39:26 +0000 (13:39 +0000)]
clang-format: [JS] Assign proper penalties when breaking a type annotation

Before:
  class Test {
    aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa:
                         aaaaaaaaaaaaaaaaaaaaaaaa): aaaaaaaaaaaaaaaaaaaaaa {}
  }

After:
  class Test {
    aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa):
        aaaaaaaaaaaaaaaaaaaaaa {}
  }

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

9 years agoAdd missing builtins to altivec.h for ABI compliance (vol. 3)
Nemanja Ivanovic [Fri, 10 Jul 2015 13:11:34 +0000 (13:11 +0000)]
Add missing builtins to altivec.h for ABI compliance (vol. 3)

This patch corresponds to review:
http://reviews.llvm.org/D10972

Fix for the handling of dependent features that are enabled by default
on some CPU's (such as -mvsx, -mpower8-vector).

Also provides a number of new interfaces or fixes existing ones in
altivec.h.

Changed signatures to conform to ABI:
vector short vec_perm(vector signed short, vector signed short, vector unsigned char)
vector int vec_perm(vector signed int, vector signed int, vector unsigned char)
vector long long vec_perm(vector signed long long, vector signed long long, vector unsigned char)
vector signed char vec_sld(vector signed char, vector signed char, const int)
vector unsigned char vec_sld(vector unsigned char, vector unsigned char, const int)
vector bool char vec_sld(vector bool char, vector bool char, const int)
vector unsigned short vec_sld(vector unsigned short, vector unsigned short, const int)
vector signed short vec_sld(vector signed short, vector signed short, const int)
vector signed int vec_sld(vector signed int, vector signed int, const int)
vector unsigned int vec_sld(vector unsigned int, vector unsigned int, const int)
vector float vec_sld(vector float, vector float, const int)
vector signed char vec_splat(vector signed char, const int)
vector unsigned char vec_splat(vector unsigned char, const int)
vector bool char vec_splat(vector bool char, const int)
vector signed short vec_splat(vector signed short, const int)
vector unsigned short vec_splat(vector unsigned short, const int)
vector bool short vec_splat(vector bool short, const int)
vector pixel vec_splat(vector pixel, const int)
vector signed int vec_splat(vector signed int, const int)
vector unsigned int vec_splat(vector unsigned int, const int)
vector bool int vec_splat(vector bool int, const int)
vector float vec_splat(vector float, const int)

Added a VSX path to:
vector float vec_round(vector float)

Added interfaces:
vector signed char vec_eqv(vector signed char, vector signed char)
vector signed char vec_eqv(vector bool char, vector signed char)
vector signed char vec_eqv(vector signed char, vector bool char)
vector unsigned char vec_eqv(vector unsigned char, vector unsigned char)
vector unsigned char vec_eqv(vector bool char, vector unsigned char)
vector unsigned char vec_eqv(vector unsigned char, vector bool char)
vector signed short vec_eqv(vector signed short, vector signed short)
vector signed short vec_eqv(vector bool short, vector signed short)
vector signed short vec_eqv(vector signed short, vector bool short)
vector unsigned short vec_eqv(vector unsigned short, vector unsigned short)
vector unsigned short vec_eqv(vector bool short, vector unsigned short)
vector unsigned short vec_eqv(vector unsigned short, vector bool short)
vector signed int vec_eqv(vector signed int, vector signed int)
vector signed int vec_eqv(vector bool int, vector signed int)
vector signed int vec_eqv(vector signed int, vector bool int)
vector unsigned int vec_eqv(vector unsigned int, vector unsigned int)
vector unsigned int vec_eqv(vector bool int, vector unsigned int)
vector unsigned int vec_eqv(vector unsigned int, vector bool int)
vector signed long long vec_eqv(vector signed long long, vector signed long long)
vector signed long long vec_eqv(vector bool long long, vector signed long long)
vector signed long long vec_eqv(vector signed long long, vector bool long long)
vector unsigned long long vec_eqv(vector unsigned long long, vector unsigned long long)
vector unsigned long long vec_eqv(vector bool long long, vector unsigned long long)
vector unsigned long long vec_eqv(vector unsigned long long, vector bool long long)
vector float vec_eqv(vector float, vector float)
vector float vec_eqv(vector bool int, vector float)
vector float vec_eqv(vector float, vector bool int)
vector double vec_eqv(vector double, vector double)
vector double vec_eqv(vector bool long long, vector double)
vector double vec_eqv(vector double, vector bool long long)
vector bool long long vec_perm(vector bool long long, vector bool long long, vector unsigned char)
vector double vec_round(vector double)
vector double vec_splat(vector double, const int)
vector bool long long vec_splat(vector bool long long, const int)
vector signed long long vec_splat(vector signed long long, const int)
vector unsigned long long vec_splat(vector unsigned long long,
vector bool int vec_sld(vector bool int, vector bool int, const int)
vector bool short vec_sld(vector bool short, vector bool short, const int)

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

9 years agoTweak a couple of -fprofile tests in clang/test to accept backslash in path.
NAKAMURA Takumi [Fri, 10 Jul 2015 13:11:08 +0000 (13:11 +0000)]
Tweak a couple of -fprofile tests in clang/test to accept backslash in path.

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

9 years agoTry to fix the test harder, it still fails on windows for unknown reasons.
Benjamin Kramer [Fri, 10 Jul 2015 13:04:41 +0000 (13:04 +0000)]
Try to fix the test harder, it still fails on windows for unknown reasons.

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

9 years agoReapply test for r241811 with a fix for msvc compat mode.
Benjamin Kramer [Fri, 10 Jul 2015 11:37:54 +0000 (11:37 +0000)]
Reapply test for r241811 with a fix for msvc compat mode.

Delayed template parsing interferes with code completion, just distable it for
this test. This reverts r241811.

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

9 years agoRespect alignment when loading up a coerced function argument
Ulrich Weigand [Fri, 10 Jul 2015 11:31:43 +0000 (11:31 +0000)]
Respect alignment when loading up a coerced function argument

Code in CGCall.cpp that loads up function arguments that need to be
coerced to a different type may in some cases ignore the fact that
the source of the argument is not naturally aligned. This may cause
incorrect code to be generated. In some places in CreateCoercedLoad,
we already have setAlignment calls to address this, but I ran into one
where it was missing, causing wrong code generation on SystemZ.

However, in that location, we do not actually know what alignment of
the source location we can rely on; the callers do not pass anything
to this routine. This is already an issue in other places in
CreateCoercedLoad; and the same problem exists for CreateCoercedStore.

To avoid pessimising code, and to fix the FIXMEs already in place,
this patch also adds an alignment argument to the CreateCoerced*
routines and uses it instead of forcing an alignment of 1. The
callers are changed to pass in the best information they have.

This actually requires changes in a number of existing test cases
since we now get better alignment in many places.

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

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

9 years agoRe-use a single SmallString instance to reduce the stack frame size
Daniel Jasper [Fri, 10 Jul 2015 08:25:54 +0000 (08:25 +0000)]
Re-use a single SmallString instance to reduce the stack frame size

In certain builds (msan), this can otherwise exceed the stack frame
limit set for certain environments.

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

9 years agoRemove test that tests referring to the current working directory. You
Daniel Jasper [Fri, 10 Jul 2015 05:57:23 +0000 (05:57 +0000)]
Remove test that tests referring to the current working directory. You
cannot assume that the current working directory is writable in all test
environments. I don't know a better way to write this test of hand, lets
discuss. Possibly, a better option would be to put these together with
other test testing the driver directly.

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

9 years agoRevert test lines added in r241811, "[CodeCompletion] Don't crash on member inits...
NAKAMURA Takumi [Fri, 10 Jul 2015 03:09:19 +0000 (03:09 +0000)]
Revert test lines added in r241811, "[CodeCompletion] Don't crash on member inits of templated constructors.", for now.

It doesn't pass for targeting MS mode.

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

9 years agoDriver: Make all of -f{,no-}sanitize{,-recover,-trap} core options.
Peter Collingbourne [Fri, 10 Jul 2015 02:17:22 +0000 (02:17 +0000)]
Driver: Make all of -f{,no-}sanitize{,-recover,-trap} core options.

This allows them to be used from clang-cl.

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