Commit Graph

50717 Commits

Author SHA1 Message Date
Reid Kleckner c0dca6ded7 MS ABI: Implement #pragma vtordisp() and clang-cl /vdN
These features are new in VS 2013 and are necessary in order to layout
std::ostream correctly.  Currently we have an ABI incompatibility when
self-hosting with the 2013 stdlib in our convertible_fwd_ostream wrapper
in gtest.

This change adds another implicit attribute, MSVtorDispAttr, because
implicit attributes are currently the best way to make sure the
information stays on class templates through instantiation.

Reviewers: majnemer

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

llvm-svn: 201274
2014-02-12 23:50:26 +00:00
Hans Wennborg fbf3bb6cf0 Remove FIXME and hardcoded triple from this test (PR18251)
We don't support using the MS ABI with non-x86/x86_64 targets anyway.

llvm-svn: 201260
2014-02-12 21:40:46 +00:00
Benjamin Kramer c6a1a16deb Remove unused diagnostic.
llvm-svn: 201257
2014-02-12 21:25:40 +00:00
Jordan Rose 68db107c81 [examples] Use loadable modules instead of shared libraries for Clang plugins.
This avoids linking in extra copies of, say, LLVMSupport.

llvm-svn: 201256
2014-02-12 21:04:23 +00:00
David Majnemer abecae741c Sema: Restrict alignment to 2**28.
Allowing alignment past this point causes wrap around within clang.

N.B.  GCC has the same restriction.

llvm-svn: 201254
2014-02-12 20:36:10 +00:00
Reid Kleckner f06b266bfa Attributes: Avoid a big useless copy in the emitter
llvm-svn: 201251
2014-02-12 19:26:24 +00:00
Adrian Prantl 375fddcf5c relax testcase and make ppc64 buildbots happy.
llvm-svn: 201250
2014-02-12 19:26:19 +00:00
Dmitri Gribenko ea4d1c32fb libclang: report error code for bad PCH files
This commit improves libclang to report the error condition when
CXTranslationUnit can not be created because of a stale PCH file.  This allows
the caller, for example, to rebuild the PCH file and retry the request.

There two are APIs in libclang that return a CXTranslationUnit and don't
support reporting detailed errors (the only error condition is a NULL result).
For these APIs, a second, superior, version is introduced --
clang_createTranslationUnit2 and clang_parseTranslationUnit2.  These functions
return a CXTranslationUnit indirectly and also return an error code.  Old
functions are still supported and are nothing more than convenience wrappers
that ignore extended error codes.

As a cleanup, this commit also categorizes some libclang errors in the
functions I had to modify anyway.

llvm-svn: 201249
2014-02-12 19:12:37 +00:00
Adrian Prantl 2039d44603 Document and improve the debug-property-synth.m test based on the
information provided in the referenced radar.

llvm-svn: 201248
2014-02-12 18:24:07 +00:00
Adrian Prantl ab340334dc Revert "Remove bad debug info test."
This reverts commit r201183.
The test, albeit undocumented and badly written is still testing something
useful. It will be updated in a subsequent commit.

llvm-svn: 201247
2014-02-12 18:24:04 +00:00
Reid Kleckner f526b94858 Attributes: Emit enumerators in td file declaration order
llvm-svn: 201246
2014-02-12 18:22:18 +00:00
Daniel Sanders abe212a3b8 Revert r201237+r201238: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call
It introduced multiple test failures in the buildbots.

llvm-svn: 201241
2014-02-12 15:39:20 +00:00
Daniel Sanders 2f235aebdb Arcanist failed to commit the two clang test corrections that should have been in r201237.
llvm-svn: 201238
2014-02-12 14:46:15 +00:00
Dmitri Gribenko 371c217b3f libclang: fix a crash in clang_disposeDiagnosticSet when it is passed a NULL argument
llvm-svn: 201236
2014-02-12 14:17:58 +00:00
Tim Northover 26562486ad Whitespace cleanup (mostly stray tabs, a few not-quite-empty lines).
llvm-svn: 201234
2014-02-12 12:56:48 +00:00
Tim Northover 4b76291991 ARM & NEON: add test for r101232
rdar://problem/16035743

llvm-svn: 201233
2014-02-12 12:08:06 +00:00
Tim Northover 3402dc7d52 ARM NEON: fix range checking on immediates.
Previously, range checking on the __builtin_neon_XYZ_v Clang intrinsics didn't
take account of the type actually passed to the call, which meant a request
like "vext_s16(a, b, 7)" was allowed through (TableGen was conservative and
allowed 0-7 for all types). This caused an assert in the backend because the
lane doesn't make sense.

llvm-svn: 201232
2014-02-12 12:04:59 +00:00
Dmitri Gribenko e7f8cba892 Don't use find | xargs in test/Modules/fmodules-validate-once-per-build-session.c
With -fdisable-module-hash, we can implement this with a simple 'cp'.

llvm-svn: 201231
2014-02-12 11:50:37 +00:00
NAKAMURA Takumi 9218e94714 clang/test/Modules/fmodules-validate-once-per-build-session.c: Tweak for gnuwin32 with %/t (instead of %t).
xargs didn't handle dosish paths, while find foo\bar\ emits dosish paths.

llvm-svn: 201228
2014-02-12 11:42:12 +00:00
NAKAMURA Takumi 691e6ef461 clang/lib/Driver/Multilib.cpp: Rewrite normalizePathSegment() to be tolerant dosish pathsep.
FIXME: It could be more simple...
llvm-svn: 201227
2014-02-12 11:42:02 +00:00
Dmitri Gribenko fdd4f30f0e 'svn add' files I forgot for r201224 (Add an option to allow Clang verify
source files for a module only once during)

llvm-svn: 201225
2014-02-12 10:40:07 +00:00
Dmitri Gribenko f430da4de6 Add an option to allow Clang verify source files for a module only once during
the build

When Clang loads the module, it verifies the user source files that the module
was built from.  If any file was changed, the module is rebuilt.  There are two
problems with this:
1. correctness: we don't verify system files (there are too many of them, and
   stat'ing all of them would take a lot of time);
2. performance: the same module file is verified again and again during a
   single build.

This change allows the build system to optimize source file verification.  The
idea is based on the fact that while the project is being built, the source
files don't change.  This allows us to verify the module only once during a
single build session.  The build system passes a flag,
-fbuild-session-timestamp=, to inform Clang of the time when the build started.
The build system also requests to enable this feature by passing
-fmodules-validate-once-per-build-session.  If these flags are not passed, the
behavior is not changed.  When Clang verifies the module the first time, it
writes out a timestamp file.  Then, when Clang loads the module the second
time, it finds a timestamp file, so it can compare the verification timestamp
of the module with the time when the build started.  If the verification
timestamp is too old, the module is verified again, and the timestamp file is
updated.

llvm-svn: 201224
2014-02-12 10:33:14 +00:00
Amara Emerson ecbe18e01d [ARM] Fix NEON wrongly being enabled with soft-float when targeting armv8/Cortex-A53/A57.
This was caused by r200708 which enabled the crypto feature for these cores.

llvm-svn: 201223
2014-02-12 10:22:35 +00:00
Daniel Jasper d90ec5717a Fix memory leak introduced by r201010.
llvm-svn: 201220
2014-02-12 08:45:05 +00:00
Jonathan Roelofs 4c991ef3ef Fix r201205's use-after-free bug caught by sanitizer bot
llvm-svn: 201209
2014-02-12 06:37:27 +00:00
Jonathan Roelofs 2cea1bea87 Add Multilib selection machinery
This patch improves the support for picking Multilibs from gcc installations.
It also provides a better approximation for the flags '-print-multi-directory'
and '-print-multi-lib'.

This reverts r201203 (i.e. re-applying r201202 with small fixes in
unittests/CMakeLists.txtto make the build bots happy).

review: http://llvm-reviews.chandlerc.com/D2538
llvm-svn: 201205
2014-02-12 03:21:20 +00:00
Jonathan Roelofs 3fa96d8378 Revert 201202
Breaks cmake configure of new unit tests directory

llvm-svn: 201203
2014-02-12 01:36:51 +00:00
Jonathan Roelofs 0e7ec60b74 Add Multilib selection machinery
This patch improves the support for picking Multilibs from gcc installations.
It also provides a better approximation for the flags '-print-multi-directory'
and '-print-multi-lib'.

review: http://llvm-reviews.chandlerc.com/D2538
llvm-svn: 201202
2014-02-12 01:29:25 +00:00
David Majnemer 79a1c89066 MS ABI: vptr injection should obey alignment requirements
vptr injection must inject padding equivalent to the alignment of the
most aligned non-virtual subobject, not the alignment of the enclosing
record.

To fascilitate this change, don't let record layout observe the
alignment of the record until we've injected our vptrs. Also, do not
allow the alignment of vbases to affect required alignment until just
before we insert the vtordisp field.

llvm-svn: 201199
2014-02-12 00:43:02 +00:00
Alexander Kornienko 4c27c5b783 Fix build error caused by r201186 (GCC's "declaration of X changes meaning of Y").
llvm-svn: 201189
2014-02-11 22:14:03 +00:00
Alexander Kornienko 4aca9b1cd8 Expose the name of the checker producing each diagnostic message.
Summary:
In clang-tidy we'd like to know the name of the checker producing each
diagnostic message. PathDiagnostic has BugType and Category fields, which are
both arbitrary human-readable strings, but we need to know the exact name of the
checker in the form that can be used in the CheckersControlList option to
enable/disable the specific checker.

This patch adds the CheckName field to the CheckerBase class, and sets it in
the CheckerManager::registerChecker() method, which gets them from the
CheckerRegistry.

Checkers that implement multiple checks have to store the names of each check
in the respective registerXXXChecker method.

Reviewers: jordan_rose, krememek

Reviewed By: jordan_rose

CC: cfe-commits

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

llvm-svn: 201186
2014-02-11 21:49:21 +00:00
David Blaikie e5a3560777 Remove bad debug info test.
Another test that's testing through assembly from Clang which is
problematic. An attempt to upgrade this to just be an IR-generation test
was unsuccessful (I was unable to get this test to fail) but it looks
like there's other, better, test coverage in this area
(test/CodeGenObjC/debuginfo-properties.m) anyway.

llvm-svn: 201183
2014-02-11 21:37:47 +00:00
Sylvestre Ledru a4c779d8d6 update of the clang version (should probably managed in the configure)
llvm-svn: 201182
2014-02-11 21:37:27 +00:00
David Blaikie 68ccb3b6de Remove bad debug info test.
This test case doesn't belong in Clang (it's testing IndVarSimplify) but
in an effort to reproduce the test case this was intended to cover (by
essentially reverting r134441) I wasn't able to reproduce the failure
this test case should've produced. So I haven't ported this down to
LLVM, instead I'm just deleting it.

I suspect the test is just underconstrained, but I've no great interest
in trying hard to fix it right now - if anyone else wants to, I'd be
more than welcome to that.

llvm-svn: 201178
2014-02-11 21:16:44 +00:00
David Majnemer 86c318f496 MS ABI: Add support for the -vm{b,g,s,m,v} flags
These flags control the inheritance model initially used by the
translation unit.

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

llvm-svn: 201175
2014-02-11 21:05:00 +00:00
Jonathan Roelofs 41f4345df0 Test commit -- Remove an extra newline from Toolchains.cpp
llvm-svn: 201172
2014-02-11 20:02:34 +00:00
Argyrios Kyrtzidis 77ed8972fa [Sema] Revert the change in r200622 that allowed integer casts to silence -Wnon-literal-null-conversion in C code.
It is actually useful to warn in such cases, thanks to Dmitri for pushing on this and making us see the light!

Related to rdar://15925483 and rdar://15922612. The latter radar is where the usefulness of the warning is most clear.

llvm-svn: 201165
2014-02-11 17:53:22 +00:00
Jordan Rose c939907a5a 'nonnull(1)' on a block parameter should apply to the block's argument.
Thanks to r199467, __attribute__((nonnull)) (without arguments) can apply
directly to parameters, instead of being applied to the whole function.
However, the old form of nonnull (with an argument index) could also apply
to the arguments of function and block pointers, and both of these can be
passed as parameters.

Now, if 'nonnull' with an argument is found on a parameter, /and/ the
parameter is a function or block pointer, it is handled the old way.

PR18795

llvm-svn: 201162
2014-02-11 17:27:59 +00:00
Dmitri Gribenko 2228cd3f07 Rename some PCH-related errors to have 'err_' as their prefix
llvm-svn: 201157
2014-02-11 15:40:09 +00:00
Dmitri Gribenko 852d622e5e Fix a typo in the function name that I just introduced (r201155)
llvm-svn: 201156
2014-02-11 15:02:48 +00:00
Dmitri Gribenko 256454fdaa libclang: audit all APIs that accept a CXTranslationUnit to make sure that
checks for invalid translation unit are in place.  Also, while there, add log
output for this case.

llvm-svn: 201155
2014-02-11 14:34:14 +00:00
Dmitri Gribenko ceeba78f9e libclang: use namespace qualifiers in the macro, so that it does not require
'using namespace clang::cxindex'.

llvm-svn: 201146
2014-02-11 12:25:31 +00:00
Tim Northover 02b438754c AArch64: share slgihtly more NEON implementation with ARM.
The s64/u64 vcvt conversion operations are actually pretty much identical to
the s32/u32 ones in implementation, and can be shared with just one extra
variable.

llvm-svn: 201145
2014-02-11 11:27:44 +00:00
Robert Lytton 15abd1881f XCore target: add section information.
Xcore target ABI requires const data that is externally visible
to be handled differently if it has C-language linkage rather than
C++ language linkage.

llvm-svn: 201142
2014-02-11 10:34:51 +00:00
Robert Lytton 8e95d4e075 XCore target: Pass through "-fverbose-asm" flag to xcc assembler.
llvm-svn: 201141
2014-02-11 10:34:45 +00:00
Daniel Jasper 1067ab0a1a clang-format: Support lambdas with namespace-qualified return types.
E.g.:
  Foo([]()->std::vector<int> { return { 2 }; }());

llvm-svn: 201139
2014-02-11 10:16:55 +00:00
Daniel Jasper a0407740c3 clang-format: Fix alignment of comments inside statements.
Before:
  auto result = SomeObject
                // Calling someFunction on SomeObject
                    .someFunction();

After:
  auto result = SomeObject
                    // Calling someFunction on SomeObject
                    .someFunction();

llvm-svn: 201138
2014-02-11 10:08:11 +00:00
Oliver Stannard 405bdeddd1 AAPCS: Do not split structs after CPRC allocated on stack
According to the AAPCS, we can split structs between GPRs and the stack,
except for when an argument has already been allocated on the stack. This
can occur when a large number of floating-point arguments fill up the VFP
registers, and are alllocated on the stack before the general-purpose argument
registers are full.

llvm-svn: 201137
2014-02-11 09:25:50 +00:00
Alexey Samsonov c30e0c1728 Fix self-hosted -Werror build: delete comma at the end of enumerator list
llvm-svn: 201135
2014-02-11 08:07:54 +00:00
Ted Kremenek a683f639c7 Fix PCH deserialization bug with local static symbols being treated as local extern.
This triggered a miscompilation of code using Boost's function_template.hpp
when it was included inside a PCH file.  A local static within
that header would be treated as local extern, resulting in the wrong
mangling.  This only occurred during PCH deserialization.

Fixes <rdar://problem/15975816> and <rdar://problem/15926311>.

llvm-svn: 201130
2014-02-11 06:29:29 +00:00
Jordan Rose 8b808d64af [analyzer] Inline C++ operator new when c++-inline-allocators is turned on.
This will let us stage in the modeling of operator new. The -analyzer-config
opton 'c++-inline-allocators' is currently off by default.

Patch by Karthik Bhat!

llvm-svn: 201122
2014-02-11 02:21:06 +00:00
Josh Magee e0fc1a80cb [stackprotector] Add command line option -fstack-protector-strong
This option has the following effects:
 * It adds the sspstrong IR attribute to each function within the CU.
 * It defines the macro __SSP_STRONG__ with the value of 2.

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

llvm-svn: 201120
2014-02-11 01:35:14 +00:00
Ana Pazos 9883d6d2b5 [AArch64] Fixed vget/vset_lane_f16 implementation
Replaced cast and vreinterepret operations with
code to reinterpret bitwise the types float16_t and
int16_t.

llvm-svn: 201112
2014-02-10 21:20:53 +00:00
Richard Smith cc4a72ecd2 Tests for DR351-370, plus update DR status page to match the latest core issue list.
llvm-svn: 201106
2014-02-10 19:53:17 +00:00
David Majnemer 4bb0980d96 MS ABI: Add support for #pragma pointers_to_members
Introduce a notion of a 'current representation method' for
pointers-to-members.

When starting out, this is set to 'best case' (representation method is
chosen by examining the class, selecting the smallest representation
that would work given the class definition or lack thereof).

This pragma allows the translation unit to dictate exactly what
representation to use, similar to how the inheritance model keywords
operate.

N.B.  PCH support is forthcoming.

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

llvm-svn: 201105
2014-02-10 19:50:15 +00:00
David Majnemer 8896981056 Basic: Clean up malformed pragma diagnostics
Create a new diagnostic, -Wignored-pragmas and use it to handle any
case where a pragma would have a side effect but is ignored.

llvm-svn: 201102
2014-02-10 19:06:37 +00:00
Richard Smith 36be8d8306 PR18777: This PR is already fixed; add regtest.
llvm-svn: 201100
2014-02-10 17:21:40 +00:00
David Majnemer cfb40600e9 Sema: Remove useless MSStructPragmaOn update in Sema::~Sema
No functional change, this code was just superfluous.

llvm-svn: 201099
2014-02-10 17:17:03 +00:00
Tim Northover d23fc6cceb ARM: move vshll NEON implementation to common code
Now that both ARM backends use the same implementation for vshll operations,
the code can be shared. This is also a necessary LLVM/Clang interface update.

llvm-svn: 201094
2014-02-10 16:20:36 +00:00
Tim Northover a2e0a27d26 ARM: implement vshrn NEON intrinsic in terms of shr/trunc
Now the backend supports the natural LLVM IR, we can shamelessly steal the
AArch64 front-end code to implement the vshrn intrinsic on 32-bit ARM.

llvm-svn: 201086
2014-02-10 14:04:12 +00:00
Dmitri Gribenko b41e7e2c92 ASTUnit: simplify remapping files by using the exact same logic in Preprocessor
llvm-svn: 201082
2014-02-10 12:31:34 +00:00
NAKAMURA Takumi 3686e38c3d Fix Clang install rules to not set permissions on include/
The CMake install(DIRECTORY) command documents that it sets permissions
on directories it is asked to install.  Since the <prefix>/include
directory may not be exclusive to the LLVM/Clang installation, we should
not ask CMake to manage permissions of that directory for us.  Instead,
give only our own include/clang and include/clang-c subdirectories to
the install(DIRECTORY) command.

Fixes PR4500. Patch by Brad King.

llvm-svn: 201076
2014-02-10 10:51:09 +00:00
NAKAMURA Takumi eb961a3075 [CMake] add_clang_library(): Use llvm_add_library.
CMAKE_MODULE_LINKER_FLAGS can be removed since llvm_add_library(MODULE) adds same flags to MODULE.

llvm-svn: 201073
2014-02-10 09:05:28 +00:00
Kaelyn Uhrain 0e35355c04 PR18685: Ignore class template specializations as potential
nested-name-specifiers for typos unless the typo already has
a nested-name-specifier that is a template specialization.

llvm-svn: 201056
2014-02-09 21:47:04 +00:00
Argyrios Kyrtzidis 4a4d2b4175 [libclang] While visiting a C++ destructor decl, keep the type identifier associated with the decl,
don't turn it into a type ref.

rdar://15907618

llvm-svn: 201042
2014-02-09 08:13:47 +00:00
David Blaikie 080a61c21b Clarify comment. Remove braces from single-statement block.
llvm-svn: 201040
2014-02-09 07:24:41 +00:00
David Blaikie 6cab596218 Improve diagnostic for using non-class/namespace/scoped enum in a nested name specifier.
Rather than simply saying "X is not a class or namespace", clarify what
X is by providing the aka type in the case where X is a type, or
pointing to the named declaration if there's an unambiguous one to refer
to. In the ambiguous case, the ambiguities are already enumerated
(though could be clarified by describing what kind of entities they are)

Included a few FIXMEs in tests where some further improvements could be
made.

llvm-svn: 201038
2014-02-09 06:54:23 +00:00
David Majnemer 158ba130ee Preprocessor: Add __ALIGNOF_MAX_ALIGN_T__
TargetInfo::getSuitableAlign() was introduced in r146762 and is defined
as alignof(std::max_align_t).

Introduce __ALIGNOF_MAX_ALIGN_T__ which exposes getSuitableAlign() so
that libc++ may take advantage of it.

llvm-svn: 201037
2014-02-09 05:30:48 +00:00
Richard Smith 6056d5e918 PR16519, PR18009: When checking a partial specialization for uses of its own
template parameters, don't look for parameters of outer templates. If a problem
is found in a default template argument, point the diagnostic at the partial
specialization (with a note pointing at the default argument) instead of
pointing it at the default argument and leaving it unclear which partial
specialization os problematic.

llvm-svn: 201031
2014-02-09 00:54:43 +00:00
John McCall 57420b320c type_info objects are not unnamed_addr: the ABI requires us to
unique them and permits the implementation of dynamic_cast (and
anything else which knows it's working with a complete class
type) to compare their addresses directly.

rdar://16005328

llvm-svn: 201020
2014-02-08 03:26:05 +00:00
Reid Kleckner 42063b0b1c Move the -fms-compatibility using decl check after real access checking
Summary:
This avoids false positives from -Wmicrosoft when name lookup would
normally succeed in standard C++.  This triggered on a common CRTP
pattern in clang, where a derived class would have a private using decl
to pull in members of a dependent base:

class Verifier : InstVisitor<Verifier> {
private:
  using InstVisitor<Verifier>::visit;
  ...
  void anything() {
    visit(); // warned here
  }
};

Real access checks pass here because we're in the context of the
Verifier, but the -Wmicrosoft extension was just looking for the private
access specifier.

Reviewers: rsmith

CC: cfe-commits

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

llvm-svn: 201019
2014-02-08 02:40:20 +00:00
Richard Smith 04d6d2f2af PR18581: Attempt to complete the type in a VLA declaration before checking
whether it's POD.

llvm-svn: 201018
2014-02-08 02:30:49 +00:00
Reid Kleckner 18066822a8 clang-cl: Alias /Zi and /Z7 to -gline-tables-only
LLVM only knows how to emit Z7-style line tables on -win32, so there's
no reason for clang to emit anything other than line info.

llvm-svn: 201017
2014-02-08 01:43:16 +00:00
Reid Kleckner e253b098d3 MS ABI: Use the most recent decl to check the inheritance model
This was crashing compilation of DeclContext::buildLookupImpl<>.

llvm-svn: 201013
2014-02-08 01:15:37 +00:00
Richard Smith f8b417c5ef Fix lifetime issue causing buildbot failures.
llvm-svn: 201012
2014-02-08 00:42:45 +00:00
John McCall 8f80a61914 Remove the -fhidden-weak-vtables -cc1 option. It was dead,
gross, and increasingly replaced through other mechanisms.

llvm-svn: 201011
2014-02-08 00:41:16 +00:00
Dmitri Gribenko c444b57790 ASTUnit: remove dead code in remapping files
ASTUnit contains code to remap files to other files on disk.  This code is not
used.  We only remap files to MemoryBuffers.

llvm-svn: 201010
2014-02-08 00:38:15 +00:00
Jordan Rose 4393aa7efb [analyzer] Objective-C object literals are always non-nil.
<rdar://problem/15999214>

llvm-svn: 201007
2014-02-08 00:04:14 +00:00
Richard Smith c7fb225cdc PR16638, DR1552: the exception specification on an implicitly-declared
'operator delete' or 'operator delete[]' is an explicit exception
specification. Therefore we should diagnose 'void operator delete(void*)'
instead of 'void operator delete(void*) noexcept'.

This diagnostic remains an ExtWarn, since in practice people don't always
include the exception specification in such a declaration.

llvm-svn: 201002
2014-02-07 22:51:16 +00:00
Richard Smith c015bc2595 Fold together two repeated identical 'if's.
llvm-svn: 201000
2014-02-07 22:39:53 +00:00
Ben Langmuir a16a001b72 Fix test from r200979 on Windows
Hopefully the last tweak needed to get this test working everywhere.

Remove matching of the prefix of sys_header.h, which was never the point
of the test anyway.  This avoids dealing with path separators.

llvm-svn: 200987
2014-02-07 19:39:50 +00:00
Fariborz Jahanian 7395c79c4e Objective-C. Revert patch r193003 for further
internal discussions. // rdar://16006401

llvm-svn: 200986
2014-02-07 19:25:10 +00:00
Ben Langmuir 7985adf5e6 Fix test from r200979 on non-Darwin systems
Add a darwin triple to get the behaviour from isysroot that the test
expects.

llvm-svn: 200982
2014-02-07 17:56:29 +00:00
Jordan Rose c7d0acaf34 [analyzer] Just silence all warnings coming out of std::basic_string.
This means always walking the whole call stack for the end path node, but
we'll assume that's always fairly tractable.

<rdar://problem/15952973>

llvm-svn: 200980
2014-02-07 17:35:04 +00:00
Ben Langmuir 3d4417c7fd Stat system dependencies when using -verify-pch
We don't stat the system headers to check for stalenes during regular
PCH loading for performance reasons.  When explicitly saying
-verify-pch, we want to check all the dependencies - user or system.

llvm-svn: 200979
2014-02-07 17:31:11 +00:00
Dmitri Gribenko 2febd212d3 ASTUnit: ArrayRef'ize RemappedFiles
llvm-svn: 200975
2014-02-07 15:00:22 +00:00
Daniel Jasper 649899685b clang-format: Fix column limit violation for merged lines in macros.
Before (81 columns):
  #define A                                                                       \
    void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() { return aaaaaaaa; } \
    int i;

After:
  #define A                                                    \
    void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() { \
      return aaaaaaaa;                                         \
    }                                                          \
    int i;

llvm-svn: 200974
2014-02-07 13:45:27 +00:00
Oliver Stannard 5e8558fce0 Fix AAPCS compliance for HFAs containing doubles and long doubles
An HFA is defined as a struct containing floating point values of the
same machine type. In the 32-bit ABI, double and long double have the
same machine type, so a struct with a mixture of these types must be an
HFA (assuming it meets the other criteria).

llvm-svn: 200971
2014-02-07 11:25:57 +00:00
Daniel Jasper 9cc3e97685 clang-format: Fix range-based for-loop formatting.
Before:
  for (aaaaaaaaa aaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaa.aaaaaaaaaaaa()
           .aaaaaaaaa()
           .a()) {
  }

After:
  for (aaaaaaaaa aaaaaaaaaaaaaaaaaaaaa :
       aaaaaaaaaaaa.aaaaaaaaaaaa().aaaaaaaaa().a()) {
  }

llvm-svn: 200968
2014-02-07 10:09:46 +00:00
Dmitri Gribenko 97b711a23f Document return value for FileManager::getNoncachedStatValue()
llvm-svn: 200967
2014-02-07 09:31:00 +00:00
Argyrios Kyrtzidis 25f2afdee0 Revert r194097: "With this patch -Wwrite-strings is still implemented with the terrible
hack of passing -fconst-strings to -cc1"

Passing or not a language option based on diagnostic settings is a bad idea, it breaks
using a PCH that was compiled with different diagnostic settings.

Also add a test case to make sure we don't regress.

llvm-svn: 200964
2014-02-07 08:33:28 +00:00
David Majnemer 98c9ee2068 MS ABI: Don't be so hasty to judge an inheritance model
If we are in the middle of defining the class, don't attempt to
validate previously annotated declarations.  We may not have seen base
specifiers or virtual method declarations yet.

llvm-svn: 200959
2014-02-07 00:43:07 +00:00
Richard Smith c941ba9047 Temporary fix for PR18473: Don't try to evaluate the initializer for a
type-dependent variable, even if the initializer isn't value-dependent. This
happens for ParenListExprs composed of non-value-dependent subexpressions, for
instance.

We should really give ParenListExprs (and InitListExprs) the type of the
initialized entity if they're used to represent a dependent initialization (and
if so, set them to be type-, value- and instantiation-dependent).

llvm-svn: 200954
2014-02-06 23:35:16 +00:00
Richard Trieu 6d92e50263 Fixes PR18762, stop the StmtPrinter for ObjCPropertyRefExpr from crashing on
certain receiver types.

llvm-svn: 200953
2014-02-06 23:26:23 +00:00
Peter Collingbourne 1fec3dfe43 Add isListInitialization matcher.
Differential Revision: http://llvm-reviews.chandlerc.com/D2708

llvm-svn: 200949
2014-02-06 21:52:24 +00:00
Richard Smith 3d584b0ced PR18128: a lambda capture-default is not permitted for a non-local lambda
expression.

llvm-svn: 200948
2014-02-06 21:49:08 +00:00
Joerg Sonnenberger 83a33c0cd7 Use correct ld emulation for EABI hardware float triple on NetBSD.
llvm-svn: 200946
2014-02-06 21:04:32 +00:00
James Dennett 2220dfadda Fix indentation of a code example in LibTooling's documentation.
llvm-svn: 200944
2014-02-06 20:16:05 +00:00
David Majnemer 34f219ece6 Silence build-bots from the fallout of r200921
llvm-svn: 200940
2014-02-06 19:14:16 +00:00
Ben Langmuir 9b9a8d330c Move -verify-pch to use VerifyJobAction
Use the verify hook rather than the compile hook to represent the
-verify-pch action, and move the exising --verify-debug-info action
into its own subclass of VerifyJobAction.  Incidentally change the name
printed by -ccc-print-phases for --verify-debug-info.

llvm-svn: 200938
2014-02-06 18:53:25 +00:00
Quentin Colombet 728c5540ee Wired-up the new LLVM diagnostic system into clang diagnostic system.
The approach is similar to the existing inline-asm reporting, just more
general.

<rdar://problem/15886278>

llvm-svn: 200931
2014-02-06 18:30:43 +00:00
David Majnemer 1e378e428b MS ABI: Handle indirect field decls in template args
Properly support fields that come from anonymous unions and structs
when used as template arguments for pointer to data member params.

llvm-svn: 200921
2014-02-06 12:46:52 +00:00
David Majnemer 763584dc64 MS ABI: Tweak pointer-to-member mangling/inheritance model selection
Properly determine the inheritance model when dealing with nullptr:
- If a nullptr template argument is being checked against
  pointer-to-member parameter, nail down an inheritance model.
  N.B. We will chose an inheritance model even if we won't ultimately
  choose the template to instantiate!  Cooky, right?
- Null pointer-to-datamembers have a virtual base table offset of -1,
  not zero. Previously, we chose an offset of 0.

llvm-svn: 200920
2014-02-06 10:59:19 +00:00
NAKAMURA Takumi 0c81c716eb check-clang: Introduce the feature "utf8-capable-terminal".
clang/test/FixIt/fixit-unicode-with-utf8-output.c has begun complained since LLVM r200885.
Although it is changes for StringRef, it brought LLVM_ON_WIN32 to Support/Locale.cpp.

Before r200885, LLVM_ON_WIN32 was undefined in Locale.cpp!

FIXME: We should consider i18n on win32.
llvm-svn: 200909
2014-02-06 07:15:59 +00:00
Serge Pavlov 774c6d03b2 Allow transformation of VariableArray to ConstantArray.
In the following code:

    struct A { static const int sz; };
    template<class T> void f() { T arr[A::sz]; }

the array 'arr' is represented as a variable size array in the template.
If 'A::sz' gets value below in the translation unit, the array in
instantiation can turn into constant size array.

This change fixes PR18633.

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

llvm-svn: 200899
2014-02-06 03:49:11 +00:00
Richard Smith 18819307d3 DR101, PR12770: If a function is declared in the same context as a
using-declaration, and they declare the same function (either because
the using-declaration is in the same namespace as the declaration it
imports, or because they're both extern "C"), they do not conflict.

llvm-svn: 200897
2014-02-06 01:31:33 +00:00
Manman Ren 9724752f4b Simplify code by combining ifs.
llvm-svn: 200893
2014-02-06 00:08:15 +00:00
Manman Ren f9e58778bc Fix Werror introduced at r200874.
llvm-svn: 200891
2014-02-06 00:03:20 +00:00
Nick Lewycky 1f529663bb Fix -Wunused-variable 'FD' by using it instead of ND when they're equal but FD
has a more precise type.

llvm-svn: 200889
2014-02-05 23:53:29 +00:00
Ben Langmuir 2cb4a78f93 Add a CC1 option -verify-pch
This option will:
- load the given pch file
- verify it is not out of date by stat'ing dependencies, and
- return 0 on success and non-zero on error

llvm-svn: 200884
2014-02-05 22:21:15 +00:00
Manman Ren 215893317b Try to fix ppc bot failure.
llvm-svn: 200880
2014-02-05 21:40:10 +00:00
Benjamin Kramer c24767b4ad Clean up some particularly ugly casting.
No functionality change.

llvm-svn: 200877
2014-02-05 21:29:05 +00:00
Alexander Kornienko 4fa81df455 Changed OptionCategory variables to be static.
llvm-svn: 200876
2014-02-05 21:28:03 +00:00
Manman Ren 67a28136ad PGO: instrumentation based profiling sets function attributes.
We collect a maximal function count among all functions in the pgo data file.
For functions that are hot, we set its InlineHint attribute. For functions that
are cold, we set its Cold attribute.

We currently treat functions with >= 30% of the maximal function count as hot
and functions with <= 1% of the maximal function count are treated as cold.
These two numbers are from preliminary tuning on SPEC.

This commit should not affect non-PGO builds and should boost performance on
instrumentation based PGO.

llvm-svn: 200874
2014-02-05 20:40:15 +00:00
Reid Kleckner 09b47d166b MS ABI: Fix mangling of static methods and function references
Function references always use $1? like function pointers and never $E?
like var decl references.  Static methods are mangled like function
pointers.

llvm-svn: 200869
2014-02-05 18:59:38 +00:00
Kaelyn Uhrain 21a6617c34 Don't consider records with a NULL identifier as a name for typo correction.
Because in C++, "anonymous" doesn't mean "nameless" for records. In
other words, RecordDecl::isAnonymousStructOrUnion only returns true if
the record lacks a name *and* is not used as the type in an object's
declaration.

llvm-svn: 200868
2014-02-05 18:57:51 +00:00
Rafael Espindola c32818ac9b Update for llvm api change.
llvm-svn: 200863
2014-02-05 18:00:26 +00:00
Reid Kleckner 29d5999eb7 Remove unused variable to fix -Werror build
llvm-svn: 200861
2014-02-05 18:00:01 +00:00
Reid Kleckner 96f8f9339d MS ABI: Mangle member pointer template arguments
Member pointers are mangled as they would be represented at runtime.
They can be a single integer literal, single decl, or a tuple with some
more numbers tossed in.  With Clang today, most of those numbers will be
zero because we reject pointers to members of virtual bases.

This change required moving VTableContextBase ownership from
CodeGenVTables to ASTContext, because mangling now depends on vtable
layout.

I also hoisted the inheritance model helpers up to be inline static
methods of MSInheritanceAttr.  This makes the AST code that deals with
member pointers much more readable.

MSVC doesn't appear to have stable manglings of null member pointers:
- Null data memptrs in function templates have a mangling collision with
  the first field of a non-polymorphic single inheritance class.
- The mangling of null data memptrs changes if you add casts.
- Large null function memptrs in class templates crash MSVC.

Clang uses the class template mangling for null data memptrs and the
function template mangling for null function memptrs to deal with this.

Reviewers: majnemer

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

llvm-svn: 200857
2014-02-05 17:27:08 +00:00
Fariborz Jahanian 48f9ab2d54 Objective-C driver. Do not use legacy dispatch for
10.5 or less for x86_64 arch. // rdar://15852259

llvm-svn: 200854
2014-02-05 17:13:42 +00:00
Alexander Kornienko 9b539e1dd9 Added the hasLoopVariable sub-matcher for forRangeStmt.
Summary:
This sub-matcher makes it possible to access directly the range-based for
loop variable: forRangeStmt(hasLoopVariable(anything()).bind(...)).
I've tried to re-generate the docs, but the diffs seem to include much more than
this change could cause, so I'd better leave docs update to someone who knows
the intended changes in the contents better.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits, klimek

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

llvm-svn: 200850
2014-02-05 16:35:08 +00:00
Joey Gouly 18730ba4ab Fix the range for Malayam UCNs in C99.
llvm-svn: 200845
2014-02-05 15:32:23 +00:00
Daniel Jasper 0c214fa2e3 clang-format: Don't indent relative to unary operators.
It seems like most people see unary operators more like part of the
subsequent identifier and find relative indentation odd.

Before:
  aaaaaaaaaa(!aaaaaaaaaa( // break
                  aaaaa));
After:
  aaaaaaaaaa(!aaaaaaaaaa( // break
                 aaaaa));

llvm-svn: 200840
2014-02-05 13:43:04 +00:00
Alexander Kornienko 3bb8fbfa3e Make the OptionCategory variable static.
llvm-svn: 200839
2014-02-05 13:42:43 +00:00
Jordan Rose 749b581272 Fix typo in CastExpr::getCastKindName.
Patch by Mathieu Baudet!

llvm-svn: 200817
2014-02-05 03:49:45 +00:00
Hans Wennborg 39a509aa70 Don't mark decls with mismatching exception specs invalid in MS mode (PR18683)
We accept these with a warning in MS mode, but we would previously mark them
invalid, causing us not to emit code for them.

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

llvm-svn: 200815
2014-02-05 02:37:58 +00:00
John McCall 9b595db16d Tighten lax vector-conversion rules and enforce them consistently.
When a lax conversion featured a vector and a non-vector, we were
only requiring the non-vector to be a scalar type, but really it
needs to be a real type (i.e. integral or real floating); it is
not reasonable to allow a pointer, member pointer, or complex
type here.

r198474 required lax conversions to match in "data size", i.e.
element size * element count, forbidding matches that happen
only because a vector is rounded up to the nearest power of two
in size.  Unfortunately, the erroneous logic was repeated in
several different places; unify them to use the new condition,
so that it triggers for arbitrary conversions and not just
those performed as part of binary operator checking.

rdar://15931426

llvm-svn: 200810
2014-02-04 23:58:19 +00:00
David Blaikie 535083efc9 Further simplify r200797 and add an explanatory comment.
llvm-svn: 200805
2014-02-04 23:46:16 +00:00
Adrian Prantl ade48ed6a0 Simplify testcase from r200797 some more.
llvm-svn: 200798
2014-02-04 21:50:56 +00:00
Adrian Prantl 381e75589d Debug info: fix a crasher when when emitting debug info for
not-yet-completed templated types. getTypeSize() needs a complete type.

rdar://problem/15931354

llvm-svn: 200797
2014-02-04 21:29:50 +00:00
Justin Bogner d554a8eb91 Clean up whitespace checks
In TokenLexer::ExpandFunctionArguments(), CurTok.hasLeadingSpace() is
checked in multiple locations, each time subtly differently. Checking it
early, when the token is seen, and using NextTokGetsSpace exclusively
after that makes the code simpler.

No change in behaviour is intended.

Patch by Harald van Dijk!

llvm-svn: 200788
2014-02-04 19:18:37 +00:00
Justin Bogner 79c93845f6 Fix whitespace handling in empty macro expansions
When a macro expansion does not result in any tokens, and the macro name
is preceded by whitespace, the whitespace should be passed to the first
token that follows the macro expansion. Similarly when a macro expansion
ends with a placemarker token, and that placemarker token is preceded by
whitespace. This worked already for top-level macro expansions, but is
now extended to also work for nested macro expansions.

Patch by Harald van Dijk!

llvm-svn: 200787
2014-02-04 19:18:35 +00:00
Justin Bogner eacd96d972 Fix whitespace handling in empty macro arguments
When a function-like macro definition ends with one of the macro's
parameters, and the argument is empty, any whitespace before the
parameter name in the macro definition needs to be preserved. Promoting
the existing NextTokGetsSpace to a preserved bit-field and checking it
at the end of the macro expansion allows it to be moved to the first
token following the macro expansion result.

Patch by Harald van Dijk!

llvm-svn: 200786
2014-02-04 19:18:32 +00:00
Justin Bogner 502155aff9 Fix whitespace handling in ## operator
In x ## y, where x and y are regular tokens, whitespace between x and ##
is ignored, and whitespace between ## and y is also ignored. When either
x or y is a function argument, whitespace was preserved, but it should
not be. This patch removes the checks for whitespace before ## and
before y, and in the special case where x is an empty macro argument and
y is a regular token, actively removes whitespace before y.

One existing test is affected by that change, but as clang's output now
matches the standard's requirements and that of GCC, I've tweaked the
testcase.

Patch by Harald van Dijk!

llvm-svn: 200785
2014-02-04 19:18:28 +00:00
Tim Northover 7ffb2c5523 ARM & AArch64: combine implementation of vcaXYZ intrinsics
Now that the back-end intrinsics are more regular, there's no need for the
special handling these got in the front-end, so they can be moved to
EmitCommonNeonBuiltinExpr.

llvm-svn: 200769
2014-02-04 14:55:52 +00:00
NAKAMURA Takumi da94d8a72e [CMake] add_clang_library(): Fix LLVM_PLUGIN_EXT in MODULE. It was broken since my r199902.
llvm-svn: 200760
2014-02-04 12:26:48 +00:00
NAKAMURA Takumi 75ab7f9b88 [CMake] add_clang_library(): Honor STATIC.
llvm-svn: 200759
2014-02-04 12:26:40 +00:00
Richard Smith bdd146435f Add implicit declarations of allocation functions when looking them up for
redeclaration, not just when looking them up for a use -- we need the implicit
declaration to appropriately check various properties of them (notably, whether
they're deleted).

llvm-svn: 200729
2014-02-04 01:14:30 +00:00
Richard Smith 5ef98f7288 Tidy up and reduce some comment redundancy.
llvm-svn: 200723
2014-02-03 23:22:05 +00:00
David Blaikie 9d3640836d DebugInfo: Fix for an improvement to DIBuilder to not emit {i32 0} for zero-length arrays.
llvm-svn: 200722
2014-02-03 23:08:59 +00:00
Reid Kleckner 0133e780a4 Fix a -Wmicrosoft warning about an unrepresentable enum value
In MSVC, enums are always signed unless you explicitly specify the type.

llvm-svn: 200719
2014-02-03 22:20:34 +00:00
Reid Kleckner c50b4bfc1c Fix a -Wformat warning in ASTUnit.cpp
llvm::sys::cas_flag is 'long' instead of 'uint32_t' on win32, because
that's what InterlockedIncrement is defined to accept.

I still don't know if we should be calling fprintf from ASTUnit.cpp
behind a getenv check.

llvm-svn: 200718
2014-02-03 22:20:24 +00:00
Richard Smith d7d11ef5c1 PR17846, PR17848: don't build a VarTemplateSpecializationDecl for a use of a
variable template until we know what the template arguments actually are.

llvm-svn: 200714
2014-02-03 20:09:56 +00:00
Reid Kleckner b78257d0c1 [ms-cxxabi] Fix cast when structor replacement is an alias
llvm-svn: 200711
2014-02-03 18:54:51 +00:00
Alexander Kornienko 7a712cea71 Allow specifying a custom PathDiagnosticConsumer for use with the static analyzer.
Summary:
Make objects returned by CreateAnalysisConsumer expose an interface,
that allows providing a custom PathDiagnosticConsumer, so that users can have
raw data in a form easily usable from the code (unlike plist/HTML in a file).

Reviewers: jordan_rose, krememek

CC: cfe-commits

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

llvm-svn: 200710
2014-02-03 18:37:50 +00:00
Joerg Sonnenberger d5e2f094d4 Test cases for NetBSD/eARM
llvm-svn: 200709
2014-02-03 17:46:52 +00:00
Tim Northover 02e38609e7 ARM: implement support for crypto intrinsics in arm_neon.h
llvm-svn: 200708
2014-02-03 17:28:04 +00:00
Tim Northover 51ab388266 AArch64: use new non-polymorphic crypto intrinsics
The LLVM backend now has invariant types on the various crypto-intrinsics,
because in all cases there's only really one interpretation.

llvm-svn: 200707
2014-02-03 17:28:00 +00:00
Evgeniy Stepanov 9e7cb33b17 Fix handling of -fno-function-sections, -fno-data-sections in clang driver.
llvm-svn: 200685
2014-02-03 11:11:37 +00:00
Richard Smith 2eaf206455 Fix typo 'uusal'.
llvm-svn: 200681
2014-02-03 07:04:10 +00:00
Richard Smith 5e34db94bb Fix typo in CSS class name.
llvm-svn: 200680
2014-02-03 07:02:19 +00:00
Richard Smith 7fe896251d Clang 3.4 was released, make the boxes green.
llvm-svn: 200679
2014-02-03 06:58:08 +00:00
Richard Smith c94410bc8d Tests for DR331-350.
llvm-svn: 200678
2014-02-03 06:34:23 +00:00
Richard Smith 209bbb7774 Update C++ DR page now 3.4 has been released.
llvm-svn: 200674
2014-02-03 02:40:25 +00:00
Richard Smith 91dfaacd38 Implement DR329. We already did the right thing here in C++98 mode, but r104014
(which implemented the DR) was disabled in C++11.

llvm-svn: 200673
2014-02-03 02:37:59 +00:00
Richard Smith 9f38709193 Tests for DR321-330.
llvm-svn: 200672
2014-02-03 02:13:49 +00:00
Richard Smith 6938adbd16 Tests for DR301-320.
llvm-svn: 200671
2014-02-03 01:23:27 +00:00
David Majnemer 04606bda08 MS ABI: Fix some layout tests
Some lines intended to be used for testing x86_64 ABI compatibility were
not firing because lines were annotated with the wrong FileCheck prefix:
X64 vs x64

N.B. Changes beyond just changing x64 to X64 were made, presumably
because other parts of the layout engine have changed.  I've verified
the changes to make sure that MSVC creates a compatible layout.

llvm-svn: 200670
2014-02-03 00:29:57 +00:00
Joerg Sonnenberger e7f9759fd9 Handle O32/N64 ABIs for NetBSD/MIPS64. From Matt Thomas.
llvm-svn: 200668
2014-02-02 22:59:16 +00:00
Joerg Sonnenberger d68c650489 Replace hasMipsN32ABIArg with hasMipsABIArg in preparation of o32/n64
support.

llvm-svn: 200667
2014-02-02 22:54:18 +00:00
Joerg Sonnenberger 6cd7deb9fe Use a switch for the emulation handling.
llvm-svn: 200666
2014-02-02 22:50:34 +00:00
Joerg Sonnenberger 25de31d472 Handle compat support for EABI/old APCS compatibility on NetBSD/ARM.
llvm-svn: 200665
2014-02-02 22:47:37 +00:00
Joerg Sonnenberger d11c478ac3 Replace hasMipsN32ABIArg by hasMipsABIArg to make it easier to add
support for o32 and n64.

llvm-svn: 200662
2014-02-02 22:40:33 +00:00
Joerg Sonnenberger dc7a23c660 Pass down -mcpu for external assembler in thumb mode, too. From Matt Thomas.
llvm-svn: 200661
2014-02-02 22:37:14 +00:00
Joerg Sonnenberger 1e205ef7cf Minor formatting improvement.
llvm-svn: 200659
2014-02-02 22:36:13 +00:00
Joerg Sonnenberger ec39cc6165 Test pre-defined macros of aarch64-netbsd.
llvm-svn: 200656
2014-02-02 21:55:32 +00:00
Joerg Sonnenberger 9864bd5858 NetBSD uses signed wchar_t on AArch64. It also wants __LITTLE_ENDIAN__ /
__BIG_ENDIAN__ as on other architectures.

llvm-svn: 200655
2014-02-02 21:55:10 +00:00
Nico Weber 514ecc8ce8 clang-format: Let chromium style inherit google style's javascript tweaks.
llvm-svn: 200652
2014-02-02 20:50:45 +00:00
NAKAMURA Takumi 85d65ff49b [CMake] Move cmake_minimum_required(2.8.8) at the top.
Suggested by Stephen Kelly.

llvm-svn: 200645
2014-02-02 16:59:36 +00:00
NAKAMURA Takumi 6b13975d40 clang/CMakeLists.txt: Untabify.
llvm-svn: 200643
2014-02-02 16:46:07 +00:00
NAKAMURA Takumi 549d510c0b clang/lib/ASTMatchers/Dynamic/CMakeLists.txt: redundant
llvm-svn: 200642
2014-02-02 16:46:03 +00:00
Benjamin Kramer 35e6fee3e9 Sema: Reject templates in all extern "C" contexts.
Otherwise we'd accept them if the LinkageDecl was not the direct
parent DeclContext. PR17968.

llvm-svn: 200641
2014-02-02 16:35:43 +00:00
Benjamin Kramer 3a7cc81d52 Report a correct end location for nameless parameters.
Ranges before:
void test(void (*)(int), int, float);
          ~~~~~~~~~~~~~  ~~~~ ~~~~~~

Ranges after:
void test(void (*)(int), int, float);
          ~~~~~~~~~~~~~  ~~~  ~~~~~

This does not change the actual location of the ParmVarDecl, it still
points to the location where the name would be. PR17970.

llvm-svn: 200640
2014-02-02 15:28:46 +00:00
Evgeniy Stepanov 78901bd09e Revert r200555, r200545.
These changes make it impossible to use ARM EHABI for stack unwinding without
enabling exceptions and break AddressSanitizer on ARM.

llvm-svn: 200627
2014-02-02 10:39:45 +00:00
Argyrios Kyrtzidis 3e3305daba [Sema] Follow-up on r200521 for the -Wnon-literal-null-conversion warning and revert its behavior for C++.
llvm-svn: 200622
2014-02-02 05:26:43 +00:00
Bob Wilson 5cfc55e49f Fix an assertion failure when building for the iOS simulator. rdar://15959009
When building for i386 or x86_64 with IPHONEOS_DEPLOYMENT_TARGET set in the
environment, the toolchain correctly recognizes that the target platform is
the iOS simulator. The code in Darwin::addMinVersionArgs was not updated for
svn 197148, where isTargetIPhoneOS() was widely replaced by isTargetIOSBased().
This is kind of a strange case, though, because we probably ought to be
passing -ios_simulator_version_min to the linker, but according to the FIXME
in the code, we intentionally avoid that unless the -mios-simulator-version-min
option was used. I don't know whether it is safe to change that yet, so
for now, I am just fixing the assertion failure.

llvm-svn: 200618
2014-02-01 21:06:21 +00:00
Reid Kleckner 8ae1627733 Remove local type use in template.
llvm-svn: 200598
2014-02-01 00:23:22 +00:00
Reid Kleckner 314ef7bafd [ms-cxxabi] Use inalloca on win32 when passing non-trivial C++ objects
When a non-trivial parameter is present, clang now gathers up all the
parameters that lack inreg and puts them into a packed struct.  MSVC
always aligns each parameter to 4 bytes and no more, so this is a pretty
simple struct to lay out.

On win64, non-trivial records are passed indirectly.  Prior to this
change, clang was incorrectly using byval on win64.

I'm able to self-host a working clang with this change and additional
LLVM patches.

Reviewers: rsmith

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

llvm-svn: 200597
2014-02-01 00:04:45 +00:00
Reid Kleckner 4982b82b73 [ms-cxxabi] Use x86_cdeclmethodcc for __cdecl methods on win32
This fixes PR15768, where the sret parameter and the 'this' parameter
are in the wrong order.

Instance methods compiled by MSVC never return records in registers,
they always return indirectly through an sret pointer.  That sret
pointer always comes after the 'this' parameter, for both __cdecl and
__thiscall methods.

Unfortunately, the same is true for other calling conventions, so we'll
have to change the overall approach here relatively soon.

Reviewers: rsmith

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

llvm-svn: 200587
2014-01-31 22:54:50 +00:00
Reid Kleckner bd63b33854 [ms-cxxabi] Raise aggregate memptr alignment to 8 for x86_32
With this change, we give different results for __alignof than MSVC, but
our record layout is compatible.

Some data member pointers also now have a size that is not a multiple of
their alignment.

Fixes PR18618.

Reviewers: majnemer

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

llvm-svn: 200585
2014-01-31 22:28:50 +00:00
Richard Smith 6d7a5637f1 Fix comment typo in test.
llvm-svn: 200584
2014-01-31 22:28:08 +00:00
Richard Smith 67294e253e Track the currently-being-built submodule inside the preprocessor (rather than
just storing a flag indicating if there was one), and include it in the 'end of
module' annotation. No functionality change.

llvm-svn: 200573
2014-01-31 20:47:44 +00:00
Hans Wennborg 12fb89ec51 MS Intrin.h: implement __cpuidex and simplify __cpuid
The two identical implementations of __cpuid for X86 / X86_64 were
leftovers from my first iteration on the patch that implemented it.

llvm-svn: 200568
2014-01-31 19:44:55 +00:00
NAKAMURA Takumi 1b1e57514e [CMake] arcmt-test: Reorganize link libraries with *actually referenced* libs from arcmt-test.cpp.
arcmt-test doesn't depend on llvm codegen.

llvm-svn: 200563
2014-01-31 18:09:49 +00:00
Renato Golin 779f3ba2b3 Last option on -fexception for arm-disable-ehabi
Previous commit would have a following flag overriding the behaviour
and not taken care of.

llvm-svn: 200555
2014-01-31 16:19:26 +00:00
Renato Golin e7a971b7fa Connect -fno-exceptions to -arm-disable-ehabi
llvm-svn: 200545
2014-01-31 14:13:20 +00:00
Daniel Jasper 86fee2fa3d clang-format: (JavaScript) Don't crash on empty string literals.
Before, this would lead to a crash:
  f('', true);

llvm-svn: 200540
2014-01-31 12:49:42 +00:00
Renato Golin e2dbedda76 Add tests for ARM RT library name
llvm-svn: 200539
2014-01-31 12:21:55 +00:00
Renato Golin e807c12c7a ARM RT libs with generic name
llvm-svn: 200538
2014-01-31 11:47:28 +00:00
NAKAMURA Takumi b024162c20 [CMake] clang doesn't care whether CLANG_ENABLE_*(s) were set or not.
llvm-svn: 200533
2014-01-31 11:19:15 +00:00
NAKAMURA Takumi a050e3e9bd [CMake] Suppress SampleAnalyzerPlugin w/o ENABLE_STATIC_ANALYZER.
llvm-svn: 200532
2014-01-31 11:19:09 +00:00
NAKAMURA Takumi 413496f89b [CMake] Prune stray entries in add_dependencies(). target_link_libraries() implies it.
llvm-svn: 200531
2014-01-31 11:19:04 +00:00
Kostya Serebryany 870baf8cb3 [sanitizer] update the list of supported platforms in the docs
llvm-svn: 200529
2014-01-31 10:49:34 +00:00
Tim Northover 5309111c22 ARM & AArch64: unify the rest of the completely shared NEON implementations
This should be the last routine patch: AArch64 does still delegate to
EmitARMBuiltinExpr, but the remaining instances have complications of
one sort or another so some more cunning thought will be needed.

llvm-svn: 200528
2014-01-31 10:46:52 +00:00
Tim Northover ba1e344d90 ARM & AArch64: another block of miscellaneous NEON sharing.
llvm-svn: 200527
2014-01-31 10:46:49 +00:00
Tim Northover 027b4ee607 ARM & AArch64: move shared vld/vst intrinsics to common implementation.
llvm-svn: 200526
2014-01-31 10:46:45 +00:00
Tim Northover 9d3ab5fe9f ARM & AArch64: more instructions into common block
llvm-svn: 200525
2014-01-31 10:46:41 +00:00
Tim Northover 61fc835d6e ARM & AArch64: merge another NEON block completely.
llvm-svn: 200524
2014-01-31 10:46:36 +00:00
Argyrios Kyrtzidis 278c8d33e2 [Sema] For -Wnon-literal-null-conversion warning, look through integer casts, which are used
by some projects in their null macro.

rdar://15925483

llvm-svn: 200521
2014-01-31 07:51:32 +00:00
Alexey Bataev ec3da87f82 [OPENMP] Bug fixes in threadprivate declaration and data sharing attributes processing. (http://llvm-reviews.chandlerc.com/D2451)
llvm-svn: 200513
2014-01-31 05:15:34 +00:00