]> granicus.if.org Git - clang/log
clang
8 years agoclang-format: [JS] Test for parameter annotations.
Martin Probst [Mon, 11 Apr 2016 09:17:57 +0000 (09:17 +0000)]
clang-format: [JS] Test for parameter annotations.

Summary: Just to ensure no regressions, this already works fine.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

8 years agoRemove redundant conditions of the form (A || (!A && B)) -> (A || B)
Benjamin Kramer [Mon, 11 Apr 2016 08:26:13 +0000 (08:26 +0000)]
Remove redundant conditions of the form (A || (!A && B)) -> (A || B)

Found by cppcheck! PR27286 PR27287 PR27288 PR27289

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

8 years ago[GCC] Attribute ifunc support in clang
Dmitry Polukhin [Mon, 11 Apr 2016 07:48:59 +0000 (07:48 +0000)]
[GCC] Attribute ifunc support in clang

This patch add support for GCC attribute((ifunc("resolver"))) for
targets that use ELF as object file format. In general ifunc is a
special kind of function alias with type @gnu_indirect_function. LLVM
patch http://reviews.llvm.org/D15525

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

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

8 years agoclang-format: [JS] do not insert semicolons after wrapped annotations.
Martin Probst [Mon, 11 Apr 2016 07:35:57 +0000 (07:35 +0000)]
clang-format: [JS] do not insert semicolons after wrapped annotations.

Reviewers: djasper

Subscribers: klimek

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

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

8 years ago[Clang][AVX512][BuiltIn] Adding avx512 ( vperm{i|t}2var, vpermil{var}{ps|pd}{256...
Michael Zuckerman [Mon, 11 Apr 2016 07:15:34 +0000 (07:15 +0000)]
[Clang][AVX512][BuiltIn] Adding avx512 ( vperm{i|t}2var, vpermil{var}{ps|pd}{256|512} ) builtin to clang.

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

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

8 years ago[Clang][AVX512][BuiltIn] Adding avx512 ( vcvt ) builtin to clang
Michael Zuckerman [Sun, 10 Apr 2016 17:24:03 +0000 (17:24 +0000)]
[Clang][AVX512][BuiltIn] Adding avx512 ( vcvt ) builtin to clang

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

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

8 years agoCorrect pg instrumentation for AArch64
Saleem Abdulrasool [Sun, 10 Apr 2016 14:29:55 +0000 (14:29 +0000)]
Correct pg instrumentation for AArch64

It seems that there was a miscommunication between Renato and I, and the
original behaviour of AArch64 was to be preserved and not to mirror the new
behaviour.  Restore the original behaviour for AArch64.  Addresses post-commit
review comments from Renato Golin.

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

8 years agoAdding avx512 (unpck{h|l}{pd|ps}, rcp14{pd|ps}{128|256},vplzcnt{d|q} ) builtin to...
Michael Zuckerman [Sun, 10 Apr 2016 12:54:23 +0000 (12:54 +0000)]
Adding avx512 (unpck{h|l}{pd|ps}, rcp14{pd|ps}{128|256},vplzcnt{d|q} ) builtin to clang

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

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

8 years ago[Clang][AVX512][BuiltIn] Adding avx512 ( store ) builtin to clang
Michael Zuckerman [Sun, 10 Apr 2016 10:51:04 +0000 (10:51 +0000)]
[Clang][AVX512][BuiltIn] Adding avx512 ( store ) builtin to clang

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

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

8 years agotest: add additional tests for SVN r265888
Saleem Abdulrasool [Sun, 10 Apr 2016 03:31:09 +0000 (03:31 +0000)]
test: add additional tests for SVN r265888

Add test cases for AArch64 as well as that was changed as part of that change.

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

8 years agoAdd support for __gnu_mcount_nc as the pg interface
Saleem Abdulrasool [Sun, 10 Apr 2016 03:19:47 +0000 (03:19 +0000)]
Add support for __gnu_mcount_nc as the pg interface

This adds support to optionally support using `__gnu_mcount_nc` as the mcount
interface rather than `mcount` for Linux and EABI.  The other targets do not
provide an implementation for `__gnu_mcount_nc`.  This can be activated via the
`-meabi gnu` flag.

Resolves PR23969.

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

8 years agoBasic: thread TargetOptions into TargetInfo
Saleem Abdulrasool [Sat, 9 Apr 2016 19:09:25 +0000 (19:09 +0000)]
Basic: thread TargetOptions into TargetInfo

This threads TargetOptions into the TargetInfo hierarchy.  This is a rework of
the original attempt to thread additional information into the TargetInfo to
make decisions based on additional ABI related options.

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

8 years agoObjC kindof: check the context when inserting methods to global pool.
Manman Ren [Sat, 9 Apr 2016 18:59:48 +0000 (18:59 +0000)]
ObjC kindof: check the context when inserting methods to global pool.

To make kindof lookup work, we need to insert methods with different
context into the global pool, even though they have the same siganture.

Since diagnosis of availability is performed on the best candidate,
which is often the first candidate from the global pool, we prioritize
the methods that are unavaible or deprecated to the head of the list.

Since we now have more methods in the global pool, we need to watch
out for performance impact.

rdar://25635831

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

8 years ago[Concepts] Implement subsection [dcl.spec.concept]p7 of the Concepts TS
Nathan Wilson [Sat, 9 Apr 2016 02:55:27 +0000 (02:55 +0000)]
[Concepts] Implement subsection [dcl.spec.concept]p7 of the Concepts TS

Summary: A program shall not declare an explicit instantiation (14.8.2), an explicit specialization (14.8.3), or a partial specialization of a concept definition.

Reviewers: rsmith, hubert.reinterpretcast, faisalv, aaron.ballman

Subscribers: cfe-commits

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

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

8 years ago[Perf-Training] Reworked workflow improvements for order-file generation
Chris Bieneman [Fri, 8 Apr 2016 22:48:18 +0000 (22:48 +0000)]
[Perf-Training] Reworked workflow improvements for order-file generation

This is re-landing r260742. I've reworked the conditionals so that it only hits when targeting Apple platforms with ld64.

Original Summary:
With this change generating clang order files using dtrace uses the following workflow:

cmake <whatever options you want>

ninja generate-order-file

ninja clang

This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one.

CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file.

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

8 years agoUse NoDebug compile units to mark debug metadata used only for sample-based
Adrian Prantl [Fri, 8 Apr 2016 22:43:06 +0000 (22:43 +0000)]
Use NoDebug compile units to mark debug metadata used only for sample-based
profiling and optimization remarks and indicate that no debug info shall
be emitted for these compile units.

http://reviews.llvm.org/D18808
<rdar://problem/25427165>

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

8 years agoRemove unused functions from ASTWriter interface.
Richard Smith [Fri, 8 Apr 2016 21:54:32 +0000 (21:54 +0000)]
Remove unused functions from ASTWriter interface.

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

8 years agoPR25501: Delay loading visible updates for a declaration until after we've
Richard Smith [Fri, 8 Apr 2016 20:53:26 +0000 (20:53 +0000)]
PR25501: Delay loading visible updates for a declaration until after we've
processed update records. If an update record adds a definition, we need to
merge that with any pre-existing definition to determine which the canonical
definition is before we apply the visible update, otherwise we wouldn't know
where to apply it.

Thanks to Vassil Vassilev for help reducing this and tracking down the problem.

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

8 years agoAdd doxygen comments to emmintrin.h's intrinsics. Only around 25% of the intrinsics...
Ekaterina Romanova [Fri, 8 Apr 2016 20:45:48 +0000 (20:45 +0000)]
Add doxygen comments to emmintrin.h's intrinsics. Only around 25% of the intrinsics in this file are documented now. The patches for the rest of the intrisics in this file will be send out later.

The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. This patch was internally reviewed by Paul Robinson.

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

8 years ago[analyzer] Teach trackNullOrUndefValue about calls to property accessors.
Devin Coughlin [Fri, 8 Apr 2016 19:59:16 +0000 (19:59 +0000)]
[analyzer] Teach trackNullOrUndefValue about calls to property accessors.

Teach trackNullOrUndefValue() how to look through PseudoObjectExprs to find
the underlying method call for property getters. This makes over-suppression
of 'return nil' in getters consistent with the similar over-suppression for
method and function calls.

rdar://problem/24437252

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

8 years ago[modules] Handle merged fields in designated initializers.
Richard Smith [Fri, 8 Apr 2016 19:57:40 +0000 (19:57 +0000)]
[modules] Handle merged fields in designated initializers.

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

8 years agoAlways have clang pass -pie-level and -pic-level values to the code generator.
Wei Mi [Fri, 8 Apr 2016 17:42:32 +0000 (17:42 +0000)]
Always have clang pass -pie-level and -pic-level values to the code generator.

Patch by tmsriram!

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

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

8 years agoMove EABIVersion from CodeGenOptions to TargetOptions
Saleem Abdulrasool [Fri, 8 Apr 2016 16:52:05 +0000 (16:52 +0000)]
Move EABIVersion from CodeGenOptions to TargetOptions

It is possible to argue that the EABIVersion field is similar in spirit to the
ABI field in TargetOptions.  It represents the embedded ABI that the target
follows.  This will allow us to thread this information into the target
information construction.

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

8 years agorevert SVN r265702, r265640
Saleem Abdulrasool [Fri, 8 Apr 2016 16:52:00 +0000 (16:52 +0000)]
revert SVN r265702, r265640

Revert the two changes to thread CodeGenOptions into the TargetInfo allocation
and to fix the layering violation by moving CodeGenOptions into Basic.
Code Generation is arguably not particularly "basic".  This addresses Richard's
post-commit review comments.  This change purely does the mechanical revert and
will be followed up with an alternate approach to thread the desired information
into TargetInfo.

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

8 years ago[OpenCL] Complete image types support.
Alexey Bader [Fri, 8 Apr 2016 13:40:33 +0000 (13:40 +0000)]
[OpenCL] Complete image types support.

I. Current implementation of images is not conformant to spec in the following points:
  1. It makes no distinction with respect to access qualifiers and therefore allows to use images with different access type interchangeably. The following code would compile just fine:

        void write_image(write_only image2d_t img);
        kernel void foo(read_only image2d_t img) { write_image(img); } // Accepted code

     which is disallowed according to s6.13.14.

  2. It discards access qualifier on generated code, which leads to generated code for the above example:

        call void @write_image(%opencl.image2d_t* %img);

     In OpenCL2.0 however we can have different calls into write_image with read_only and wite_only images.
     Also generally following compiler steps have no easy way to take different path depending on the image access: linking to the right implementation of image types, performing IR opts and backend codegen differently.

  3. Image types are language keywords and can't be redeclared s6.1.9, which can happen currently as they are just typedef names.
  4. Default access qualifier read_only is to be added if not provided explicitly.

II. This patch corrects the above points as follows:
  1. All images are encapsulated into a separate .def file that is inserted in different points where image handling is required. This avoid a lot of code repetition as all images are handled the same way in the code with no distinction of their exact type.
  2. The Cartesian product of image types and image access qualifiers is added to the builtin types. This simplifies a lot handling of access type mismatch as no operations are allowed by default on distinct Builtin types. Also spec intended access qualifier as special type qualifier that are combined with an image type to form a distinct type (see statement above - images can't be created w/o access qualifiers).
  3. Improves testing of images in Clang.

Author: Anastasia Stulova
Reviewers: bader, mgrang.
Subscribers: pxli168, pekka.jaaskelainen, yaxunl.
Differential Revision: http://reviews.llvm.org/D17821

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

8 years agoSilencing a 32-bit shift implicit conversion warning from MSVC; NFC.
Aaron Ballman [Fri, 8 Apr 2016 12:21:58 +0000 (12:21 +0000)]
Silencing a 32-bit shift implicit conversion warning from MSVC; NFC.

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

8 years agoAdapt to LLVM API change
Sanjoy Das [Fri, 8 Apr 2016 01:31:02 +0000 (01:31 +0000)]
Adapt to LLVM API change

Replace mayBeOverridden with isInterposable

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

8 years ago[modules] Add a comment to explain why -E leaves some #includes in the preprocessed...
Richard Smith [Fri, 8 Apr 2016 01:23:59 +0000 (01:23 +0000)]
[modules] Add a comment to explain why -E leaves some #includes in the preprocessed output.

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

8 years ago[modules] Don't write @import in -E output if the current language mode doesn't
Richard Smith [Fri, 8 Apr 2016 00:09:53 +0000 (00:09 +0000)]
[modules] Don't write @import in -E output if the current language mode doesn't
support @import; use the form as written instead.

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

8 years ago[CUDA] Tweak math forward declares so we're compatible with libstdc++4.9.
Justin Lebar [Thu, 7 Apr 2016 23:55:53 +0000 (23:55 +0000)]
[CUDA] Tweak math forward declares so we're compatible with libstdc++4.9.

Summary:
See comments in patch; we were assuming that some stdlib math functions
would be defined in namespace std, when in fact the spec says they
should be defined in the global namespace.  libstdc++4.9 became more
conforming and broke us.

This new implementation seems to cover the known knowns.

Reviewers: rsmith

Subscribers: cfe-commits, tra

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

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

8 years agoReplace Sema-level implementation of -fassume-sane-operator-new with a
Richard Smith [Thu, 7 Apr 2016 21:46:12 +0000 (21:46 +0000)]
Replace Sema-level implementation of -fassume-sane-operator-new with a
CodeGen-level implementation. Instead of adding an attribute to clang's
FunctionDecl, add the IR attribute directly. This means a module built with
this flag is now compatible with code built without it and vice versa.

This change also results in the 'noalias' attribute no longer being added to
calls to operator new in the IR; it's now only added to the declaration. It
also fixes a bug where we failed to add the attribute to the 'nothrow' versions
(because we didn't implicitly declare them, there was no good time to inject a
fake attribute).

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

8 years ago[modules] Allow differences in flags that only affect preprocessor predefines
Richard Smith [Thu, 7 Apr 2016 20:47:37 +0000 (20:47 +0000)]
[modules] Allow differences in flags that only affect preprocessor predefines
(and __has_feature checks) between explicitly-specified module files and the
current compilation.

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

8 years ago[ObjC kindof] Use type bound to filter out the candidate methods.
Manman Ren [Thu, 7 Apr 2016 19:32:24 +0000 (19:32 +0000)]
[ObjC kindof] Use type bound to filter out the candidate methods.

rdar://21306753

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

8 years agoNFC: simplify code in BuildInstanceMessage.
Manman Ren [Thu, 7 Apr 2016 19:30:20 +0000 (19:30 +0000)]
NFC: simplify code in BuildInstanceMessage.

Instead of searching the global pool multiple times: in
LookupFactoryMethodInGlobalPool, LookupInstanceMethodInGlobalPool,
CollectMultipleMethodsInGlobalPool, and AreMultipleMethodsInGlobalPool,
we now collect the method candidates in CollectMultipleMethodsInGlobalPool
only, and other functions will use the collected method set.

This commit adds parameter "Methods" to AreMultipleMethodsInGlobalPool,
and SelectBestMethod. It also changes the implementation of
CollectMultipleMethodsInGlobalPool to collect the desired kind first, if none is
found, to collect the other kind. This avoids the need to call both
LookupFactoryMethodInGlobalPool and LookupInstanceMethodInGlobalPool.

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

8 years agoBasic: move CodeGenOptions from Frontend
Saleem Abdulrasool [Thu, 7 Apr 2016 17:49:44 +0000 (17:49 +0000)]
Basic: move CodeGenOptions from Frontend

This is a mechanical move of CodeGenOptions from libFrontend to libBasic.  This
fixes the layering violation introduced earlier by threading CodeGenOptions into
TargetInfo.  It should also fix the modules based self-hosting builds.  NFC.

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

8 years agoMinor Wdocumentation fix. NFCI.
Simon Pilgrim [Thu, 7 Apr 2016 17:38:24 +0000 (17:38 +0000)]
Minor Wdocumentation fix. NFCI.

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

8 years agoFixing duplicate declaration "_mm256 _mm_set_epi32" in revision 262177
Michael Zuckerman [Thu, 7 Apr 2016 14:44:08 +0000 (14:44 +0000)]
Fixing duplicate declaration "_mm256 _mm_set_epi32" in revision 262177

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

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

8 years agomake __builtin_isfinite more efficient (PR27145)
Sanjay Patel [Thu, 7 Apr 2016 14:29:05 +0000 (14:29 +0000)]
make __builtin_isfinite more efficient (PR27145)

isinf (is infinite) and isfinite should be implemented with the same function
except we change the comparison operator.

See PR27145 for more details:
https://llvm.org/bugs/show_bug.cgi?id=27145

Ref: forked off of the discussion in D18513.

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

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

8 years ago[OPENMP 4.0] Parsing/sema analysis for 'simdlen' clause in 'declare simd'
Alexey Bataev [Thu, 7 Apr 2016 12:45:37 +0000 (12:45 +0000)]
[OPENMP 4.0] Parsing/sema analysis for 'simdlen' clause in 'declare simd'
construct.

OpenMP 4.0 defines '#pragma omp declare simd' construct that may have
associated 'simdlen' clause with constant positive expression as an
argument:
simdlen(<const_expr>)
Patch adds parsin and semantic analysis for simdlen clause.

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

8 years agoMove class into an anonymous namespace. NFC.
Benjamin Kramer [Thu, 7 Apr 2016 10:14:54 +0000 (10:14 +0000)]
Move class into an anonymous namespace. NFC.

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

8 years agoBasic: thread CodeGenOptions into TargetInfo
Saleem Abdulrasool [Thu, 7 Apr 2016 05:41:11 +0000 (05:41 +0000)]
Basic: thread CodeGenOptions into TargetInfo

This threads CodeGenOptions into the TargetInfo hierarchy.  This is motivated by
ARM which can change some target information based on the EABI selected
(-meabi).  Similar options exist for other platforms (e.g. MIPS) and thus is
generally useful.  NFC.

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

8 years agoDon't use PATH_MAX.
Sean Silva [Thu, 7 Apr 2016 01:58:14 +0000 (01:58 +0000)]
Don't use PATH_MAX.

This is a SmallVector anyway, and so the exact size doesn't matter.

clang\lib\Frontend\ModuleDependencyCollector.cpp(83) : error C2065: 'PATH_MAX' : undeclared identifier
clang\lib\Frontend\ModuleDependencyCollector.cpp(83) : error C2975: 'InternalLen' : invalid template argument for 'llvm::SmallString', expected compile-time constant expression
        llvm\include\llvm/ADT/SmallString.h(24) : see declaration of 'InternalLen'

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

8 years ago[CrashReproducer] Use toUppercase from include/clang/Basic/CharInfo.h
Bruno Cardoso Lopes [Thu, 7 Apr 2016 01:12:18 +0000 (01:12 +0000)]
[CrashReproducer] Use toUppercase from include/clang/Basic/CharInfo.h

Use toUppercase instead of ::toupper()

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

8 years ago[CrashReproducer] Change std::toupper to ::toupper
Bruno Cardoso Lopes [Thu, 7 Apr 2016 01:04:09 +0000 (01:04 +0000)]
[CrashReproducer] Change std::toupper to ::toupper

Attempt to fix windows bots

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

8 years ago[CrashReproducer] Setup 'case-sensitive' in YAML files.
Bruno Cardoso Lopes [Thu, 7 Apr 2016 00:00:57 +0000 (00:00 +0000)]
[CrashReproducer] Setup 'case-sensitive' in YAML files.

The crash reproducer was not setting up case sensitivity in the
VFS yaml files, which defaults to true. Make the crash reproducer
explicitly set that flag based on the case sensitivity of the .cache
path where vfs and modules are dumped.

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

8 years ago[CrashReproducer] Move ModuleDependencyCollector method around. NFC
Bruno Cardoso Lopes [Thu, 7 Apr 2016 00:00:42 +0000 (00:00 +0000)]
[CrashReproducer] Move ModuleDependencyCollector method around. NFC

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

8 years agoNFC: use AtomicOrdering isStrongerThan
JF Bastien [Wed, 6 Apr 2016 23:37:36 +0000 (23:37 +0000)]
NFC: use AtomicOrdering isStrongerThan

Summary: As discussed in D18775.

Reviewers: jyknight

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

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

8 years agoKeep -fmodule-implementation-of as an alias of -fmodule-name.
Manman Ren [Wed, 6 Apr 2016 23:28:26 +0000 (23:28 +0000)]
Keep -fmodule-implementation-of as an alias of -fmodule-name.

This helps us transitioning to -fmodule-name. Once the transitioning is done,
we can remove this alias.

rdar://24800983

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

8 years agoRevert "Set the default C standard to C99 when targeting the PS4."
Sean Silva [Wed, 6 Apr 2016 21:06:52 +0000 (21:06 +0000)]
Revert "Set the default C standard to C99 when targeting the PS4."

This reverts r265359.

It breaks
- llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast
- llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast

Failing Tests (5):
    Clang :: FixIt/fixit-errors.c
    Clang :: Preprocessor/init.c
    Clang :: Sema/attr-deprecated.c
    Clang :: Sema/nullability.c
    Clang :: SemaObjC/objcbridge-attribute-arc.m

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

8 years ago[modules] Add forgotten test case to r265597.
Vassil Vassilev [Wed, 6 Apr 2016 20:58:12 +0000 (20:58 +0000)]
[modules] Add forgotten test case to r265597.

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

8 years agoFix order-of-evaluation bug (causing GCC buildbots to fail).
Richard Smith [Wed, 6 Apr 2016 20:57:53 +0000 (20:57 +0000)]
Fix order-of-evaluation bug (causing GCC buildbots to fail).

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

8 years ago[modules] Don't try to add lookup results to non-lookup contexts.
Vassil Vassilev [Wed, 6 Apr 2016 20:56:03 +0000 (20:56 +0000)]
[modules] Don't try to add lookup results to non-lookup contexts.

Fixes https://llvm.org/bugs/show_bug.cgi?id=27186

Patch reviewed by Richard Smith.

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

8 years agoMinor simplifications.
Richard Smith [Wed, 6 Apr 2016 20:12:34 +0000 (20:12 +0000)]
Minor simplifications.

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

8 years agoRestore slightly less dodgy diagnostic handler for inline asm
Tim Northover [Wed, 6 Apr 2016 19:58:07 +0000 (19:58 +0000)]
Restore slightly less dodgy diagnostic handler for inline asm

Turns out it was there mostly to prevent Clang asking people to report a bug.
This time we report something to Clang's real diagnostics handler so that it
exits with something approximating a real error and tidies up after itself.

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

8 years agoDiagnose template alias declarations in local classes.
Richard Smith [Wed, 6 Apr 2016 17:38:58 +0000 (17:38 +0000)]
Diagnose template alias declarations in local classes.

Patch by Erik Pilkington!

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

8 years agoNFC: make AtomicOrdering an enum class
JF Bastien [Wed, 6 Apr 2016 17:26:42 +0000 (17:26 +0000)]
NFC: make AtomicOrdering an enum class

Summary: See LLVM change D18775 for details, this change depends on it.

Reviewers: jyknight, reames

Subscribers: cfe-commits

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

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

8 years agoRe-commit r265518 ("[modules] Continue factoring encoding of AST records out of
Richard Smith [Wed, 6 Apr 2016 17:06:00 +0000 (17:06 +0000)]
Re-commit r265518 ("[modules] Continue factoring encoding of AST records out of
ASTWriter."), reverted in r265526, with a fix for an iterator invalidation bug
(thanks, MSan!).

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

8 years agoclang-format: Fix label-in-if statement in macros where it is actually used.
Daniel Jasper [Wed, 6 Apr 2016 16:41:39 +0000 (16:41 +0000)]
clang-format: Fix label-in-if statement in macros where it is actually used.

Before:
  #define A \
    if (a)  \
    label:  \
    f()

After:
  #define A \
    if (a)  \
    label:  \
      f()

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

8 years agoEnable PIE for CloudABI.
Ed Schouten [Wed, 6 Apr 2016 15:37:06 +0000 (15:37 +0000)]
Enable PIE for CloudABI.

As we're currently working on making CloudABI executables easier to
emulate in userspace (e.g., on OS X and Windows), it makes a whole lot
of sense to build these using PIE. By using PIE, they can simply be
loaded into the existing process address space without clashes.

PIE support got added to CloudABI's C library and seems to work pretty
well. CloudABI does not make use of an ld.so, so the binary's _start()
has all the logic in it to do the relocations.

Now that all but one bug in LLD relating to PIE support have been
squashed (and a patch for that is already in code review), I'd like to
go ahead and force the use of PIE for Clang 3.9. When released, we'll
also switch over to using LLD exclusively.

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

8 years agoclang-format: Support labels in brace-less ifs.
Daniel Jasper [Wed, 6 Apr 2016 15:02:46 +0000 (15:02 +0000)]
clang-format: Support labels in brace-less ifs.

While I am not personally convinced about the usefulness of this
construct, we should break it.

Before:
  if (a) label:
  f();

After:
  if (a)
  label:
    f();

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

8 years agoclang-format: Fix incorrect function annotation detection.
Daniel Jasper [Wed, 6 Apr 2016 13:58:09 +0000 (13:58 +0000)]
clang-format: Fix incorrect function annotation detection.

Before:
  MACRO(
      abc).function() // wrap
      << abc;

After:
  MACRO(abc).function() // wrap
      << abc;

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

8 years ago[OPENMP] Parsing and Sema support for 'omp declare target' directive
Dmitry Polukhin [Wed, 6 Apr 2016 11:38:59 +0000 (11:38 +0000)]
[OPENMP] Parsing and Sema support for 'omp declare target' directive

Add parsing, sema analysis for 'declare target' construct for OpenMP 4.0
(4.5 support will be added in separate patch).

The declare target directive specifies that variables, functions (C, C++
and Fortran), and subroutines (Fortran) are mapped to a device. The declare
target directive is a declarative directive. In Clang declare target is
implemented as implicit attribute for the declaration.

The syntax of the declare target directive is as follows:

 #pragma omp declare target
 declarations-definition-seq
 #pragma omp end declare target

Based on patch from Michael Wong http://reviews.llvm.org/D15321

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

8 years agoRevert "[modules] Continue factoring encoding of AST records out of ASTWriter."
Dmitry Polukhin [Wed, 6 Apr 2016 10:01:46 +0000 (10:01 +0000)]
Revert "[modules] Continue factoring encoding of AST records out of ASTWriter."

This reverts commit r265518.

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

8 years ago[modules] Continue factoring encoding of AST records out of ASTWriter.
Richard Smith [Wed, 6 Apr 2016 06:26:08 +0000 (06:26 +0000)]
[modules] Continue factoring encoding of AST records out of ASTWriter.

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

8 years agoUpdate testing cases after backend changes.
Manman Ren [Tue, 5 Apr 2016 23:27:51 +0000 (23:27 +0000)]
Update testing cases after backend changes.

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

8 years agoFix a crash on invalid with template handling
Richard Trieu [Tue, 5 Apr 2016 21:13:54 +0000 (21:13 +0000)]
Fix a crash on invalid with template handling

This is a fix for https://llvm.org/bugs/show_bug.cgi?id=25561 which was a
crash on invalid.  Change the handling of invalid decls to have a catch-all
case to prevent unexpecting decls from triggering an assertion.

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

8 years agoFix broken tests from no-jump-table commit
Nirav Dave [Tue, 5 Apr 2016 18:59:37 +0000 (18:59 +0000)]
Fix broken tests from no-jump-table commit

Summary: Fix failing tests from no-jump-table flag addition

Reviewers: jyknight

Subscribers: llvm-commits

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

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

8 years ago[CUDA] Show --cuda-gpu-arch option in clang --help.
Justin Lebar [Tue, 5 Apr 2016 18:26:25 +0000 (18:26 +0000)]
[CUDA] Show --cuda-gpu-arch option in clang --help.

For some reason it was hidden.

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

8 years ago[CUDA] Add -fcuda-flush-denormals-to-zero.
Justin Lebar [Tue, 5 Apr 2016 18:26:20 +0000 (18:26 +0000)]
[CUDA] Add -fcuda-flush-denormals-to-zero.

Summary:
Setting this flag causes all functions are annotated with the
"nvvm-f32ftz" = "true" attribute.

In addition, we annotate the module with "nvvm-reflect-ftz" set
to 0 or 1, depending on whether -cuda-flush-denormals-to-zero is set.
This is read by the NVVMReflect pass.

Reviewers: tra, rnk

Subscribers: cfe-commits

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

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

8 years agoFix missing period in no-jump-table flag comment. NFC.
Nirav Dave [Tue, 5 Apr 2016 18:11:01 +0000 (18:11 +0000)]
Fix missing period in no-jump-table flag comment. NFC.

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

8 years agoAdd -fno-jump-tables and-fjump-tables flags
Nirav Dave [Tue, 5 Apr 2016 17:50:43 +0000 (17:50 +0000)]
Add -fno-jump-tables and-fjump-tables flags

Add no-jump-tables flag to disable use of jump tables when lowering
switch statements

Reviewers: echristo, hans

Subscribers: llvm-commits

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

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

8 years ago[X86] Introduction of -march=lakemont.
Andrey Turetskiy [Tue, 5 Apr 2016 15:04:26 +0000 (15:04 +0000)]
[X86] Introduction of -march=lakemont.

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

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

8 years agoclang-format: Fix cast detection on "this".
Daniel Jasper [Tue, 5 Apr 2016 11:46:06 +0000 (11:46 +0000)]
clang-format: Fix cast detection on "this".

Before:
  auto x = (X) this;

After:
  auto x = (X)this;

This fixes llvm.org/PR27198.

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

8 years agoConsolidate and improve the handling of built-in feature-like macros
Andy Gibbs [Tue, 5 Apr 2016 08:36:47 +0000 (08:36 +0000)]
Consolidate and improve the handling of built-in feature-like macros

Summary:
The parsing logic has been separated out from the macro implementation logic, leading to a number of improvements:

* Gracefully handle unexpected/invalid tokens, too few, too many and nested parameters
* Provide consistent behaviour between all built-in feature-like macros
* Simplify the implementation of macro logic
* Fix __is_identifier to correctly return '0' for non-identifiers

Reviewers: doug.gregor, rsmith

Subscribers: rsmith, cfe-commits

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

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

8 years agoMove local helper class into anonymous namespace.
Richard Smith [Mon, 4 Apr 2016 23:29:43 +0000 (23:29 +0000)]
Move local helper class into anonymous namespace.

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

8 years agoFix test failure from r265361
Reid Kleckner [Mon, 4 Apr 2016 23:14:14 +0000 (23:14 +0000)]
Fix test failure from r265361

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

8 years agoSet the default C standard to C99 when targeting the PS4.
Sunil Srivastava [Mon, 4 Apr 2016 22:56:05 +0000 (22:56 +0000)]
Set the default C standard to C99 when targeting the PS4.

Patch by Douglas Yung!

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

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

8 years agoFix "suggest parentheses" warning.
James Y Knight [Mon, 4 Apr 2016 22:35:56 +0000 (22:35 +0000)]
Fix "suggest parentheses" warning.

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

8 years agoFix an unused-variable warning by using the variable in the place
John McCall [Mon, 4 Apr 2016 20:39:50 +0000 (20:39 +0000)]
Fix an unused-variable warning by using the variable in the place
it was supposed to have been used.

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

8 years ago[CrashReproducer] Pass -I, -F and -resource-dir to the reproducer script when using...
Bruno Cardoso Lopes [Mon, 4 Apr 2016 20:26:57 +0000 (20:26 +0000)]
[CrashReproducer] Pass -I, -F and -resource-dir to the reproducer script when using modules/vfs

The reproducer should use -I/-F/-resource-dir in the same way as the
original command. The VFS already collects the right headers but without
these flags the reproducer will fail to do the right thing.

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

8 years ago[Sema] Delete FIXME that has been fixed. NFC.
George Burgess IV [Mon, 4 Apr 2016 19:44:16 +0000 (19:44 +0000)]
[Sema] Delete FIXME that has been fixed. NFC.

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

8 years agoFix redundant "typename typename T" in Visual Studio Native Visualizer
Mike Spertus [Mon, 4 Apr 2016 19:36:48 +0000 (19:36 +0000)]
Fix redundant "typename typename T" in Visual Studio Native Visualizer

Also, a little minor cleanup

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

8 years agoAssignment operators should return by reference.
John McCall [Mon, 4 Apr 2016 18:53:01 +0000 (18:53 +0000)]
Assignment operators should return by reference.

Thanks to Sean Silva for pointing this out.

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

8 years agoAdd copyright notice to the modulemap file.
Yunzhong Gao [Mon, 4 Apr 2016 18:46:09 +0000 (18:46 +0000)]
Add copyright notice to the modulemap file.

The module.modulemap file in the lib/Headers directory was missing the LLVM
copyright notice. This patch adds the copyright notice just like the rest of
the files in this directory.

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

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

8 years agoIRGen-level lowering for the Swift calling convention.
John McCall [Mon, 4 Apr 2016 18:33:08 +0000 (18:33 +0000)]
IRGen-level lowering for the Swift calling convention.

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

8 years agoAdd a couple of convenience operations to CharUnits.
John McCall [Mon, 4 Apr 2016 18:33:00 +0000 (18:33 +0000)]
Add a couple of convenience operations to CharUnits.

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

8 years ago[OPENMP] Codegen for teams directive for NVPTX
Carlo Bertolli [Mon, 4 Apr 2016 15:55:02 +0000 (15:55 +0000)]
[OPENMP] Codegen for teams directive for NVPTX

This patch implements the teams directive for the NVPTX backend. It is different from the host code generation path as it:

Does not call kmpc_fork_teams. All necessary teams and threads are started upon touching the target region, when launching a CUDA kernel, and their execution is coordinated through sequential and parallel regions within the target region.
Does not call kmpc_push_num_teams even if a num_teams of thread_limit clause is present. Setting the number of teams and the thread limit is implemented by the nvptx-related runtime.
Please note that I am now passing a Clang Expr * to emitPushNumTeams instead of the originally chosen llvm::Value * type. The reason for that is that I want to avoid emitting expressions for num_teams and thread_limit if they are not needed in the target region.

http://reviews.llvm.org/D17963

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

8 years agoAnnotateFunctions: Tweak for mingw.
NAKAMURA Takumi [Mon, 4 Apr 2016 15:30:44 +0000 (15:30 +0000)]
AnnotateFunctions: Tweak for mingw.

  - Externalize the registry.
  - Update libdeps.

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

8 years agoAdd a PragmaHandler Registry for plugins to add PragmaHandlers to
John Brawn [Mon, 4 Apr 2016 14:22:58 +0000 (14:22 +0000)]
Add a PragmaHandler Registry for plugins to add PragmaHandlers to

This allows plugins which add AST passes to also define pragmas to do things
like only enable certain behaviour of the AST pass in files where a certain
pragma is used.

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

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

8 years ago[OPENMP 4.0] Support for 'inbranch|noinbranch' clauses in 'declare
Alexey Bataev [Mon, 4 Apr 2016 10:12:15 +0000 (10:12 +0000)]
[OPENMP 4.0] Support for 'inbranch|noinbranch' clauses in 'declare
simd'.

Added parsing/semantic analysis for 'inbranch|notinbranch' clauses of
'#pragma omp declare simd' construct.

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

8 years agoFix test case committed in r265197.
Akira Hatanaka [Sun, 3 Apr 2016 03:36:22 +0000 (03:36 +0000)]
Fix test case committed in r265197.

The test was failing on some release build because the basic block names
I was expecting weren't printed.

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

8 years ago[c-index-test] Fix leak in print_completion_result, NFC
Vedant Kumar [Sun, 3 Apr 2016 00:54:46 +0000 (00:54 +0000)]
[c-index-test] Fix leak in print_completion_result, NFC

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

8 years agoclang-cl: Don't skip i_group flags other than -include when building pchs.
Nico Weber [Sat, 2 Apr 2016 19:10:07 +0000 (19:10 +0000)]
clang-cl: Don't skip i_group flags other than -include when building pchs.

Before this change, e.g. -isystem flags in front of the /FI corresponding to the
pch file would be incorrectly ignored.

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

8 years ago[test] Don't use "UNSUPPORTED" in FileCheck prefixes
Greg Parker [Sat, 2 Apr 2016 05:29:00 +0000 (05:29 +0000)]
[test] Don't use "UNSUPPORTED" in FileCheck prefixes

lit uses "UNSUPPORTED:" for its own purposes and may be
confused if that text appears elsewhere in the test file.

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

8 years ago[Objective-C] Introduce objc_runtime_visible attribute.
Douglas Gregor [Fri, 1 Apr 2016 23:23:52 +0000 (23:23 +0000)]
[Objective-C] Introduce objc_runtime_visible attribute.

The objc_runtime_visible attribute deals with an odd corner case where
a particular Objective-C class is known to the Objective-C runtime
(and, therefore, accessible by name) but its symbol has been hidden
for some reason. For such classes, teach CodeGen to use
objc_lookUpClass to retrieve the Class object, rather than referencing
the class symbol directly.

Classes annotated with objc_runtime_visible have two major limitations
that fall out from places where Objective-C metadata needs to refer to
the class (or metaclass) symbol directly:

* One cannot implement a subclass of an objc_runtime_visible class.
* One cannot implement a category on an objc_runtime_visible class.

Implements rdar://problem/25494092.

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

8 years ago[CodeGen] Emit lifetime.end intrinsic after objects are destructed in
Akira Hatanaka [Fri, 1 Apr 2016 22:58:55 +0000 (22:58 +0000)]
[CodeGen] Emit lifetime.end intrinsic after objects are destructed in
landing pads.

Previously, lifetime.end intrinsics were inserted only on normal control
flows. This prevented StackColoring from merging stack slots for objects
that were destroyed on the exception handling control flow since it
couldn't tell their lifetime ranges were disjoint. This patch fixes
code-gen to emit the intrinsic on both control flows.

rdar://problem/22181976

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

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

8 years ago[modules] Start moving the code for encoding AST records out of ASTWriter into
Richard Smith [Fri, 1 Apr 2016 22:52:03 +0000 (22:52 +0000)]
[modules] Start moving the code for encoding AST records out of ASTWriter into
a separate class. The goal is for this class to have a separate lifetime from
the AST writer so that it can meaningfully track pending statement nodes and
context for more compact encoding of various types.

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

8 years agoClean up a couple more preprocessor tests to use match-full-lines.
James Y Knight [Fri, 1 Apr 2016 21:33:20 +0000 (21:33 +0000)]
Clean up a couple more preprocessor tests to use match-full-lines.

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

8 years agoDiagnose missing macro argument following charize operator.
Andy Gibbs [Fri, 1 Apr 2016 19:02:20 +0000 (19:02 +0000)]
Diagnose missing macro argument following charize operator.

For completeness, add a test-case for the equivalent stringize operator
diagnostic too.

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

8 years ago[CrashReproducer] Add -fmodule-cache-path to reproducer script
Bruno Cardoso Lopes [Fri, 1 Apr 2016 17:39:08 +0000 (17:39 +0000)]
[CrashReproducer] Add -fmodule-cache-path to reproducer script

The cc1 invocation in the reproducer script should contain a valid path in
-fmodule-cache-path; for that reuse "<name>.cache/module" dir we already
use to dump the vfs and modules.

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