Commit Graph

62227 Commits

Author SHA1 Message Date
David Majnemer 1b2d0b4637 [MS ABI] Never reference dllimport'd vtables
Referencing a dllimported vtable is impossible in a constexpr
constructor.  It would be friendlier to C++ programmers if we
synthesized a copy of the vftable which referenced imported virtual
functions.  This would let us initialize the object in a way which
preserves both the intent to import functionality from another DLL while
also making constexpr work.

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

llvm-svn: 260388
2016-02-10 17:40:47 +00:00
Andrey Turetskiy 8170bab10a Reapply the patch of r260376.
llvm-svn: 260379
2016-02-10 12:56:10 +00:00
Daniel Jasper 36e979af73 clang-format sort include use the source file name to determine the
"main include" that will be the 1st include (category 0).

Because the clang-format visual studio extension does not pass the file
name and use the standard input, sort include cannot find a "main
include":

Testing fix on llvm\tools\clang\lib\Format\Format.cpp:
Original file:
  #include "clang/Format/Format.h"
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Lex/Lexer.h"

Without fix, selecting the includes and running visual studio
clang-format:
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Format/Format.h"
  #include "clang/Lex/Lexer.h"

With fix, selecting the includes and running visual studio clang-format:
  #include "clang/Format/Format.h"
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Lex/Lexer.h"

Test 2 with main header not at the start:
Original file:
  ...
  #include "clang/Format/Format.h"
  #include "clang/Basic/SourceManager.h"
  #include "clang/Lex/Lexer.h"

Without fix, selecting the includes and running visual studio
clang-format:
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Format/Format.h"
  #include "clang/Lex/Lexer.h"

With fix, selecting the includes and running visual studio clang-format:
  #include "clang/Format/Format.h"
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Lex/Lexer.h"

Patch by Jean-Philippe Dufraigne, thank you.
Review: http://reviews.llvm.org/D16524

llvm-svn: 260378
2016-02-10 12:42:58 +00:00
Andrey Turetskiy db6655fd90 [X86] Fix stack alignment for MCU target (Clang part), by Anton Nadolskiy.
This patch fixes stack alignments for MCU (should be aligned to 4 bytes).

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

llvm-svn: 260376
2016-02-10 11:58:46 +00:00
Alexey Bataev d985edaa6e [OPENMP 4.5] Initial support for data members in 'firstprivate' clause.
OpenMP 4.5 allows privatization of non-static data members of current
class in non-static member functions.

llvm-svn: 260374
2016-02-10 11:29:16 +00:00
Denis Zobnin f49c0f83aa Fix assertion "Chunk.Kind == DeclaratorChunk::Function" with attributed type.
This patch is to upgrade FunctionTypeUnwrapper for correct processing of
AttributedType. Fixes PR25786.
Patch by Alexander Makarov.

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

llvm-svn: 260373
2016-02-10 11:23:48 +00:00
Alexey Bataev 4bcad7f236 Fix PR26543: add a check for definition in CXXRecordDecl.
llvm-svn: 260370
2016-02-10 10:50:12 +00:00
Akira Hatanaka dfe2156f1b [Sema] Issue a warning for integer overflow in nested struct initializer
r257357 fixed clang to warn on integer overflow in struct initializers.
However, it didn't warn when a struct had a nested initializer. This
commit makes changes in Sema::CheckForIntOverflow to handle nested
initializers.

For example:

struct s {
  struct t {
    unsigned x;
  } t;
} s = {
  {
    .x = 4 * 1024 * 1024 * 1024
  }
};

rdar://problem/23526454

llvm-svn: 260360
2016-02-10 06:06:06 +00:00
Chris Bieneman 7590a1ee61 [CMake] For multi-stage builds to be deterministic we need to disable timestamps.
Duh! With this change I've verified -O3 builds are deterministic.

llvm-svn: 260350
2016-02-10 02:17:21 +00:00
Paul Robinson 4abe94fb6b Get rid of another SAME-NOT. FileCheck does not have this suffix.
Differential Revision: http://reviews.llvm.org/D17062

llvm-svn: 260348
2016-02-10 02:08:24 +00:00
NAKAMURA Takumi 8d62f5c7ce clang/test/Index/skip-parsed-bodies/compile_commands.json: Appease targeting msvc.
llvm-svn: 260347
2016-02-10 01:45:51 +00:00
Justin Lebar af94c0f2b3 Remove some unnecessary CHECK-SAMEs in ModuleDebugInfo.{cpp,m}.
Suggested by Paul Robinson.

llvm-svn: 260346
2016-02-10 01:34:17 +00:00
NAKAMURA Takumi cd4d945525 libclang: Enable skip-parsed-bodies on win32.
I guess it would be working since Rafael's r187619.

llvm-svn: 260344
2016-02-10 01:29:57 +00:00
Chris Bieneman b33600fe6b [CMake] Pass LLVM_EXTERNAL_*_SOURCE_DIR variables to subsequent stages
For multi-stage builds we need to pass any overridden source directory variables. Without passing these the subsequent stages won't find the project sources.

llvm-svn: 260341
2016-02-10 01:09:59 +00:00
Chris Bieneman a0a0317dbc [CMake] Fixing the 3-stage cmake cache.
I had hoped this would work from a single cache file, but turns out there is a bug I can't quite figure out relating to passing list arguments to recursive CMake invocations.

This change works around that.

llvm-svn: 260340
2016-02-10 01:09:56 +00:00
Justin Lebar ae06ca0c7e Get rid of CHECK-SAME-NOT in tests.
Summary: This isn't a FileCheck directive; it does nothing.

Reviewers: jroelofs

Subscribers: cfe-commits, majnemer

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

llvm-svn: 260334
2016-02-10 00:38:15 +00:00
Ekaterina Romanova a61946d551 This patch adds doxygen comments for all the intrinsincs in the header file f16cintrin.h. The doxygen comments are automatically generated based on Sony's intrinsics document.
Differential Revision: http://reviews.llvm.org/D17021

llvm-svn: 260333
2016-02-10 00:12:24 +00:00
Richard Smith 952923be11 Update documentation to reflect that libc++abi provides __cxa_thread_atexit (and has for quite a while). Also document that we have not yet implemented the new inheriting constructor rules.
llvm-svn: 260311
2016-02-09 22:48:14 +00:00
Richard Smith b1cba3e772 PR26349: correctly check whether a digit sequence is empty in the presence of digit separators.
llvm-svn: 260307
2016-02-09 22:34:35 +00:00
Richard Smith 0dd191a5c4 Add Tooling functionality to get a name for a QualType that can be used to name
that type from the global scope.

Patch by Sterling Augustine, derived (with permission) from code from Cling by
Vassil Vassilev and Philippe Canal.

llvm-svn: 260278
2016-02-09 21:04:04 +00:00
Richard Smith 85b927f7f6 Simplify and rename ASTMatchFinder's getCXXRecordDecl to make it more obvious
what it's actually trying to do.

llvm-svn: 260277
2016-02-09 20:59:05 +00:00
Ehsan Akhgari b55b9ff884 Fix the test added in r260266
llvm-svn: 260276
2016-02-09 20:49:24 +00:00
Xinliang David Li a951e8ece7 [PGO] Fix issue: explicitly defaulted assignop is not profiled
Differential Revision: http://reviews.llvm.org/D16947
 

llvm-svn: 260270
2016-02-09 20:02:59 +00:00
Reid Kleckner 969b1a50a0 Pass /bigobj when building lib/ASTMatchers/Dynamic/Registry.cpp
This is the third time it has crossed the 2^16 section limit. We've
already spent time optimizing this file to reduce template
instantiations, and it's not clear that there is anymore low hanging
fruit.

llvm-svn: 260267
2016-02-09 19:53:30 +00:00
Ehsan Akhgari 48e8d8bcdd clang-cl: Enable plugins on Windows
llvm-svn: 260266
2016-02-09 19:43:13 +00:00
Ehsan Akhgari 75b3a4b507 clang-cl: Support loading plugins on Windows
This builds on the support being added to LLVM to import and export
registries from DLLs.  This will allow us to pick up the registry
entries added in the DLL's copy of FrontendPluginRegistry.

This will allow us to use plugins on Windows using:
$ clang-cl -Xclang -load -Xclang plugin.dll \
           -Xclang -add-plugin -Xclang foo

llvm-svn: 260265
2016-02-09 19:43:11 +00:00
Argyrios Kyrtzidis ca4ad1937c [libclang] indexing: make sure to not visit init-list expressions twice.
llvm-svn: 260255
2016-02-09 19:07:24 +00:00
Argyrios Kyrtzidis 49385e8bd5 [libclang] indexing: handle 'TopLevelDeclInObjCContainers' at the point where they are reported.
It isn't much benefit and doesn't worth the complexity to try to handle them after the container is encountered.

llvm-svn: 260254
2016-02-09 19:07:21 +00:00
Argyrios Kyrtzidis a4cffec19e [libclang] indexing: for a synthesized property reference have the parent be the ObjC implementation decl.
llvm-svn: 260253
2016-02-09 19:07:19 +00:00
Argyrios Kyrtzidis 4c3131d6eb [Frontend] Handle ASTConsumer::shouldSkipFunctionBody via the MultiplexConsumer.
llvm-svn: 260252
2016-02-09 19:07:16 +00:00
Argyrios Kyrtzidis c382abfd73 [ASTUnit] Change the parameter of ASTUnit::LoadFromCompilerInvocationAction to accept a more general FrontendAction.
llvm-svn: 260251
2016-02-09 19:07:13 +00:00
Argyrios Kyrtzidis af75b19736 [libclang] indexing: Have the semantic container of synthesized ObjC getter/setter methods be the implementation decl.
Matches the behavior of other ObjC methods.

llvm-svn: 260250
2016-02-09 19:07:07 +00:00
David Blaikie 2eabcc988f Simplify EnterTokenStream API to make it more robust for memory management
While this won't help fix things like the bug that r260219 addressed, it
seems like good tidy up to have anyway.

(it might be nice if "makeArrayRef" always produced a MutableArrayRef &
let it decay to an ArrayRef when needed - then I'd use that for the
MutableArrayRefs in this patch)

If we had std::dynarray I'd use that instead of unique_ptr+size_t,
ideally (but then it'd have to be threaded down through the Preprocessor
all the way - no idea how painful that would be)

llvm-svn: 260246
2016-02-09 18:52:09 +00:00
Reid Kleckner d809be40d2 Revert "Avoid forcing emission of delayed dllexported classes on template instantiation"
This reverts commit r260194.

It caused PR26549. There's probably a better way to do this also.

llvm-svn: 260241
2016-02-09 17:48:27 +00:00
David Majnemer 470ee61e01 [MS ABI] Cleanup emitVTableDefinitions
Use the VFTable components to determine whether or not we should emit
RTTI data instead of duplicating the VFTableBuilder's logic.

llvm-svn: 260238
2016-02-09 17:27:52 +00:00
Aaron Ballman 880a65bba5 Registering the gnuNullExpr AST matcher as a dynamic matcher so that it is available from clang-query.
llvm-svn: 260222
2016-02-09 14:04:49 +00:00
Alexey Bataev 6e2ee6dbbf [OPENMP] Fix test incompatibility with arm buildbots.
llvm-svn: 260220
2016-02-09 12:16:42 +00:00
Alexey Bataev 56f5ad161a Fix possible OOB access found by buildbot
llvm-svn: 260219
2016-02-09 11:01:58 +00:00
Manuel Klimek de99290e0a Add AST matcher reference to documentation directory when building HTML docs.
llvm-svn: 260218
2016-02-09 10:59:21 +00:00
Alexey Bataev 13b509cd92 [OPENMP] Allow to use the variable in the same 'threadprivate'
directive.

llvm-svn: 260215
2016-02-09 09:41:42 +00:00
Alexey Bataev 3e6c45a41c Do not mark variable as threadprivate if it was marked already.
llvm-svn: 260214
2016-02-09 09:41:33 +00:00
Alexey Bataev 376b4a4690 [OPENMP] Allow to reference threadprivate variable in same directive.
llvm-svn: 260213
2016-02-09 09:41:09 +00:00
Alexey Bataev 6ee07eab03 Fixed preprocessed output of the first token for pragmas.
Clang did not expanded macros in the very first token of the pragmas
during preprocessed output

llvm-svn: 260211
2016-02-09 08:51:26 +00:00
Chris Bieneman b79e55577e [CMake] Updating caches README with explanations of useful cache files.
This is in response to silvas' post-commit suggestion.

llvm-svn: 260203
2016-02-09 06:49:08 +00:00
Chris Bieneman 6ced921f8c [CMake] Providing a CMake cache for 3-stage builds
This cache file can be used to generate a 3-stage clang build. You can configure using the following CMake command:

cmake -C <path to clang>/cmake/caches/3-stage.cmake -G Ninja <path to llvm>

You can then run "ninja stage3-clang" to build stage1, stage2 and stage3 clangs.

This is useful for finding non-determinism the compiler by verifying that stage2 and stage3 are identical.

llvm-svn: 260201
2016-02-09 06:01:47 +00:00
Reid Kleckner f5f2f5f159 Avoid forcing emission of delayed dllexported classes on template instantiation
Fixes PR26490

llvm-svn: 260194
2016-02-09 02:51:17 +00:00
Richard Smith 840144887a Remove 'llvm::TrailingObjects::operator delete', clang side.
llvm-svn: 260189
2016-02-09 01:57:24 +00:00
Richard Smith c99f11b373 Fix undefined behavior when compiling in C++14 due to sized operator delete
being called with the wrong size: convert CGFunctionInfo to use TrailingObjects
and ask TrailingObjects to provide a working 'operator delete' for us.

llvm-svn: 260181
2016-02-09 01:05:04 +00:00
Xinliang David Li 55adc9ddcc [PGO] Cover more cases of implicitly generated C++ methods
llvm-svn: 260161
2016-02-08 22:41:37 +00:00
Ekaterina Romanova d416747803 This patch adds doxygen comments for all the intrinsincs in the header file pmmintrin.h. The doxygen comments are automatically generated based on Sony's intrinsics document.
Differential Revision: http://reviews.llvm.org/D16913

llvm-svn: 260160
2016-02-08 22:35:09 +00:00