summaryrefslogtreecommitdiffstats
path: root/clang/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [scan-build] fix dead store warnings emitted on clang code baseDavid Blaikie2016-05-031-2/+2
| | | | | | | | | | | | | This fixes dead store warnings of the type "dead assignment" reported by CLang Static Analyzer on the following file: - tools/c-index-test/c-index-test.c. Patch by Apelete Seketeli <apelete@seketeli.net>! Differential Revision: http://reviews.llvm.org/D19831 llvm-svn: 268453
* [libclang] Expose the ElaboratedTypeSergey Kalinichev2016-05-032-0/+13
| | | | | | Differential Revision: http://reviews.llvm.org/D11797 llvm-svn: 268366
* Expose cxx constructor and method properties through libclang and python ↵Jonathan Coe2016-04-273-1/+69
| | | | | | | | | | | | | | | | | | | | | | | bindings. Summary: I have exposed the following function through libclang and the clang.cindex python bindings: clang_CXXConstructor_isConvertingConstructor, clang_CXXConstructor_isCopyConstructor, clang_CXXConstructor_isDefaultConstructor, clang_CXXConstructor_isMoveConstructor, clang_CXXMethod_isDefaulted I need (some of) these methods for a C++ code model I am building in Python to drive a code generator. Reviewers: compnerd, skalinichev Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15469 llvm-svn: 267706
* driver: Add a `--rsp-quoting` flag to pick response file quoting.Nico Weber2016-04-251-5/+12
| | | | | | | | | | | | | | | | | | | | Currently, clang-cl always uses Windows style for unquoting, and clang always uses POSIX style for unquoting. With this flag, it's possible to change these defaults. In general, response file quoting should match the shell the response file is used in. On Windows, it's possible to run clang-cl in a bash shell, or clang in cmd.exe, so a flag for overriding the default behavior is natural there. On non-Windows, Windows quoting probably never makes sense (except maybe in Wine), but having clang-cl behave differently based on the host OS seems strange too. So require that people who want to use posix-style response files with clang-cl on non-Windows pass --rsp-quoting=posix. http://reviews.llvm.org/D19425 llvm-svn: 267474
* [index] Add a SymbolSubKind for an ObjC unit test.Argyrios Kyrtzidis2016-04-221-1/+2
| | | | llvm-svn: 267117
* [index] Change SymbolCXXTemplateKind to a 'SymbolSubKinds' bitset.Argyrios Kyrtzidis2016-04-222-13/+11
| | | | | | This provides a more general and flexible way to annotate special symbols. llvm-svn: 267116
* MarkEOLs should only be true for clang-cl.exe.Stephen Hines2016-04-201-5/+13
| | | | | | | | | | | | | | | | | | | | | Summary: https://llvm.org/bugs/show_bug.cgi?id=27396 This fixes an issue in response files where "\r\n" was being interpreted as two EOL markers (i.e. we consumed the '\r' as terminating the previous token, and then parsed the '\n' as a significant EOL). This breaks response files where joined arguments get split across multiple lines (like "-x\r\nc"). I also fixed an accidental issue in the response-file.c test, where the response file is appended to, instead of being overwritten. Reviewers: rnk Subscribers: danalbert, llvm-commits Differential Revision: http://reviews.llvm.org/D19289 llvm-svn: 266840
* cc1as: Don't crash when CIE is requested and no DWARF version is specified.Adrian Prantl2016-04-191-1/+1
| | | | | | | | | This patch changes the default DWARF version for cc1as from invalid 0 to 2, which should be the lowest common denominator on all platforms. rdar://problem/24735813 llvm-svn: 266814
* D17487: [analyzer][scan-build-py] flag filter modification for compilation ↵Laszlo Nagy2016-04-1920-735/+823
| | | | | | database creation llvm-svn: 266726
* Revert 266186 as it breaks anything that includes type_traits on some platformsNemanja Ivanovic2016-04-151-2/+0
| | | | | | | | | | Since this patch provided support for the __float128 type but disabled it on all platforms by default, some platforms can't compile type_traits with -std=gnu++11 since there is a specialization with __float128. This reverts the patch until D19125 is approved (i.e. we know which platforms need this support enabled). llvm-svn: 266460
* libclang: Use early-return to reduce indentation.David Blaikie2016-04-131-104/+96
| | | | | | | & since I'll get blamed for all the lines anyway, remove some else-after-return and otherwise tidy things up. llvm-svn: 266224
* Simplify memory management of CXEvalResultKind/ExprEvalResult using ↵David Blaikie2016-04-131-39/+28
| | | | | | | | | | | unique_ptr and a dtor This doesn't seem to need to be a C type, C only handles a void*, so use new/delete as usual to simplify allocation and cleanup. Follow-up to r265994 llvm-svn: 266222
* Enable support for __float128 in ClangNemanja Ivanovic2016-04-131-0/+2
| | | | | | | | | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D15120 It adds support for the __float128 keyword, literals and a target feature to enable it. This support is disabled by default on all targets and any target that has support for this type is free to add it. Based on feedback that I've received from target maintainers, this appears to be the right thing for most targets. I have not heard from the maintainers of X86 which I believe supports this type. I will subsequently investigate the impact of enabling this on X86. llvm-svn: 266186
* [OpenCL] Move OpenCLImageTypes.def from clangAST to clangBasic library.Alexey Bader2016-04-131-1/+1
| | | | | | | | | | Putting OpenCLImageTypes.def to clangAST library violates layering requirement: "It's not OK for a Basic/ header to include an AST/ header". This fixes the modules build. Differential revision: http://reviews.llvm.org/D18954 Reviewers: Richard Smith, Vassil Vassilev. llvm-svn: 266180
* libclang: fix two memory leaks (PR26292)Hans Wennborg2016-04-111-2/+3
| | | | llvm-svn: 265994
* [Perf-Training] Reworked workflow improvements for order-file generationChris Bieneman2016-04-081-2/+19
| | | | | | | | | | | | | | | | | | | This is re-landing r260742. I've reworked the conditionals so that it only hits when targeting Apple platforms with ld64. Original Summary: With this change generating clang order files using dtrace uses the following workflow: cmake <whatever options you want> ninja generate-order-file ninja clang This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one. CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file. llvm-svn: 265864
* [OpenCL] Complete image types support.Alexey Bader2016-04-081-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I. Current implementation of images is not conformant to spec in the following points: 1. It makes no distinction with respect to access qualifiers and therefore allows to use images with different access type interchangeably. The following code would compile just fine: void write_image(write_only image2d_t img); kernel void foo(read_only image2d_t img) { write_image(img); } // Accepted code which is disallowed according to s6.13.14. 2. It discards access qualifier on generated code, which leads to generated code for the above example: call void @write_image(%opencl.image2d_t* %img); In OpenCL2.0 however we can have different calls into write_image with read_only and wite_only images. Also generally following compiler steps have no easy way to take different path depending on the image access: linking to the right implementation of image types, performing IR opts and backend codegen differently. 3. Image types are language keywords and can't be redeclared s6.1.9, which can happen currently as they are just typedef names. 4. Default access qualifier read_only is to be added if not provided explicitly. II. This patch corrects the above points as follows: 1. All images are encapsulated into a separate .def file that is inserted in different points where image handling is required. This avoid a lot of code repetition as all images are handled the same way in the code with no distinction of their exact type. 2. The Cartesian product of image types and image access qualifiers is added to the builtin types. This simplifies a lot handling of access type mismatch as no operations are allowed by default on distinct Builtin types. Also spec intended access qualifier as special type qualifier that are combined with an image type to form a distinct type (see statement above - images can't be created w/o access qualifiers). 3. Improves testing of images in Clang. Author: Anastasia Stulova Reviewers: bader, mgrang. Subscribers: pxli168, pekka.jaaskelainen, yaxunl. Differential Revision: http://reviews.llvm.org/D17821 llvm-svn: 265783
* [c-index-test] Fix leak in print_completion_result, NFCVedant Kumar2016-04-031-3/+5
| | | | llvm-svn: 265252
* [index] Fix regression where ObjC method declarations may mistakenly get ↵Argyrios Kyrtzidis2016-03-311-11/+17
| | | | | | | | indexed as definition. rdar://25372906 llvm-svn: 265042
* [c-index-test] Delete dead function, NFCVedant Kumar2016-03-301-19/+0
| | | | llvm-svn: 264874
* [Order Files] Fix order file usageChris Bieneman2016-03-291-1/+1
| | | | | | The CMake EXISTS operator needs to have the variable expanded. Not expanding this was causing the if statement to always be false, which made it impossible to pass linker order files in. llvm-svn: 264757
* [index] Remove redundancy between symbol kind and languageBen Langmuir2016-03-251-24/+34
| | | | | | | | | Condense the ObjCKIND and CXXKIND options into just KIND, since the language was already specified on a per-symbol basis and this information was redundant. This only changes the internal representation; naturally the libclang interface remains the same. llvm-svn: 264423
* Add attributes for preserve_mostcc/preserve_allcc calling conventions to the ↵Roman Levenstein2016-03-161-0/+2
| | | | | | | | | | | | | | | C/C++ front-end Till now, preserve_mostcc/preserve_allcc calling convention attributes were only available at the LLVM IR level. This patch adds attributes for preserve_mostcc/preserve_allcc calling conventions to the C/C++ front-end. The code was mostly written by Juergen Ributzka. I just added support for the AArch64 target and tests. Differential Revision: http://reviews.llvm.org/D18025 llvm-svn: 263647
* [OPENMP 4.5] Codegen for data members in 'linear' clause.Alexey Bataev2016-03-091-0/+1
| | | | | | | OpenMP 4.5 allows to use data members in private clauses. Patch adds codegen support for 'linear' clause. llvm-svn: 263002
* [index] libclang: Make sure to treat forward ObjC protocols as ↵Argyrios Kyrtzidis2016-03-091-0/+8
| | | | | | | | ObjCProtocolRef declarations, and fix related crash. rdar://25035376 llvm-svn: 262985
* [OPENMP] Simplify handling of clauses with postupdates, NFC.Alexey Bataev2016-03-041-2/+1
| | | | | | | Clauses with post-update expressions always have pre-init statement. So OMPClauseWithPreInit now is the base for OMPClauseWithPostUpdate. llvm-svn: 262696
* Tweak CMakeLists not for libclang to depend on the variable ↵NAKAMURA Takumi2016-03-032-2/+4
| | | | | | CLANG_TOOL_EXTRA_BUILD. llvm-svn: 262606
* [libclang] Link clang-tidy plugin into libclang if present.Benjamin Kramer2016-03-032-0/+12
| | | | | | | | | | | | This is a sad workaround for the lack of plugin support in libclang. Depends on D17807, a tools-extra change that also contains the test case. This is designed to be easy to remove again if libclang ever grows proper plugin support. Differential Revision: http://reviews.llvm.org/D17808 llvm-svn: 262596
* Semantic analysis for the swiftcall calling convention.John McCall2016-03-031-0/+1
| | | | | | | I've tried to keep the infrastructure behind parameter ABI treatments fairly general. llvm-svn: 262587
* [OPENMP 4.0] Initial support for 'omp declare reduction' construct.Alexey Bataev2016-03-031-0/+1
| | | | | | | | | | | | | | | | | Add parsing, sema analysis and serialization/deserialization for 'declare reduction' construct. User-defined reductions are defined as #pragma omp declare reduction( reduction-identifier : typename-list : combiner ) [initializer ( initializer-expr )] These custom reductions may be used in 'reduction' clauses of OpenMP constructs. The combiner specifies how partial results can be combined into a single value. The combiner can use the special variable identifiers omp_in and omp_out that are of the type of the variables being reduced with this reduction-identifier. Each of them will denote one of the values to be combined before executing the combiner. It is assumed that the special omp_out identifier will refer to the storage that holds the resulting combined value after executing the combiner. As the initializer-expr value of a user-defined reduction is not known a priori the initializer-clause can be used to specify one. Then the contents of the initializer-clause will be used as the initializer for private copies of reduction list items where the omp_priv identifier will refer to the storage to be initialized. The special identifier omp_orig can also appear in the initializer-clause and it will refer to the storage of the original variable to be reduced. Differential Revision: http://reviews.llvm.org/D11182 llvm-svn: 262582
* Serialize `#pragma detect_mismatch`.Nico Weber2016-03-021-0/+1
| | | | | | | This is like r262493, but for pragma detect_mismatch instead of pragma comment. The two pragmas have similar behavior, so use the same approach for both. llvm-svn: 262506
* Serialize `#pragma comment`.Nico Weber2016-03-021-0/+1
| | | | | | | | | | | | | | `#pragma comment` was handled by Sema calling a function on ASTConsumer, and CodeGen then implementing this function and writing things to its output. Instead, introduce a PragmaCommentDecl AST node and hang one off the TranslationUnitDecl for every `#pragma comment` line, and then use the regular serialization machinery. (Since PragmaCommentDecl has codegen relevance, it's eagerly deserialized.) http://reviews.llvm.org/D17799 llvm-svn: 262493
* [OPENMP 4.5] Codegen for data members in 'reduction' clause.Alexey Bataev2016-03-021-0/+2
| | | | | | | | OpenMP 4.5 allows to privatize non-static data members of current class in non-static member functions. Patch supports codegen for non-static data members in 'reduction' clauses. llvm-svn: 262460
* Optionally demote fatal errors to non-fatal errors.Manuel Klimek2016-03-012-0/+5
| | | | | | | | | | | | | | | | | | This behavior is enabled when the new CXTranslationUnit_KeepGoing option is passed to clang_parseTranslationUnit{,2}. It is geared towards use by IDEs and similar consumers of the clang-c API where fatal errors may arise when parsing incomplete code mid-edit, or when include paths are not properly configured yet. In such situations one still wants to get as much information as possible about a TU. Previously, the semantic analysis would not instantiate templates or report additional fatal errors after the first fatal error was encountered. Fixes PR24268. Patch by Milian Wolff. llvm-svn: 262318
* [index] Print and test module import references.Argyrios Kyrtzidis2016-02-291-0/+20
| | | | llvm-svn: 262208
* [OPENMP 4.5] Codegen for member decls in 'lastprivate' clause.Alexey Bataev2016-02-251-0/+8
| | | | | | | | | OpenMP 4.5 allows to privatize non-static member decls in non-static member functions. Patch captures such decls by reference in general (for bitfields, by value) and then operates with this capture. For bitfields, at the end of codegen for lastprivates original bitfield is updated with the value of captured copy. llvm-svn: 261824
* [CMake] Add install-clang-format target by migrating to add_clang_toolChris Bieneman2016-02-231-8/+19
| | | | | | This change migrates clang-format to add_clang_tool which makes a component-based install target. To support component-based installation the extra installed scripts all need to have the "clang-format" component too. llvm-svn: 261680
* [analyzer][scan-build] Non-existing directory for scan-build output.Anton Yartsev2016-02-211-1/+6
| | | | | | | Makes scan-build successfully accept non-existing output directories provided via "-o" option. The directory is created in this case. This behavior is conforming to the old perl scan-build implementation. (http://reviews.llvm.org/D17091) llvm-svn: 261480
* [c-index-test] CMake: When installing c-index-test to a different prefix ↵Argyrios Kyrtzidis2016-02-201-0/+2
| | | | | | | | directory, add an rpath so that it can find libclang. llvm-svn: 261445
* [analyzer] Add --force-analyze-debug-code option to scan-buildYury Gribov2016-02-185-7/+59
| | | | | | | | | | | | | | to force debug build and hopefully enable more precise warnings. Static Analyzer is much more efficient when built in debug mode (-UNDEBUG) so we advice users to enable it manually. This may be inconvenient in case of large complex projects (think about Linux distros e.g. Android or Tizen). This patch adds a flag to scan-build which inserts -UNDEBUG automatically. Differential Revision: http://reviews.llvm.org/D16200 llvm-svn: 261204
* [OPENMP 4.5] Codegen support for data members in 'firstprivate' clause.Alexey Bataev2016-02-171-0/+7
| | | | | | Added codegen for captured data members in non-static member functions. llvm-svn: 261089
* [cmake] Revert r260742 (and r260744) to improve order file support.Chandler Carruth2016-02-171-18/+2
| | | | | | | | | | This appears to be passing '-Wl,-order_file' to Linux link commands, which then causes the linker to silently, behind the scenes, write the output to 'rder_file' instead of somewhere else. Will work with Chris to figure out the proper support for this, but so far there are numerous people who can't get Clang to update when they build because of this. llvm-svn: 261054
* [OPENMP] Improved handling of pseudo-captured expressions in OpenMP.Alexey Bataev2016-02-161-4/+10
| | | | | | | | Expressions inside 'schedule'|'dist_schedule' clause must be captured in combined directives to avoid possible crash during codegen. Patch improves handling of such constructs llvm-svn: 260954
* [AST/index] Introduce an option 'SuppressTemplateArgsInCXXConstructors' in ↵Argyrios Kyrtzidis2016-02-151-4/+1
| | | | | | | | | | printing policy. Enable it for USRs and names when indexing. Forward references can have different template argument names; including them makes USRs and names unstable, since the name depends on whether we saw a forward reference or not. llvm-svn: 260866
* silence -Wreturn-type warningsSaleem Abdulrasool2016-02-151-0/+3
| | | | | | | | These codepaths would generate warnings with GCC on linux even though the switch was covered. Add llvm_unreachable markers to indicate that the switch should be covered. NFC. llvm-svn: 260865
* [index] Factor libclang's functionality to determing the mangled name of ↵Argyrios Kyrtzidis2016-02-142-124/+17
| | | | | | symbols into the clangIndex library. llvm-svn: 260858
* Don't leak the ASTUnit when done with testing.Benjamin Kramer2016-02-141-3/+2
| | | | | | Found by lsan. llvm-svn: 260850
* c-index-test: Fix libdeps corresponding to r260841.NAKAMURA Takumi2016-02-141-0/+3
| | | | llvm-svn: 260847
* [c-index-test] Fix a gcc build error.Argyrios Kyrtzidis2016-02-141-1/+1
| | | | llvm-svn: 260844
* [index] Fix gcc builds.Argyrios Kyrtzidis2016-02-141-1/+2
| | | | llvm-svn: 260843
OpenPOWER on IntegriCloud