summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Wdocumentation fixSimon Pilgrim2016-08-201-2/+2
| | | | llvm-svn: 279382
* [analyzer] Use faster hashing (MD5) in CloneDetector.Artem Dergachev2016-08-203-93/+212
| | | | | | | | | | | | | | | 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
* [Sema] Don't crash on scanf on forward-declared enums.Benjamin Kramer2016-08-203-4/+35
| | | | | | | | 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
* PR28423: Compare primary declaration contexts.Vassil Vassilev2016-08-202-1/+7
| | | | | | | | | | | 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
* [analyzer] Make CloneDetector consider macro expansions.Artem Dergachev2016-08-204-7/+194
| | | | | | | | | | | | | | | | | 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
* [analyzer] Make CloneDetector consider template arguments.Artem Dergachev2016-08-202-2/+74
| | | | | | | | | | | 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
* Revert r279351 and r279357 due to bot failuresManman Ren2016-08-202-69/+37
| | | | llvm-svn: 279358
* Fix windows botManman Ren2016-08-201-1/+1
| | | | llvm-svn: 279357
* [NFC] Add a class ObjCProtocolQualifiers to wrap APIs for ObjC protocol list.Manman Ren2016-08-202-37/+69
| | | | | | | | | | | | | 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
* [Driver] Remove unused #include of llvm/Support/config.hVedant Kumar2016-08-191-1/+0
| | | | | | | | 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
* [www] Add nullability questions to analyzer FAQ.Devin Coughlin2016-08-191-0/+54
| | | | llvm-svn: 279330
* [CallGraph] Use decltype instead of pointer_to_unary_function. NFC.Tim Shen2016-08-191-24/+19
| | | | | | | | | | Reviewers: dblaikie Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23726 llvm-svn: 279329
* [GraphTraits] Make nodes_iterator dereference to NodeType*/NodeRefTim Shen2016-08-193-74/+20
| | | | | | | | | 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
* clang-format: [JS] handle object literals with casts.Martin Probst2016-08-192-1/+3
| | | | | | | | | | | | Summary: E.g. `{a: 1} as b`. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D23714 llvm-svn: 279250
* Fixed a typo (compilation_commands.json --> compile_commands.json).Andrey Bokhanko2016-08-191-1/+1
| | | | llvm-svn: 279240
* [AMDGPU] add s_incperflevel/s_decperflevel builtinsValery Pykhtin2016-08-193-0/+30
| | | | | | Differential revision: https://reviews.llvm.org/D23668 llvm-svn: 279235
* clang/test/Modules/prebuilt-module.m: Prune "-triple" to fix a configuration ↵NAKAMURA Takumi2016-08-191-1/+1
| | | | | | mismatch. llvm-svn: 279207
* Re-commit [OpenCL] AMDGCN: Fix size_t typeYaxun Liu2016-08-197-9/+140
| | | | | | There was a premature cast to pointer type in emitPointerArithmetic which caused assertion in tests with assertion enabled. llvm-svn: 279206
* C++ Modules TS: support parsing the 'module' declaration (including extensionsRichard Smith2016-08-198-36/+217
| | | | | | | | 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
* [www] Add analyzer FAQ about not releasing ivars in -dealloc.Devin Coughlin2016-08-191-0/+10
| | | | llvm-svn: 279183
* [analyzer] Weaken assertion in trackNullOrUndefValue()Devin Coughlin2016-08-192-5/+27
| | | | | | | | | | | | | | | | | 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
* AMDGPU: Add clang builtin for ds_swizzle.Changpeng Fang2016-08-184-0/+15
| | | | | | | | | | | 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
* PR28794: Don't try to instantiate function templates which are not visible.Vassil Vassilev2016-08-188-69/+123
| | | | | | Reviewed by Richard Smith. llvm-svn: 279164
* C++ Modules TS: Add parsing support for module import declaration.Richard Smith2016-08-187-28/+81
| | | | llvm-svn: 279163
* CodeGen: Rename a variable to better fit LLVM style. NFCJustin Bogner2016-08-181-6/+6
| | | | llvm-svn: 279159
* CodeGen: use range based for loop, NFCSaleem Abdulrasool2016-08-181-3/+2
| | | | llvm-svn: 279154
* Fixed more signed/unsigned mismatch warnings introduced in my change at r279076Cameron Desrochers2016-08-181-5/+5
| | | | llvm-svn: 279145
* [CUDA] Improve handling of math functions.Justin Lebar2016-08-182-3/+285
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert [OpenCL] AMDGCN: Fix size_t typeYaxun Liu2016-08-187-140/+9
| | | | | | due to regressions in test/CodeGen/exprs.c on certain platforms. llvm-svn: 279127
* Fix json compilation database syntax on non-Windows.Zachary Turner2016-08-181-4/+2
| | | | llvm-svn: 279122
* [OpenCL] AMDGCN: Fix size_t typeYaxun Liu2016-08-187-9/+140
| | | | | | | | 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
* Resubmit "[Tooling] Parse compilation database command lines on Windows."Zachary Turner2016-08-183-48/+101
| | | | | | | | | | | | | | | | | | 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
* [MS] Silence -Wextern-init on const selectany variablesReid Kleckner2016-08-182-3/+18
| | | | | | | | | | | | 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
* Removed use of 'emplace' on std::map, since not all buildbot slaves support itCameron Desrochers2016-08-181-2/+2
| | | | llvm-svn: 279114
* Use __has_include rather than a configure-time macro to determine ifRichard Smith2016-08-181-2/+7
| | | | | | | | | <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
* Revert "[Driver] Use llvm-config.h, not config.h to unbreak out-of-tree builds"Vedant Kumar2016-08-181-1/+1
| | | | | | | This reverts commit r279035. According to Richard Smith, llvm-config.h does not contain the right definitions. llvm-svn: 279097
* Module: add -fprebuilt-module-path to support loading prebuilt modules.Manman Ren2016-08-1819-35/+155
| | | | | | | | | | | | | 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
* [libclang] Added missing entry for newly introduced ↵Cameron Desrochers2016-08-181-0/+1
| | | | | | 'clang_getAllSkippedRanges' to libclang.exports llvm-svn: 279092
* [libclang] Fixed signed/unsigned comparison warning introduced in my ↵Cameron Desrochers2016-08-181-1/+1
| | | | | | revision r279076 llvm-svn: 279085
* [libclang] Add clang_getAllSkippedRanges functionCameron Desrochers2016-08-183-2/+116
| | | | | | | | | | This complements the clang_getSkippedRanges function which returns skipped ranges filtered by a specific file. This function is useful when all the ranges are desired (and a lot more efficient than the equivalent of asking for the ranges file by file, since the implementation of clang_getSkippedRanges iterates over all ranges anyway). Differential Revision: https://reviews.llvm.org/D20132 llvm-svn: 279076
* [analyzer] Teach CloneDetector to find clones that look like copy-paste errors.Artem Dergachev2016-08-184-23/+328
| | | | | | | | | | | | | | | | | | | The original clone checker tries to find copy-pasted code that is exactly identical to the original code, up to minor details. As an example, if the copy-pasted code has all references to variable 'a' replaced with references to variable 'b', it is still considered to be an exact clone. The new check finds copy-pasted code in which exactly one variable seems out of place compared to the original code, which likely indicates a copy-paste error (a variable was forgotten to be renamed in one place). Patch by Raphael Isemann! Differential Revision: https://reviews.llvm.org/D23314 llvm-svn: 279056
* Correct the documentation for isSignedInteger() and isUnsignedInteger().Aaron Ballman2016-08-182-4/+4
| | | | | | Patch by Visoiu Mistrih Francis llvm-svn: 279055
* Revert "[OpenMP] Sema and parsing for 'teams distribute simd’ pragma"Diana Picus2016-08-1840-4906/+12
| | | | | | | | | | | | | | | | | This reverts commit r279003 as it breaks some of our buildbots (e.g. clang-cmake-aarch64-quick, clang-x86_64-linux-selfhost-modules). The error is in OpenMP/teams_distribute_simd_ast_print.cpp: clang: /home/buildslave/buildslave/clang-cmake-aarch64-quick/llvm/include/llvm/ADT/DenseMap.h:527: bool llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::LookupBucketFor(const LookupKeyT&, const BucketT*&) const [with LookupKeyT = clang::Stmt*; DerivedT = llvm::DenseMap<clang::Stmt*, long unsigned int>; KeyT = clang::Stmt*; ValueT = long unsigned int; KeyInfoT = llvm::DenseMapInfo<clang::Stmt*>; BucketT = llvm::detail::DenseMapPair<clang::Stmt*, long unsigned int>]: Assertion `!KeyInfoT::isEqual(Val, EmptyKey) && !KeyInfoT::isEqual(Val, TombstoneKey) && "Empty/Tombstone value shouldn't be inserted into map!"' failed. llvm-svn: 279045
* revert [analyzer] Added valist related checkers.Gabor Horvath2016-08-186-739/+0
| | | | llvm-svn: 279043
* test commitGuy Blank2016-08-181-1/+1
| | | | llvm-svn: 279042
* [analyzer] Added valist related checkers.Gabor Horvath2016-08-186-0/+739
| | | | | | Differential Revision: https://reviews.llvm.org/D15227 llvm-svn: 279041
* [analyzer] Small cleanups when checkers retrieving statements from explodedGabor Horvath2016-08-186-50/+9
| | | | | | | | nodes. Differential Revision: https://reviews.llvm.org/D23550 llvm-svn: 279037
* [Driver] Use llvm-config.h, not config.h to unbreak out-of-tree buildsVedant Kumar2016-08-181-1/+1
| | | | | | | | | | llvm/Config/config.h has intentionally been excluded from llvm installations (see: llvm/CMakeLists.txt). Un-break out-of-tree builds post-r278882 by switching to llvm-config.h, which is exported. Suggested by Will Dietz! llvm-svn: 279035
* Remove debugging aids from this test and fix its expectations.Richard Smith2016-08-181-3/+1
| | | | llvm-svn: 279034
* [sanitizer-coverag] update the docs in __sanitizer_cov_trace_cmpKostya Serebryany2016-08-181-4/+4
| | | | llvm-svn: 279028
OpenPOWER on IntegriCloud