Commit Graph

65085 Commits

Author SHA1 Message Date
Davide Italiano 8332145373 [AST] Remove unused function, to silence a GCC7 warning.
llvm-svn: 279479
2016-08-22 21:33:12 +00:00
Tim Shen f2187ed321 [GraphTraits] Replace all NodeType usage with NodeRef
This should finish the GraphTraits migration.

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

llvm-svn: 279475
2016-08-22 21:09:30 +00:00
Matt Arsenault 88d7da01ca AMDGPU: Handle structs directly in AMDGPUABIInfo
Structs are currently handled as pointer + byval, which makes AMDGPU
LLVM backend generate incorrect code when structs are used. This patch
changes struct argument to be handled directly and without flattening,
which Clover (Mesa 3D Gallium OpenCL state tracker) will be able to
handle. Flattening would expand the struct to individual elements and
pass each as a separate argument, which Clover can not
handle. Furthermore, such expansion does not fit the OpenCL
programming model which requires to explicitely specify each argument
index, size and memory location.

Patch by Vedran Miletić

llvm-svn: 279463
2016-08-22 19:25:59 +00:00
Duncan P. N. Exon Smith 475e1dc7f2 ADT: Remove uses of ilist_*sentinel_traits, NFC
llvm-svn: 279457
2016-08-22 18:57:44 +00:00
Artem Belevich bee2f41fac [CUDA] Collapsed offload actions should not be top-level jobs.
If they are, we end up with the last intermediary output preserved
in the current directory after compilation.

Added a test case to verify that we're using appropriate filenames
for outputs of different phases.

Differential Revision: https://reviews.llvm.org/D23526

llvm-svn: 279455
2016-08-22 18:50:34 +00:00
David Blaikie 87173f108a PR29086: DebugInfo: Improve support for fixed array dimensions in variable length arrays
llvm-svn: 279445
2016-08-22 17:49:56 +00:00
David Blaikie c41fcaf8aa Remove redundant test
test/CodeGenCXX/debug-info-zero-length-arrays.cpp tests this
functionality more comprehensively

llvm-svn: 279444
2016-08-22 17:49:50 +00:00
Martin Probst ed87d788d6 clang-format: [JS] supports casts to types starting with punctuation ("{[(").
Before:

    x as{x: number}

After:

    x as {x: number}

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D23761

llvm-svn: 279436
2016-08-22 14:23:30 +00:00
Gabor Horvath b59b27040e Reapply "[analyzer] Added valist related checkers."
Differential Revision: https://reviews.llvm.org/D15227

llvm-svn: 279427
2016-08-22 11:21:30 +00:00
Gabor Horvath 855ad82e05 [analyzer] Correctly add assumptions based on array bounds.
Also simplify the constraints generated by the checker. 

Differential Revision: https://reviews.llvm.org/D23112

llvm-svn: 279425
2016-08-22 10:07:32 +00:00
Elad Cohen 13fc34b5b5 Test commit (Removing trailing whitespace).
llvm-svn: 279419
2016-08-22 07:34:21 +00:00
Asaf Badouh 356bb76809 [X86][AVX512F] minor fix of the parameter names
add "__" prefix

Bug 28842 https://llvm.org/bugs/show_bug.cgi?id=29040

Differential Revision: https://reviews.llvm.org/D23753


 

llvm-svn: 279392
2016-08-21 07:56:47 +00:00
Simon Pilgrim e62d0da8cc Wdocumentation fix
llvm-svn: 279382
2016-08-20 20:21:27 +00:00
Artem Dergachev 5657486854 [analyzer] Use faster hashing (MD5) in CloneDetector.
This replaces the old approach of fingerprinting every AST node into a string,
which avoided collisions and was simple to implement, but turned out to be
extremely ineffective with respect to both performance and memory.

The collisions are now dealt with in a separate pass, which no longer causes
performance problems because collisions are rare.

Patch by Raphael Isemann!

Differential Revision: https://reviews.llvm.org/D22515

llvm-svn: 279378
2016-08-20 17:35:53 +00:00
Benjamin Kramer f3b323debc [Sema] Don't crash on scanf on forward-declared enums.
This is valid in GNU C, which allows pointers to incomplete enums. GCC
just pretends that the underlying type is 'int' in those cases, follow
that behavior.

llvm-svn: 279374
2016-08-20 16:51:33 +00:00
Vassil Vassilev 8643639ab4 PR28423: Compare primary declaration contexts.
In certain cases (mostly coming from modules), Sema's idea of the StdNamespace
does not point to the first declaration of namespace std.

Patch by Cristina Cristescu!

Reviewed by Richard Smith.

llvm-svn: 279371
2016-08-20 14:50:22 +00:00
Artem Dergachev 51b9a0e8e8 [analyzer] Make CloneDetector consider macro expansions.
So far macro-generated code was treated by the CloneDetector as normal code.
This caused that some macros where reported as false-positive clones because
large chunks of code coming from otherwise concise macro expansions were treated
as copy-pasted code.

This patch ensures that macros are treated in the same way as literals/function
calls. This prevents macros that expand into multiple statements
from being reported as clones.

Patch by Raphael Isemann!

Differential Revision: https://reviews.llvm.org/D23316

llvm-svn: 279367
2016-08-20 10:06:59 +00:00
Artem Dergachev 5183888813 [analyzer] Make CloneDetector consider template arguments.
For example, code samples `isa<Stmt>(S)' and `isa<Expr>(S)'
are no longer considered to be clones.

Patch by Raphael Isemann!

Differential Revision: https://reviews.llvm.org/D23555

llvm-svn: 279366
2016-08-20 09:57:21 +00:00
Manman Ren 0f67a9effc Revert r279351 and r279357 due to bot failures
llvm-svn: 279358
2016-08-20 03:00:54 +00:00
Manman Ren 43bbc0d1d6 Fix windows bot
llvm-svn: 279357
2016-08-20 02:28:15 +00:00
Manman Ren e712d2061c [NFC] Add a class ObjCProtocolQualifiers to wrap APIs for ObjC protocol list.
This is in preparation of adding a new type class ObjCTypeParamType that
can take protocol qualifiers. ObjCProtocolQualifiers will be shared between
ObjCObjectType and ObjCTypeParamType.
    
rdar://24619481
rdar://25060179

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

llvm-svn: 279351
2016-08-20 00:04:21 +00:00
Vedant Kumar 8a4d2ddd19 [Driver] Remove unused #include of llvm/Support/config.h
This is a follow-up to r279112 (which removed the need for the header)
and in the same spirit as r279035 (which attempted to un-break
out-of-tree builds).

llvm-svn: 279348
2016-08-19 23:15:35 +00:00
Devin Coughlin 0fb33f9690 [www] Add nullability questions to analyzer FAQ.
llvm-svn: 279330
2016-08-19 22:04:45 +00:00
Tim Shen 0666179232 [CallGraph] Use decltype instead of pointer_to_unary_function. NFC.
Reviewers: dblaikie

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23726

llvm-svn: 279329
2016-08-19 21:52:42 +00:00
Tim Shen b5e0f5ac95 [GraphTraits] Make nodes_iterator dereference to NodeType*/NodeRef
Currently nodes_iterator may dereference to a NodeType* or a NodeType&. Make them all dereference to NodeType*, which is NodeRef later.

Differential Revision: https://reviews.llvm.org/D23704
Differential Revision: https://reviews.llvm.org/D23705

llvm-svn: 279326
2016-08-19 21:20:13 +00:00
Martin Probst e1e12a73d7 clang-format: [JS] handle object literals with casts.
Summary: E.g. `{a: 1} as b`.

Reviewers: djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D23714

llvm-svn: 279250
2016-08-19 14:35:01 +00:00
Andrey Bokhanko 9d126a466f Fixed a typo (compilation_commands.json --> compile_commands.json).
llvm-svn: 279240
2016-08-19 13:36:31 +00:00
Valery Pykhtin 4b5d9d16d3 [AMDGPU] add s_incperflevel/s_decperflevel builtins
Differential revision: https://reviews.llvm.org/D23668

llvm-svn: 279235
2016-08-19 12:54:31 +00:00
NAKAMURA Takumi cc980fc55f clang/test/Modules/prebuilt-module.m: Prune "-triple" to fix a configuration mismatch.
llvm-svn: 279207
2016-08-19 05:25:26 +00:00
Yaxun Liu 26f7566ff8 Re-commit [OpenCL] AMDGCN: Fix size_t type
There was a premature cast to pointer type in emitPointerArithmetic which caused assertion in tests with assertion enabled.

llvm-svn: 279206
2016-08-19 05:17:25 +00:00
Richard Smith 964cc53d9a C++ Modules TS: support parsing the 'module' declaration (including extensions
from p0273r0 approved by EWG). We'll eventually need to handle this from the
lexer as well, in order to disallow preprocessor directives preceding the
module declaration and to support macro import.

llvm-svn: 279196
2016-08-19 01:43:06 +00:00
Devin Coughlin 9ec2cb600b [www] Add analyzer FAQ about not releasing ivars in -dealloc.
llvm-svn: 279183
2016-08-19 01:22:50 +00:00
Devin Coughlin 719238b7d3 [analyzer] Weaken assertion in trackNullOrUndefValue()
We should ignore paren casts when making sure that the semantic expression
in a PseudoObjectExpr for an ObjC getter is a message send.

This has no other intended functionality change.

Adding a test for this exposed an interesting issue in another test case
that only manifests under ARC. trackNullOrUndefValue() is not properly
suppressing for nil values that are the result of nil propagation from a nil
receiver when the nil is returned from a function. I've added a FIXME for that
missing suppression.

rdar://problem/27290568

llvm-svn: 279181
2016-08-19 01:05:31 +00:00
Changpeng Fang 03bdd8f797 AMDGPU: Add clang builtin for ds_swizzle.
Summary:
  int __builtin_amdgcn_ds_swizzle (int a, int imm);
while imm is a constant.

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

llvm-svn: 279165
2016-08-18 22:04:54 +00:00
Vassil Vassilev b21ee08e57 PR28794: Don't try to instantiate function templates which are not visible.
Reviewed by Richard Smith.

llvm-svn: 279164
2016-08-18 22:01:25 +00:00
Richard Smith 49cc1ccb00 C++ Modules TS: Add parsing support for module import declaration.
llvm-svn: 279163
2016-08-18 21:59:42 +00:00
Justin Bogner 882f861cc7 CodeGen: Rename a variable to better fit LLVM style. NFC
llvm-svn: 279159
2016-08-18 21:46:54 +00:00
Saleem Abdulrasool be25c486dc CodeGen: use range based for loop, NFC
llvm-svn: 279154
2016-08-18 21:40:06 +00:00
Cameron Desrochers 6700b4910e Fixed more signed/unsigned mismatch warnings introduced in my change at r279076
llvm-svn: 279145
2016-08-18 20:56:48 +00:00
Justin Lebar cb20a09f54 [CUDA] Improve handling of math functions.
Summary:
A bunch of related changes here to our CUDA math headers.

- The second arg to nexttoward is a double (well, technically, long
  double, but we don't have that), not a float.

- Add a forward-declare of llround(float), which is defined in the CUDA
  headers.  We need this for the same reason we need most of the other
  forward-declares: To prevent a constexpr function in our standard
  library from becoming host+device.

- Add nexttowardf implementation.

- Pull "foobarf" functions defined by the CUDA headers in the global
  namespace into namespace std.  This lets you do e.g. std::sinf.

- Add overloads for math functions accepting integer types.  This lets
  you do e.g. std::sin(0) without having an ambiguity between the
  overload that takes a float and the one that takes a double.

With these changes, we pass testcases derived from libc++ for cmath and
math.h.  We can check these testcases in to the test-suite once support
for CUDA lands there.

Reviewers: tra

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23627

llvm-svn: 279140
2016-08-18 20:43:13 +00:00
Yaxun Liu dea5ccb04b Revert [OpenCL] AMDGCN: Fix size_t type
due to regressions in test/CodeGen/exprs.c on certain platforms.

llvm-svn: 279127
2016-08-18 20:01:06 +00:00
Zachary Turner 85d0f3140a Fix json compilation database syntax on non-Windows.
llvm-svn: 279122
2016-08-18 19:42:00 +00:00
Yaxun Liu 6305f8a351 [OpenCL] AMDGCN: Fix size_t type
Pointers of certain GPUs in AMDGCN target in private address space is 32 bit but pointers in other address spaces are 64 bit. size_t type should be defined as 64 bit for these GPUs so that it could hold pointers in all address spaces. Also fixed issues in pointer arithmetic codegen by using pointer specific intptr type.

Differential Revision: https://reviews.llvm.org/D23361

llvm-svn: 279121
2016-08-18 19:34:04 +00:00
Zachary Turner 9e60a2ad73 Resubmit "[Tooling] Parse compilation database command lines on Windows."
This patch introduced the ability to decide at runtime whether to parse
JSON compilation database command lines using Gnu syntax or Windows
syntax.  However, there were many existing unit tests written that
hardcoded Gnu-specific paths.  These tests were now failing because
the auto-detection logic was choosing to parse them using Windows
rules.

This resubmission of the patch fixes this by introducing an enum
which defines the syntax mode, which defaults to auto-detect, but
for which the unit tests force Gnu style parsing.

Reviewed By: alexfh
Differential Revision: https://reviews.llvm.org/D23628

llvm-svn: 279120
2016-08-18 19:31:48 +00:00
Reid Kleckner 24c8699057 [MS] Silence -Wextern-init on const selectany variables
In C, 'extern' is typically used to avoid tentative definitions when
declaring variables in headers, but adding an intializer makes it a
defintion. This is somewhat confusing, so GCC and Clang both warn on it.
In C++, 'extern' is often used to give implictly static 'const'
variables external linkage, so don't warn in that case. If selectany is
present, this might be header code intended for C and C++ inclusion, so
apply the C++ rules.

llvm-svn: 279116
2016-08-18 18:45:07 +00:00
Cameron Desrochers cc29958fb8 Removed use of 'emplace' on std::map, since not all buildbot slaves support it
llvm-svn: 279114
2016-08-18 18:41:41 +00:00
Richard Smith c33b837af3 Use __has_include rather than a configure-time macro to determine if
<sys/resource.h> is available. This should fix out-of-tree builds, at the cost
of not providing the higher rlimits to stage 1 clang when built with an old
host compiler not implementing this feature yet (bootstrap builds should be
fine, though).

llvm-svn: 279112
2016-08-18 18:22:22 +00:00
Vedant Kumar 42223732db Revert "[Driver] Use llvm-config.h, not config.h to unbreak out-of-tree builds"
This reverts commit r279035. According to Richard Smith, llvm-config.h
does not contain the right definitions.

llvm-svn: 279097
2016-08-18 17:43:02 +00:00
Manman Ren 11f2a47772 Module: add -fprebuilt-module-path to support loading prebuilt modules.
In this mode, there is no need to load any module map and the programmer can
simply use "@import" syntax to load the module directly from a prebuilt
module path. When loading from prebuilt module path, we don't support
rebuilding of the module files and we ignore compatible configuration
mismatches.

rdar://27290316
Differential Revision: http://reviews.llvm.org/D23125

llvm-svn: 279096
2016-08-18 17:42:15 +00:00
Cameron Desrochers b50c55df32 [libclang] Added missing entry for newly introduced 'clang_getAllSkippedRanges' to libclang.exports
llvm-svn: 279092
2016-08-18 17:18:03 +00:00