]> granicus.if.org Git - clang/log
clang
10 years agoObjective-C [IRGen]. Generator a tail call to objc_getProperty() in
Fariborz Jahanian [Thu, 30 Jan 2014 00:16:39 +0000 (00:16 +0000)]
Objective-C [IRGen]. Generator a tail call to objc_getProperty() in
synthesized getters for performance improvement.
// rdar://15884113

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

10 years agoConsolidating several table-generated files containing parser-related string switches...
Aaron Ballman [Wed, 29 Jan 2014 22:13:45 +0000 (22:13 +0000)]
Consolidating several table-generated files containing parser-related string switches into a single file. This reduces build-related complexity by replacing four separate projects (and table-gen instantiations) with a single one.

No functional changes intended.

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

10 years agoSema: Diagnose improper application of inheritance keywords
David Majnemer [Wed, 29 Jan 2014 22:07:36 +0000 (22:07 +0000)]
Sema: Diagnose improper application of inheritance keywords

We would previously allow inappropriate inheritance keywords to appear
on class declarations.  We would also allow inheritance keywords on
templates which were not fully specialized; this was divergent from
MSVC.

Differential Revision: http://llvm-reviews.chandlerc.com/D2585

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

10 years agoclang-format: More custom option fixes for protocol buffer files.
Daniel Jasper [Wed, 29 Jan 2014 18:52:43 +0000 (18:52 +0000)]
clang-format: More custom option fixes for protocol buffer files.

Before:
  repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {
                               aaaaaaaaaaaaaaaa : AAAAAAAAAA,
                               bbbbbbbbbbbbbbbb : BBBBBBBBBB
                             }];

After:
  repeated double value = 1
      [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaa : AAAAAAAAAA,
                              bbbbbbbbbbbbbbbb : BBBBBBBBBB}];

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

10 years agoclang-format: Fix formatting of custom proto options.
Daniel Jasper [Wed, 29 Jan 2014 18:43:40 +0000 (18:43 +0000)]
clang-format: Fix formatting of custom proto options.

Before:
  repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {
                              aaaaaaaaaaaaaaaaa : AAAAAAAA
                            }];

After:
  repeated double value = 1
      [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaaa : AAAAAAAA}];

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

10 years agoCortex-M3 and Cortex-M4 should not enable hwdiv-arm (committing again, with an update...
Artyom Skrobov [Wed, 29 Jan 2014 09:43:07 +0000 (09:43 +0000)]
Cortex-M3 and Cortex-M4 should not enable hwdiv-arm (committing again, with an updated test)

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

10 years agoFix crash on unmatched #endif's.
Manuel Klimek [Wed, 29 Jan 2014 08:49:02 +0000 (08:49 +0000)]
Fix crash on unmatched #endif's.

The following snippet would crash:
  #endif
  #if A

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

10 years agoShort-circuit a couple of queries (and avoid corrupting
John McCall [Wed, 29 Jan 2014 08:33:09 +0000 (08:33 +0000)]
Short-circuit a couple of queries (and avoid corrupting
the linkage cache) when type-checking static local
variables.

There's a very deep problem here where the linkage of
a declaration can suddenly massively change as soon as
it's given a typedef name; these fixes, while optimizations
in their own right, are really just targeted workarounds.

rdar://15928125

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

10 years agoExtensively comment bitfield layout, rearrange some
John McCall [Wed, 29 Jan 2014 07:53:44 +0000 (07:53 +0000)]
Extensively comment bitfield layout, rearrange some
code for legibility, and fix a bug with bitfields in packed
ms_structs.

rdar://15926990

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

10 years agoclang-cl: Better error message when trying to compile stdin (PR18640)
Hans Wennborg [Wed, 29 Jan 2014 01:04:40 +0000 (01:04 +0000)]
clang-cl: Better error message when trying to compile stdin (PR18640)

We should suggest using /Tc or /Tp to set the input type, instead of
erroneously suggesting -x, which isn't a clang-cl flag.

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

10 years agoFixing PR18430 by checking that the size of bitfields plus padding does not
Yunzhong Gao [Wed, 29 Jan 2014 00:09:16 +0000 (00:09 +0000)]
Fixing PR18430 by checking that the size of bitfields plus padding does not
grow into the following virtual base.

Differential Revision: http://llvm-reviews.chandlerc.com/D2560

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

10 years agoA new conversion warning for when an Objective-C object literal is implicitly
Richard Trieu [Tue, 28 Jan 2014 23:40:26 +0000 (23:40 +0000)]
A new conversion warning for when an Objective-C object literal is implicitly
cast into a boolean true value.  This warning will catch code like:

if (@0) {}
if (@"foo") {}

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

10 years agoIntrin.h: include setjmp.h to get a jmp_buf definition
Hans Wennborg [Tue, 28 Jan 2014 23:01:59 +0000 (23:01 +0000)]
Intrin.h: include setjmp.h to get a jmp_buf definition

This makes sure that the ms-intrin.cpp test passes by providing
a mock setjmp.h as a test input.

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

10 years agoIntrin.h: implement __rdtsc and __halt
Hans Wennborg [Tue, 28 Jan 2014 22:55:01 +0000 (22:55 +0000)]
Intrin.h: implement __rdtsc and __halt

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

10 years agoObjective-C. Fixes a bug where "new" family attribute
Fariborz Jahanian [Tue, 28 Jan 2014 22:46:29 +0000 (22:46 +0000)]
Objective-C. Fixes a bug where "new" family attribute
was not being overridden in the category method implementation
resulting in bogus warning. // rdar://15919775

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

10 years agoObjective-C. provide legacy encoding of *id and *Class types
Fariborz Jahanian [Tue, 28 Jan 2014 20:41:15 +0000 (20:41 +0000)]
Objective-C. provide legacy encoding of *id and *Class types
instead of crashing.  // rdar://15824769.

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

10 years agoclang-format: Understand __attribute__s preceding parameter lists.
Daniel Jasper [Tue, 28 Jan 2014 20:13:43 +0000 (20:13 +0000)]
clang-format: Understand __attribute__s preceding parameter lists.

Before:
  ReturnType __attribute__((unused))
      function(int i);

After:
  ReturnType __attribute__((unused))
  function(int i);

This fixes llvm.org/PR18632.

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

10 years agoclang-format: Fix option formatting in protocol buffer files.
Daniel Jasper [Tue, 28 Jan 2014 18:51:11 +0000 (18:51 +0000)]
clang-format: Fix option formatting in protocol buffer files.

Before:
  optional int32 foo[ default = true, deprecated = true ];

After:
  optional int32 foo[default = true, deprecated = true];

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

10 years agoclang-format: Add support for a space after @property
Daniel Jasper [Tue, 28 Jan 2014 15:20:33 +0000 (15:20 +0000)]
clang-format: Add support for a space after @property

Mozilla and WebKit seem to use a space after @property (verified by
grepping their codebases) so we turn this on there as well.

Change by Christian Legnitto. Thank you!

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

10 years ago[ARM] Fix AAPCS-VFP non-compliance when returning HFA from variadic functions.
Amara Emerson [Tue, 28 Jan 2014 10:56:36 +0000 (10:56 +0000)]
[ARM] Fix AAPCS-VFP non-compliance when returning HFA from variadic functions.

Arguments and return values must always be marshalled as for the base
AAPCS when the callee is a variadic function.

Patch by Oliver Stannard!

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

10 years ago[CMake] Apply llvm_update_compile_flags() to add_clang_library().
NAKAMURA Takumi [Tue, 28 Jan 2014 09:47:12 +0000 (09:47 +0000)]
[CMake] Apply llvm_update_compile_flags() to add_clang_library().

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

10 years ago[CMake] clangStaticAnalyzerFrontend: Deprecate LLVM_NO_RTTI.
NAKAMURA Takumi [Tue, 28 Jan 2014 09:43:16 +0000 (09:43 +0000)]
[CMake] clangStaticAnalyzerFrontend: Deprecate LLVM_NO_RTTI.

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

10 years agoClarify. Thanks to Sean Silva and Warren Hunt for help wordsmithing!
Nick Lewycky [Tue, 28 Jan 2014 07:03:46 +0000 (07:03 +0000)]
Clarify. Thanks to Sean Silva and Warren Hunt for help wordsmithing!

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

10 years agoFix this test and don't run it in ASan bootstrap
Alexey Samsonov [Tue, 28 Jan 2014 06:59:32 +0000 (06:59 +0000)]
Fix this test and don't run it in ASan bootstrap

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

10 years agoTurn on PIC by default on Android (http://llvm-reviews.chandlerc.com/D2603)
Alexey Bataev [Tue, 28 Jan 2014 06:30:35 +0000 (06:30 +0000)]
Turn on PIC by default on Android (http://llvm-reviews.chandlerc.com/D2603)

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

10 years agoFix always-false conditional thinko in documentation.
Nick Lewycky [Tue, 28 Jan 2014 06:20:56 +0000 (06:20 +0000)]
Fix always-false conditional thinko in documentation.

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

10 years agoTest case for clobbers on cpuid in ms inline asm
Reid Kleckner [Tue, 28 Jan 2014 02:09:28 +0000 (02:09 +0000)]
Test case for clobbers on cpuid in ms inline asm

Tests r200279 in LLVM.

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

10 years agoRelaxing the alignment requirements for fields in a transparent_union. Emits the...
Aaron Ballman [Tue, 28 Jan 2014 01:47:34 +0000 (01:47 +0000)]
Relaxing the alignment requirements for fields in a transparent_union. Emits the diagnostic only when subsequent alignments are more strict than the alignment required by the first field.

Fixes PR15134

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

10 years agoApply the typo correction replacement location fix from r191450 to the
Kaelyn Uhrain [Tue, 28 Jan 2014 00:46:47 +0000 (00:46 +0000)]
Apply the typo correction replacement location fix from r191450 to the
case when correcting for too many arguments (r191450 had only fixed the
problem for when there were too few arguments). Also fix the underlining
for both cases.

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

10 years agoRemove dead code; MacroDirective's IsHidden flag is always false.
Richard Smith [Mon, 27 Jan 2014 23:54:39 +0000 (23:54 +0000)]
Remove dead code; MacroDirective's IsHidden flag is always false.

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

10 years agoReverting because reverting r200145.
Adrian Prantl [Mon, 27 Jan 2014 22:57:33 +0000 (22:57 +0000)]
Reverting because reverting r200145.
Revert "check-clang doesn't require neither llvm_src_root nor llvm_obj_root."

This reverts commit r200146.

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

10 years agoReverting because reverting r200145.
Adrian Prantl [Mon, 27 Jan 2014 22:57:30 +0000 (22:57 +0000)]
Reverting because reverting r200145.
Revert "clang-check: Unittests doesn't requires tools."

This reverts commit r200147.

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

10 years agoRumors of test_debuginfo's death are slightly exaggerated.
Adrian Prantl [Mon, 27 Jan 2014 22:50:20 +0000 (22:50 +0000)]
Rumors of test_debuginfo's death are slightly exaggerated.
Revert "Revert r113780, "Recognize .ll as input files. Handle %test_debuginfo on a RUN command line.""

This reverts commit r200145.

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

10 years agoAnother test for patch for // rdar://15890251
Fariborz Jahanian [Mon, 27 Jan 2014 22:44:17 +0000 (22:44 +0000)]
Another test for patch for // rdar://15890251

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

10 years agoTemporarily disable test that fails on Mac OS X 10.9.
Bob Wilson [Mon, 27 Jan 2014 22:43:21 +0000 (22:43 +0000)]
Temporarily disable test that fails on Mac OS X 10.9.

PR18322. This test will be reenabled when the SDK gets fixed. In the meantime,
it is pretty disruptive to have this test keep failing.

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

10 years agoObjectiveC. Fixes a bug in recognition of an ivar
Fariborz Jahanian [Mon, 27 Jan 2014 22:27:43 +0000 (22:27 +0000)]
ObjectiveC. Fixes a bug in recognition of an ivar
backing a property resulting in bogus warning.
// rdar://15890251

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

10 years agoAdd a new attribute meta-spelling called "GCC" -- it widens into being a GNU spelling...
Aaron Ballman [Mon, 27 Jan 2014 22:10:04 +0000 (22:10 +0000)]
Add a new attribute meta-spelling called "GCC" -- it widens into being a GNU spelling, and a CXX11 spelling with the namespace "gnu". It also sets a bit on the spelling certifying that it is known to GCC. From this, we can warn about the extension appropriately. As a consequence, the FunctionDefinition functionality is completely removed.

Replacing the functionality from r199676, which didn't solve the problem as elegantly.

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

10 years agoRemove dead code.
Richard Smith [Mon, 27 Jan 2014 22:08:43 +0000 (22:08 +0000)]
Remove dead code.

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

10 years agoRevert "intrin.h: include setjmp.h to get a jmp_buf definition"
Reid Kleckner [Mon, 27 Jan 2014 19:32:42 +0000 (19:32 +0000)]
Revert "intrin.h: include setjmp.h to get a jmp_buf definition"

This failed the ms-intrin.cpp test.

This reverts commit r200237.

This also comments out the _setjmpex declaration for now so that
intrin.h will work on x64 targets.

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

10 years agoRevert "Cortex-M3 and Cortex-M4 should not enable hwdiv-arm"
Reid Kleckner [Mon, 27 Jan 2014 19:26:39 +0000 (19:26 +0000)]
Revert "Cortex-M3 and Cortex-M4 should not enable hwdiv-arm"

This reverts commit r200233.

The test required a registered ARM target, it was testing LLVM's
generated assembly, and it should have been an IRGen test.

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

10 years agoAdd implementations of some MSVC intrinsics
Reid Kleckner [Mon, 27 Jan 2014 19:16:35 +0000 (19:16 +0000)]
Add implementations of some MSVC intrinsics

Adds an implementation for _InterlockedCompareExchangePointer() and
__faststorefence().

Patch by David Ziman!

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

10 years agoObjectiveC. When introducing a new property declaration in
Fariborz Jahanian [Mon, 27 Jan 2014 19:14:49 +0000 (19:14 +0000)]
ObjectiveC. When introducing a new property declaration in
parimary class and in mrr mode, assume property's default
memory attribute (assign) and to prevent a bogus warning.
// rdar://15859862

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

10 years agointrin.h: include setjmp.h to get a jmp_buf definition
Reid Kleckner [Mon, 27 Jan 2014 19:14:09 +0000 (19:14 +0000)]
intrin.h: include setjmp.h to get a jmp_buf definition

This fixes an error on our _setjmpex declaration for 64-bit code and
allows us to declare _setjmp for 32-bit code.

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

10 years agoDriver: support -fno-debug-types-section to override -fdebug-types-section
David Blaikie [Mon, 27 Jan 2014 18:52:43 +0000 (18:52 +0000)]
Driver: support -fno-debug-types-section to override -fdebug-types-section

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

10 years agoAdd 'static __inline__' to MSVC intrinsics with implementations
Reid Kleckner [Mon, 27 Jan 2014 18:48:02 +0000 (18:48 +0000)]
Add 'static __inline__' to MSVC intrinsics with implementations

This avoids warnings visible with -Wsystem-headers.

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

10 years agoCortex-M3 and Cortex-M4 should not enable hwdiv-arm
Artyom Skrobov [Mon, 27 Jan 2014 18:44:25 +0000 (18:44 +0000)]
Cortex-M3 and Cortex-M4 should not enable hwdiv-arm

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

10 years agoXCore target exception handling
Robert Lytton [Mon, 27 Jan 2014 17:56:25 +0000 (17:56 +0000)]
XCore target exception handling

Implement __builtin_eh_return_data_regno()

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

10 years agoComment parsing: don't crash while parsing \deprecated in a standalone comment
Dmitri Gribenko [Mon, 27 Jan 2014 17:55:43 +0000 (17:55 +0000)]
Comment parsing: don't crash while parsing \deprecated in a standalone comment
(comment without a decl).

I think this can not happen during normal compilation with -Wdocumentation,
only while using Clang APIs to parse comments outside of a source file.

Based on a patch by Olivier Goffart.

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

10 years ago[Mips] Fix __mips macro definition.
Simon Atanasyan [Mon, 27 Jan 2014 13:59:11 +0000 (13:59 +0000)]
[Mips] Fix __mips macro definition.

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

10 years ago[Mips] Change default CPU for MIPS 32/64 targets. Now they are mips32r2/mips64r2...
Simon Atanasyan [Mon, 27 Jan 2014 13:59:04 +0000 (13:59 +0000)]
[Mips] Change default CPU for MIPS 32/64 targets. Now they are mips32r2/mips64r2 respectively.

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

10 years ago[Mips] Add tests to check MIPS arch macros.
Simon Atanasyan [Mon, 27 Jan 2014 13:58:54 +0000 (13:58 +0000)]
[Mips] Add tests to check MIPS arch macros.

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

10 years agoRoll back the use of ConstStringRef for now
Alp Toker [Mon, 27 Jan 2014 05:21:24 +0000 (05:21 +0000)]
Roll back the use of ConstStringRef for now

We might want try a different strategy so hold back on this for the moment, but
fix the off-by-one error in the original function template.

This reverts commit r200190.

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

10 years agoUse ConstStringRef facility for getCustomDiagID() safety
Alp Toker [Mon, 27 Jan 2014 04:22:22 +0000 (04:22 +0000)]
Use ConstStringRef facility for getCustomDiagID() safety

This is one of various functions in clang that don't handle arbitrary strings
well and can benefit from compile-time safety checks.

Also fixes an off-by-one error that caused one additional null byte to get
added to the end of custom diagnostic descriptions. ConstStringRef handles
tricky details like that for us now.

Requires supporting changes in LLVM r200187.

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

10 years agoPR17052 / DR1560 (+DR1550): In a conditional expression between a glvalue and a
Richard Smith [Mon, 27 Jan 2014 04:19:56 +0000 (04:19 +0000)]
PR17052 / DR1560 (+DR1550): In a conditional expression between a glvalue and a
throw-expression, the result is also a glvalue and isn't unnecessarily coerced
to a prvalue.

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

10 years agoFix r195149. Triple should correctly reflect that target. If it contains ios,
Evan Cheng [Sun, 26 Jan 2014 23:12:43 +0000 (23:12 +0000)]
Fix r195149. Triple should correctly reflect that target. If it contains ios,
e.g. thumbv7m-apple-ios3.0.0-eabi, then it should mean it's an iOS target. For
embedded targets, the OS should be unknown, e.g. thumbv7m-apple-unknown-macho.
Since Tim has recently fixed the triple, r195149 is no longer needed.
rdar://15911035

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

10 years agoUse canonical spelling of NetBSD
Joerg Sonnenberger [Sun, 26 Jan 2014 20:02:03 +0000 (20:02 +0000)]
Use canonical spelling of NetBSD

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

10 years agoclang-check: Unittests doesn't requires tools.
NAKAMURA Takumi [Sun, 26 Jan 2014 12:35:07 +0000 (12:35 +0000)]
clang-check: Unittests doesn't requires tools.

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

10 years agocheck-clang doesn't require neither llvm_src_root nor llvm_obj_root.
NAKAMURA Takumi [Sun, 26 Jan 2014 12:35:00 +0000 (12:35 +0000)]
check-clang doesn't require neither llvm_src_root nor llvm_obj_root.

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

10 years agoRevert r113780, "Recognize .ll as input files. Handle %test_debuginfo on a RUN comman...
NAKAMURA Takumi [Sun, 26 Jan 2014 12:34:54 +0000 (12:34 +0000)]
Revert r113780, "Recognize .ll as input files. Handle %test_debuginfo on a RUN command line."

This feature has been unused anymore.

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

10 years ago[CMake] Always set CMAKE_INCLUDE_CURRENT_DIR.
NAKAMURA Takumi [Sun, 26 Jan 2014 12:34:48 +0000 (12:34 +0000)]
[CMake] Always set CMAKE_INCLUDE_CURRENT_DIR.

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

10 years ago[CMake][Standalone] Introduce check-all.
NAKAMURA Takumi [Sun, 26 Jan 2014 12:34:38 +0000 (12:34 +0000)]
[CMake][Standalone] Introduce check-all.

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

10 years agoFix -Wreturn-type build failure on ASTMatchers, plus an intended assert
Alp Toker [Sun, 26 Jan 2014 08:12:32 +0000 (08:12 +0000)]
Fix -Wreturn-type build failure on ASTMatchers, plus an intended assert

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

10 years agoUpdate docstrings following the param name change in r200132
Alp Toker [Sun, 26 Jan 2014 06:41:58 +0000 (06:41 +0000)]
Update docstrings following the param name change in r200132

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

10 years agoUpdate for llvm api change.
Rafael Espindola [Sun, 26 Jan 2014 06:39:14 +0000 (06:39 +0000)]
Update for llvm api change.

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

10 years ago[CMake] Reindent.
NAKAMURA Takumi [Sun, 26 Jan 2014 06:18:06 +0000 (06:18 +0000)]
[CMake] Reindent.

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

10 years agoEnforce safe usage of DiagnosticsEngine::getCustomDiagID()
Alp Toker [Sun, 26 Jan 2014 06:17:37 +0000 (06:17 +0000)]
Enforce safe usage of DiagnosticsEngine::getCustomDiagID()

Replace the last incorrect uses and templatize the function to require a
compile-time constant string preventing further misuse.

The diagnostic formatter expects well-formed input and has undefined behaviour
with arbitrary input or crafted user strings in source files. Accepting user
input would also have caused unbounded generation of new diagnostic IDs which
can be problematic in long-running sessions or language bindings.

This completes the work to fix several incorrect callers that passed user
input or raw messages to the diagnostics engine where a constant format string
was expected.

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

10 years agoIdentify two more unsafe uses of getCustomDiagID()
Alp Toker [Sun, 26 Jan 2014 05:08:49 +0000 (05:08 +0000)]
Identify two more unsafe uses of getCustomDiagID()

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

10 years agoRemove buggy example code from the documentation
Alp Toker [Sun, 26 Jan 2014 05:08:07 +0000 (05:08 +0000)]
Remove buggy example code from the documentation

Instead point readers to the latest, correct example code in SVN until we find
a way to automatically include example sources into the documentation (or until
someone steps up to maintain these actively).

This ensures that the examples are up-to-date, buildable, and most of all that
readers don't pick up incorrect usage.

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

10 years agoARCMigrate: Introduce proper diagnostics for TransformActions
Alp Toker [Sun, 26 Jan 2014 05:07:32 +0000 (05:07 +0000)]
ARCMigrate: Introduce proper diagnostics for TransformActions

This starts to switch ARCMT to use proper diagnostic messages. The old use was
based on incorrect example code from the documentation.

The logic of the previous report() functions has been retained to support any
external consumers that might be intercepting diagnostic messages through the
old interface.

Note that the change in test/Misc/warning-flags.c isn't a new warning without a
flag, rather one that was previously invisible to the test. Adding a flag might
be a good idea though.

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

10 years agoRemove flawed diagnostic mapping functions
Alp Toker [Sun, 26 Jan 2014 05:07:02 +0000 (05:07 +0000)]
Remove flawed diagnostic mapping functions

These haven't been usable since the early return was accidentally removed some
years ago causing all cases to fall through to the !Enabled condition.

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

10 years agoFor AArch64 Neon, fix intrinsics implementation using nested macros.
Jiangning Liu [Sun, 26 Jan 2014 03:38:42 +0000 (03:38 +0000)]
For AArch64 Neon, fix intrinsics implementation using nested macros.

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

10 years agoRename getResultLoc() too
Alp Toker [Sat, 25 Jan 2014 23:51:36 +0000 (23:51 +0000)]
Rename getResultLoc() too

Follow up to r200082.

Spotted by Dmitri

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

10 years agoPR18530: Don't assert when performing error recovery after a missing 'template<>...
Richard Smith [Sat, 25 Jan 2014 21:32:06 +0000 (21:32 +0000)]
PR18530: Don't assert when performing error recovery after a missing 'template<>' on a variable template explicit specialization.

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

10 years agoPR18283: If a const variable of integral or enumeration type is
Richard Smith [Sat, 25 Jan 2014 20:50:08 +0000 (20:50 +0000)]
PR18283: If a const variable of integral or enumeration type is
initialized from a constant expression in C++98, it can be used in
constant expressions, even if it was brace-initialized. Patch by
Rahul Jain!

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

10 years agounittests: explicit stringify StringRefs for conversion
Saleem Abdulrasool [Sat, 25 Jan 2014 20:04:44 +0000 (20:04 +0000)]
unittests: explicit stringify StringRefs for conversion

When clang is built outside of the LLVM tree (against a corresponding version),
there is no definition providing for operator<<(std::ostream &, StringRef) which
is required for the assertion routines in google-test tests.  Avoid the
compilation failure by explicitly stringifying the StringRef prior to use.

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

10 years agoRemove obsolete ObjCMethodDecl arg_type iterator functions
Alp Toker [Sat, 25 Jan 2014 17:32:04 +0000 (17:32 +0000)]
Remove obsolete ObjCMethodDecl arg_type iterator functions

These were set into deprecation in r199773.

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

10 years agoRename getResultType() on function and method declarations to getReturnType()
Alp Toker [Sat, 25 Jan 2014 16:55:45 +0000 (16:55 +0000)]
Rename getResultType() on function and method declarations to getReturnType()

A return type is the declared or deduced part of the function type specified in
the declaration.

A result type is the (potentially adjusted) type of the value of an expression
that calls the function.

Rule of thumb:

  * Declarations have return types and parameters.
  * Expressions have result types and arguments.

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

10 years ago[Mips] Add support for mips64el-linux-android triple.
Simon Atanasyan [Sat, 25 Jan 2014 16:04:08 +0000 (16:04 +0000)]
[Mips] Add support for mips64el-linux-android triple.

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

10 years ago[Mips] Add test to check translation MIPS triples to cpu and float abi
Simon Atanasyan [Sat, 25 Jan 2014 16:03:59 +0000 (16:03 +0000)]
[Mips] Add test to check translation MIPS triples to cpu and float abi
options.

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

10 years agoPlistSupport: Eliminate duplicated EmitLocation() and EmitRange() functions
Alp Toker [Sat, 25 Jan 2014 14:38:41 +0000 (14:38 +0000)]
PlistSupport: Eliminate duplicated EmitLocation() and EmitRange() functions

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

10 years agoPlistSupport: Unify ARCMigrate / StaticAnalyzer plist writers
Alp Toker [Sat, 25 Jan 2014 11:14:41 +0000 (11:14 +0000)]
PlistSupport: Unify ARCMigrate / StaticAnalyzer plist writers

Reduces the ARCMT migrator plist writer down to a single function,
arcmt::writeARCDiagsToPlist() which shares supporting functions with the
analyzer plist writer.

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

10 years agoclang-format: Fix incorrect space removal.
Daniel Jasper [Sat, 25 Jan 2014 09:16:02 +0000 (09:16 +0000)]
clang-format: Fix incorrect space removal.

Before:
  Deleted &operator=(const Deleted &)&= default;
  Deleted &operator=(const Deleted &)&&= delete;

After:
  Deleted &operator=(const Deleted &)& = default;
  Deleted &operator=(const Deleted &)&& = delete;

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

10 years agoOne more intrinsic.
Eric Christopher [Sat, 25 Jan 2014 01:38:30 +0000 (01:38 +0000)]
One more intrinsic.

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

10 years agoRemove HTML codes from a .rst file. The proper HTML code will be added back
Richard Trieu [Sat, 25 Jan 2014 01:32:39 +0000 (01:32 +0000)]
Remove HTML codes from a .rst file.  The proper HTML code will be added back
when the .html file is generated.

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

10 years agoBroaden -Wstring-conversion to catch string literals in logical or expressions.
Richard Trieu [Sat, 25 Jan 2014 01:10:35 +0000 (01:10 +0000)]
Broaden -Wstring-conversion to catch string literals in logical or expressions.
Previously, string literals were ignored in all logical expressions.  This
reduces it to only ignore in logical and expressions.

assert(0 && "error"); // No warning
assert(0 || "error"); // Warn

Fixes PR17565

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

10 years agoAdd a proper test for -Wsystem-headers
Alp Toker [Sat, 25 Jan 2014 00:32:40 +0000 (00:32 +0000)]
Add a proper test for -Wsystem-headers

This will be extended as we fix issues in the current implementation.

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

10 years agoCorrect < and > to &lt; and &gt;. Thanks to Samuel Harrington for pointing this out!
Richard Smith [Fri, 24 Jan 2014 22:55:47 +0000 (22:55 +0000)]
Correct < and > to &lt; and &gt;. Thanks to Samuel Harrington for pointing this out!

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

10 years agoAllow virt-specifiers after GNU attributes in member-declarators. GCC doesn't
Richard Smith [Fri, 24 Jan 2014 22:34:35 +0000 (22:34 +0000)]
Allow virt-specifiers after GNU attributes in member-declarators. GCC doesn't
allow this, and we should warn on it, but it turns out that people were already
relying on this.

We should introduce a -Wgcc-compat warning for this if the attributes are known
to GCC, but we don't currently track enough information about attributes to do
so reliably.

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

10 years agoAdds a getSemanticSpelling function to semantic attribute subclasses which have a...
Aaron Ballman [Fri, 24 Jan 2014 21:32:49 +0000 (21:32 +0000)]
Adds a getSemanticSpelling function to semantic attribute subclasses which have a meaningful semantic spelling. Adds a sibling function to parsed attribtues (via AttributeList) for getting the semantic spelling, if one were to exist. This can be used for cleaner code that deals directly with the semantic spellings (such as the MSInheritance attribute).

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

10 years agoSince Visual Studio 2012 is the minimum version of MSVC we support, the old-style...
Aaron Ballman [Fri, 24 Jan 2014 19:46:45 +0000 (19:46 +0000)]
Since Visual Studio 2012 is the minimum version of MSVC we support, the old-style visualizers are being removed. Adding a Natvis replacement for the debugging visualizers.

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

10 years agoFixing PR18510 by checking whether the non-virtual base of the derived class
Yunzhong Gao [Fri, 24 Jan 2014 19:28:24 +0000 (19:28 +0000)]
Fixing PR18510 by checking whether the non-virtual base of the derived class
might have a smaller size as compared to the stand-alone type of the base class.
This is possible when the derived class is packed and hence might have smaller
alignment requirement than the base class.

Differential Revision: http://llvm-reviews.chandlerc.com/D2599

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

10 years ago[AArch64] Replace underscores with dashes in -mgeneral_regs_only.
Amara Emerson [Fri, 24 Jan 2014 15:15:27 +0000 (15:15 +0000)]
[AArch64] Replace underscores with dashes in -mgeneral_regs_only.

This should now match the equivalent gcc option.

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

10 years agoAdding a new diagnostics group (-Wattributes) which covers both UnknownAttributes...
Aaron Ballman [Fri, 24 Jan 2014 14:16:23 +0000 (14:16 +0000)]
Adding a new diagnostics group (-Wattributes) which covers both UnknownAttributes and IgnoredAttributes.

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

10 years ago[CMake] libclang: Update GENERATED_HEADERS with actually used.
NAKAMURA Takumi [Fri, 24 Jan 2014 13:40:37 +0000 (13:40 +0000)]
[CMake] libclang: Update GENERATED_HEADERS with actually used.

+  ClangAttrVisitor
+  ClangCommentCommandList

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

10 years agoAdded missing StandardConversionSequence initialization
Ismail Pazarbasi [Fri, 24 Jan 2014 13:16:17 +0000 (13:16 +0000)]
Added missing StandardConversionSequence initialization

This is the second msan failure where UserDefinedConversion does not initialize
its `Before` member as identity conversion.

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

10 years agoAdd missing intrinsics, fix a couple of typos in intrinsic names,
Eric Christopher [Fri, 24 Jan 2014 12:13:47 +0000 (12:13 +0000)]
Add missing intrinsics, fix a couple of typos in intrinsic names,
and remove duplicate declarations.

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

10 years agoCombine the checks for returns_nonnull and for operator new returning null, in Sema...
Artyom Skrobov [Fri, 24 Jan 2014 11:10:39 +0000 (11:10 +0000)]
Combine the checks for returns_nonnull and for operator new returning null, in Sema::CheckReturnValExpr. Add the missing handling of value-dependent expressions for returns_nonnull.

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

10 years agoInitialize StandardConversionSequence correctly
Ismail Pazarbasi [Fri, 24 Jan 2014 10:54:12 +0000 (10:54 +0000)]
Initialize StandardConversionSequence correctly

MSAN detected a path that leaves DeprecatedStringLiteralToCharPtr uninitialized.
UserDefinedConversionSequence::First is a StandardConversionSequence that must
be initialized with setAsIdentityConversion.

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

10 years agoRemove empty directories.
Alexander Kornienko [Fri, 24 Jan 2014 10:20:23 +0000 (10:20 +0000)]
Remove empty directories.

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

10 years agoRemove empty directories.
Alexander Kornienko [Fri, 24 Jan 2014 10:18:17 +0000 (10:18 +0000)]
Remove empty directories.

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