Commit Graph

22560 Commits

Author SHA1 Message Date
David Majnemer 03f705fe92 Sema: Don't allow CVR qualifiers before structors
We would silently accept volatile ~S() when the user probably intended
to write virtual ~S().

This fixes PR20238.

llvm-svn: 212555
2014-07-08 18:18:04 +00:00
Richard Smith 1133085461 PR20227: materialize a temporary when dynamic_casting a class prvalue to a
reference type.

llvm-svn: 212551
2014-07-08 17:25:14 +00:00
Alexander Musman af89c4e51f [OPENMP] Allow ‘reduction’ clause on ‘omp simd’ directive.
llvm-svn: 212525
2014-07-08 11:33:21 +00:00
Alexey Bataev 84d0b3efee [OPENMP] Parsing and sema analysis for 'omp parallel sections' directive.
llvm-svn: 212516
2014-07-08 08:12:03 +00:00
Saleem Abdulrasool c4ebb129b7 Headers: conditionalise more declarations
Protect MMX specific declarations under a __MMX__ guard.  This header can be
included on non-x86 architectures (e.g. ARM) which do not support the MMX ISA.
Use the preprocessor to prevent these declarations from being processed.

llvm-svn: 212512
2014-07-08 05:46:04 +00:00
Reid Kleckner afba553ede MS ABI: "Fix" passing non-POD structs by value to variadic functions
Of course, such code is horribly broken and will explode on impact.
That said, ATL does it, and we have to support them, at least a little
bit.

Fixes PR20191.

llvm-svn: 212508
2014-07-08 02:24:27 +00:00
Alexey Samsonov e7a8ccfaad [Sanitizer] Reduce the usage of sanitizer blacklist in CodeGenModule
Get rid of cached CodeGenModule::SanOpts, which was used to turn off
sanitizer codegen options if current LLVM Module is blacklisted, and use
plain LangOpts.Sanitize instead.

1) Some codegen decisions (turning TBAA or writable strings on/off)
   shouldn't depend on the contents of blacklist.

2) llvm.asan.globals should *always* be created, even if the module
   is blacklisted - soon Clang's CodeGen where we read sanitizer
   blacklist files, so we should properly report which globals are
   blacklisted to the backend.

llvm-svn: 212499
2014-07-07 23:34:34 +00:00
Anders Carlsson 1a9fe3d4db Handle __builtin_clzs and __builtin_ctzs in the constant expression evaluator.
llvm-svn: 212464
2014-07-07 15:53:44 +00:00
Alexey Bataev 4acb859fbd [OPENMP] Added initial support for 'omp parallel for'.
llvm-svn: 212453
2014-07-07 13:01:15 +00:00
David Majnemer 611cdb9a63 CodeGen: Cleanup MS ABI RTTI LLVM IR
The MS ABI RTTI emission code would choose names for IR types like
%"MSRTTITypeDescriptor\02".  This name is undesirable because it
requires escaping; the underlying reason for this is that the name is
unprintable.  Fix this by naming it %rtti.TypeDescriptor2.

While here, stop trying to do lookups in the LLVM Module's type table.
Instead, store the IR types in MicrosoftCXXABI.  Lookups by name aren't
particularly fast.

llvm-svn: 212439
2014-07-07 08:09:15 +00:00
Richard Smith a9a1c68a1b Fix an iterator invalidation issue: deserializing a key function can write to
the key functions table. Don't hold references to anything within that table
across such an access.

llvm-svn: 212437
2014-07-07 06:38:20 +00:00
Richard Smith 22a5d61b5d Add an explicit diagnostic for the case where an expression is not a constant
expression because it uses 'this'. Inspired by PR20219 comment#2.

llvm-svn: 212433
2014-07-07 06:00:13 +00:00
Nico Weber 9b982078e9 Add an AST node for __leave statements, hook it up.
Codegen is still missing (and I won't work on that), but __leave is now
as implemented as __try and friends.

llvm-svn: 212425
2014-07-07 00:12:30 +00:00
Nico Weber eb61d4d7c2 Sema: Check that __leave is contained in a __try block.
Give scope a SEHTryScope bit, set that in ParseSEHTry(), and let Sema
walk the scope chain to find the SEHTry parent on __leave statements.
(They are rare enough that it seems better to do the walk instead of
giving Scope a SEHTryParent pointer -- this is similar to AtCatchScope.)

llvm-svn: 212422
2014-07-06 22:53:19 +00:00
Nico Weber c7d0596429 Add parser support for __leave (sema and onward still missing).
llvm-svn: 212421
2014-07-06 22:32:59 +00:00
Aaron Ballman ee7d10b5aa Giving this test a triple to satisfy the build bots.
llvm-svn: 212418
2014-07-06 20:07:16 +00:00
Aaron Ballman 1c8a5d75f1 The MicrosoftExtensions.c test file should not rely on -x objective-c++. Removed that from the RUN line, fixed obvious C++isms in the code, and moved some C++ tests into MicrosoftExtensions.cpp instead. As a drive-by, changed the line endings for MicrosoftExtensions.c to be LF instead of CRLF.
llvm-svn: 212417
2014-07-06 20:04:10 +00:00
Aaron Ballman f21ba37f1b This test case does not require -Wno-missing-declarations or -x objective-c++.
llvm-svn: 212416
2014-07-06 19:44:38 +00:00
Ehsan Akhgari 7e36a19b20 Move InterlockedBitTestAndSet into its own test file
Summary:
This gives us back the test coverage we lost when I made
MicrosoftExtensions.c x86-only.

Reviewers: majnemer

Subscribers: cfe-commits

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

llvm-svn: 212414
2014-07-06 18:45:44 +00:00
Ehsan Akhgari d2c3ba6fbe Fix the MicrosoftExtensions.c target
llvm-svn: 212393
2014-07-06 05:58:55 +00:00
Ehsan Akhgari d1e8abb1fb Enable the InterlockedBitTestAndSet test
llvm-svn: 212392
2014-07-06 05:50:19 +00:00
Ehsan Akhgari 0f89fac7a5 Add support for nested blocks in Microsoft inline assembly
This fixes http://llvm.org/PR20204.

llvm-svn: 212389
2014-07-06 05:26:54 +00:00
Nico Weber 2582895832 clang-cl: /showIncludes output should go to stdout, not stderr. Fixes PR20217.
llvm-svn: 212383
2014-07-06 03:04:24 +00:00
Saleem Abdulrasool e700cab4e9 CodeGen: add support for a few MSVC ARM intrinsics
This adds support for simple MSVC compatibility mode intrinsics.  These
intrinsics are simple in that they are either directly passed through to the
annotated MSBuiltin intrinsic or they mirror existing GCC builtins.

llvm-svn: 212378
2014-07-05 20:10:05 +00:00
Ehsan Akhgari 3e0dd89adf Add a test case for the tilde operator in Microsoft inline assembly
llvm-svn: 212373
2014-07-05 15:04:06 +00:00
Ehsan Akhgari edd82a996c Fix up the test that expects the failure fixed in r212352
llvm-svn: 212353
2014-07-04 19:22:29 +00:00
Simon Atanasyan 4e16a4250d [Driver][Mips] Support one more MIPS CPU name - octeon.
llvm-svn: 212339
2014-07-04 12:37:04 +00:00
Simon Atanasyan 26610c5960 [Driver][Mips] Support more MIPS CPU names: mips1 - mips5.
llvm-svn: 212338
2014-07-04 12:36:56 +00:00
Sylvestre Ledru 0ccfb3a144 gcc comptability: silent -fdefer-pop & -fno-defer-pop
Reviewers: rafael, rnk

Reviewed By: rnk

Subscribers: rnk, cfe-commits

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

llvm-svn: 212327
2014-07-04 08:59:41 +00:00
NAKAMURA Takumi b52c761a3c Let test/Unit/lit.cfg add config.shlibdir to $PATH on DLL platforms like cygming.
This makes unittests run with BUILD_SHARED_LIBS on DLL platforms.

llvm-svn: 212316
2014-07-04 05:11:55 +00:00
NAKAMURA Takumi 6ba3a64e70 Trailing linefeed
llvm-svn: 212312
2014-07-04 04:20:49 +00:00
Alexey Bataev b75daeecbe Fixed test CodeGen/captured-statements.c for powerpc64-linux.
llvm-svn: 212311
2014-07-04 04:06:11 +00:00
Gerolf Hoflehner 2344cfc335 Restore global static array in test case
llvm-svn: 212285
2014-07-03 19:30:33 +00:00
Yi Kong 4efadfb0b0 [ARM] Implement ISB memory barrier intrinsic
Adds support for __builtin_arm_isb. Also corrects DSB and ISB instructions
modelling by adding has-side-effects property.

llvm-svn: 212277
2014-07-03 16:01:25 +00:00
Renato Golin 47843efcf6 Add the __qdbl intrinsic to the arm_acle.h header
Patch by: Moritz Roth

llvm-svn: 212264
2014-07-03 10:14:52 +00:00
Robert Lytton 57765d5347 Move the calling of emitTargetMD() later.
Summary:
Because a global created by GetOrCreateLLVMGlobal() is not finalised until later viz:
  extern char a[];
  char f(){ return a[5];}
  char a[10];

Change MangledDeclNames to use a MapVector rather than a DenseMap so that the
Metadata is output in order of original declaration, so to make deterministic
and improve human readablity.

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

llvm-svn: 212263
2014-07-03 09:30:33 +00:00
Christian Pirker c3d3217525 ARMEB: Fix function result return for composite types
Reviewed at http://reviews.llvm.org/D4364

llvm-svn: 212261
2014-07-03 09:28:12 +00:00
Simon Atanasyan 6b3544eb1d [Driver][Mips] Check MIPS CPU name provided to the Clang driver.
llvm-svn: 212260
2014-07-03 08:31:23 +00:00
David Majnemer 93de4b1608 MS ABI: Get linkage of RTTI data correct
The Itanium rules are not appropriate for the MS ABI.  RTTI data is
_never_ imported and thus is never available_externally.  It is either
internal (if the type's linkage is internal) or linkonce_odr.

This also means that classes which inherit from dllimport'd bases force
their translation unit to duplicate the entirety of the RTTI data of
that base.

Interestingly, the complete object locator can never be referenced by
translation units which import the class.

This fixes PR20106.

llvm-svn: 212256
2014-07-03 05:51:27 +00:00
Saleem Abdulrasool ece7217f70 ARM: rename ARM builtins to use __builtin_arm prefix
This corrects SVN r212196's naming change to use the proper prefix of
`__builtin_arm_` instead of `__builtin_`.

Thanks to Yi Kong for pointing out the incorrect naming!

llvm-svn: 212253
2014-07-03 02:43:20 +00:00
Nico Weber bcb70eee1a Enable clang to continue to parse libstdc++4.6 and stlport after r210091.
r210091 made initialization checking more strict in c++11 mode. LWG2193 is
about changing standard libraries to still be valid under these new rules,
but older libstdc++ (e.g. libstdc++4.6 in -D_GLIBCXX_DEBUG=1 mode, or stlport)
do not implement that yet.  So fall back to the C++03 semantics for container
classes in system headers below the std namespace.

llvm-svn: 212238
2014-07-02 23:51:09 +00:00
Saleem Abdulrasool 4bddd9d400 CodeGen: make target builtins support languages
This extends the target builtin support to allow language specific annotations
(i.e. LANGBUILTIN).  This is to allow MSVC compatibility whilst retaining the
ability to have EABI targets use a __builtin_ prefix.  This is merely to allow
uniformity in the EABI case where the unprefixed name is provided as an alias in
the header.

llvm-svn: 212196
2014-07-02 17:41:27 +00:00
Alexey Samsonov 4f319cca42 [ASan] Print exact source location of global variables in error reports.
See https://code.google.com/p/address-sanitizer/issues/detail?id=299 for the
original feature request.

Introduce llvm.asan.globals metadata, which Clang (or any other frontend)
may use to report extra information about global variables to ASan
instrumentation pass in the backend. This metadata replaces
llvm.asan.dynamically_initialized_globals that was used to detect init-order
bugs. llvm.asan.globals contains the following data for each global:
  1) source location (file/line/column info);
  2) whether it is dynamically initialized;
  3) whether it is blacklisted (shouldn't be instrumented).

Source location data is then emitted in the binary and can be picked up
by ASan runtime in case it needs to print error report involving some global.
For example:

  0x... is located 4 bytes to the right of global variable 'C::array' defined in '/path/to/file:17:8' (0x...) of size 40

These source locations are printed even if the binary doesn't have any
debug info.

This is an ABI-breaking change. ASan initialization is renamed to
__asan_init_v4(). Pre-built libraries compiled with older Clang will not work
with the fresh runtime.

llvm-svn: 212188
2014-07-02 16:54:41 +00:00
Daniel Sanders adbbfd1fe9 [mips] Added additional test cases for passing -mabi to the assembler.
Summary:
This patch adds minimal coverage for each -mcpu value to ensure that none of them can pass an empty string in -mabi. 

Prior to r212176, many -mcpu values would trigger this.

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

llvm-svn: 212182
2014-07-02 15:21:50 +00:00
Daniel Sanders b7689ba49d [mips] Make FileCheck prefixes match the CPU they check
Summary:
For example: s/MIPS32-EB-AS/MIPS32R2-EB-AS/ since it is for MIPS32r2 not MIPS32.

This reduces the noise in my next Clang patch.

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

llvm-svn: 212177
2014-07-02 13:21:52 +00:00
Simon Atanasyan a42a84e44c [Driver][Mips] If ABI name is not provided deduce it from the target triple
not from the CPU name. This approach is closer to the method used by gcc driver.

llvm-svn: 212176
2014-07-02 13:20:36 +00:00
Tim Northover 3acd6bd0b6 ARM: add support for v8 ldaex/stlex builtins.
ARMv8 adds (to both AArch32 and AArch64) acquiring and releasing
variants of the exclusive operations, in line with the C++11 memory
model.

This adds support for two new intrinsics to expose them to C & C++
developers directly: __builtin_arm_ldaex and __builtin_arm_stlex, in
direct analogy with the versions with no implicit barrier.

rdar://problem/15885451

llvm-svn: 212175
2014-07-02 12:56:02 +00:00
Alp Toker f5b107940a Make FunctionDecl::getReturnTypeSourceRange() support non-builtin types
Also document that the function is a "best-effort" facility to extract source
ranges from limited AST type location info.

llvm-svn: 212174
2014-07-02 12:55:58 +00:00
Tim Northover 1471cb17ae X86: inline all atomic operations up to 128-bits.
The backend *can* cope with all of these now, so Clang should give it the
chance. On CPUs without cmpxchg16b (e.g. the original athlon64) LLVM can reform
the libcalls.

rdar://problem/13496295

llvm-svn: 212173
2014-07-02 10:25:45 +00:00
Alp Toker 70fc29ca86 Don't accept qualified 'int' main return types in C++ or standard C mode
C++ [basic.start.main]p1: "It shall have a return type of type int"

ISO C is also clear about this, so only accept 'int' with qualifiers in GNUMode
C.

llvm-svn: 212171
2014-07-02 07:07:20 +00:00