summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index/USRGeneration.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove trailing spaceFangrui Song2018-07-301-20/+20
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
* [Fixed Point Arithmetic] Addition of the remaining fixed point types and ↵Leonard Chan2018-06-141-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | their saturated equivalents This diff includes changes for the remaining _Fract and _Sat fixed point types. ``` signed short _Fract s_short_fract; signed _Fract s_fract; signed long _Fract s_long_fract; unsigned short _Fract u_short_fract; unsigned _Fract u_fract; unsigned long _Fract u_long_fract; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; short _Fract short_fract; _Fract fract; long _Fract long_fract; // Saturated fixed point types _Sat signed short _Accum sat_s_short_accum; _Sat signed _Accum sat_s_accum; _Sat signed long _Accum sat_s_long_accum; _Sat unsigned short _Accum sat_u_short_accum; _Sat unsigned _Accum sat_u_accum; _Sat unsigned long _Accum sat_u_long_accum; _Sat signed short _Fract sat_s_short_fract; _Sat signed _Fract sat_s_fract; _Sat signed long _Fract sat_s_long_fract; _Sat unsigned short _Fract sat_u_short_fract; _Sat unsigned _Fract sat_u_fract; _Sat unsigned long _Fract sat_u_long_fract; // Aliased saturated fixed point types _Sat short _Accum sat_short_accum; _Sat _Accum sat_accum; _Sat long _Accum sat_long_accum; _Sat short _Fract sat_short_fract; _Sat _Fract sat_fract; _Sat long _Fract sat_long_fract; ``` This diff only allows for declaration of these fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. Differential Revision: https://reviews.llvm.org/D46911 llvm-svn: 334718
* This diff includes changes for supporting the following types.Leonard Chan2018-06-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | // Primary fixed point types signed short _Accum s_short_accum; signed _Accum s_accum; signed long _Accum s_long_accum; unsigned short _Accum u_short_accum; unsigned _Accum u_accum; unsigned long _Accum u_long_accum; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent _Fract types will also be added in future patches. The tests included are for asserting that we can declare these types. Fixed the test that was failing by not checking for dso_local on some targets. Differential Revision: https://reviews.llvm.org/D46084 llvm-svn: 333923
* Revert "This diff includes changes for supporting the following types."Leonard Chan2018-06-021-6/+0
| | | | | | | This reverts commit r333814, which fails for a test checking the bit width on ubuntu. llvm-svn: 333815
* This diff includes changes for supporting the following types.Leonard Chan2018-06-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | ``` // Primary fixed point types signed short _Accum s_short_accum; signed _Accum s_accum; signed long _Accum s_long_accum; unsigned short _Accum u_short_accum; unsigned _Accum u_accum; unsigned long _Accum u_long_accum; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; ``` This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent `_Fract` types will also be added in future patches. The tests included are for asserting that we can declare these types. Differential Revision: https://reviews.llvm.org/D46084 llvm-svn: 333814
* Implement P0482R2, support for char8_t type.Richard Smith2018-05-011-0/+2
| | | | | | | | | | | | This is not yet part of any C++ working draft, and so is controlled by the flag -fchar8_t rather than a -std= flag. (The GCC implementation is controlled by a flag with the same name.) This implementation is experimental, and will be removed or revised substantially to match the proposal as it makes its way through the C++ committee. llvm-svn: 331244
* [Index] fix USR generation for namespace{extern{X}}Sam McCall2018-02-021-1/+3
| | | | llvm-svn: 324093
* R13575: Fix USR mangling for function pointer typesJan Korous2017-10-101-1/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D38707 llvm-svn: 315255
* PR13575: Fix USR mangling for fixed-size arraysJan Korous2017-10-091-0/+19
| | | | | | Differential Revision: https://reviews.llvm.org/D38643 llvm-svn: 315236
* Recommit "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-081-0/+1
| | | | | | | | This is a recommit of r312781; in some build configurations variable names are omitted, so changed the new regression test accordingly. llvm-svn: 312794
* Revert "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-081-1/+0
| | | | | | | The clang-with-lto-ubuntu bot didn't like the new regression test, revert while I investigate the issue. llvm-svn: 312784
* Add _Float16 as a C/C++ source language typeSjoerd Meijer2017-09-081-0/+1
| | | | | | | | | | | This adds _Float16 as a source language type, which is a 16-bit floating point type defined in C11 extension ISO/IEC TS 18661-3. In follow up patches documentation and more tests will be added. Differential Revision: https://reviews.llvm.org/D33719 llvm-svn: 312781
* [index] Add indexing for unresolved-using declarationsBen Langmuir2017-08-161-15/+33
| | | | | | | | | | | In dependent contexts we end up referencing these, so make sure they have USRs, and have their declarations indexed. For the most part they behave like typedefs, but we also need to worry about having multiple using declarations with the same "name". rdar://problem/33883650 llvm-svn: 311053
* [index] Fix forward declarations interfering with USR generation of external ↵Argyrios Kyrtzidis2017-05-201-1/+1
| | | | | | | | | source symbols Patch by Nathan Hawes. https://reviews.llvm.org/D33346 llvm-svn: 303484
* [index] Handle vector types in USR generatorAlex Lorenz2017-04-281-1/+7
| | | | | | rdar://25339187 llvm-svn: 301635
* [index] Take into account the category's external_symbol attr for ↵Argyrios Kyrtzidis2017-04-211-19/+45
| | | | | | namespacing its methods llvm-svn: 301051
* [index] Take advantage of 'external_source_symbol' attribute for indexing ↵Argyrios Kyrtzidis2017-04-211-14/+69
| | | | | | | | | purposes - Ignore decls marked as 'generated_declaration' - Include the 'defined_in' in the USR for additional namespacing llvm-svn: 300949
* [OpenCL] Correct ndrange_t implementationAnastasia Stulova2017-02-161-1/+0
| | | | | | | | | | | | | | | Removed ndrange_t as Clang builtin type and added as a struct type in the OpenCL header. Use type name to do the Sema checking in enqueue_kernel and modify IR generation accordingly. Review: D28058 Patch by Dmitry Borisenkov! llvm-svn: 295311
* [index] USR generation: use getTemplateArgs() instead of ↵Argyrios Kyrtzidis2017-02-151-2/+2
| | | | | | | | getTemplateInstantiationArgs() Otherwise we may end up creating a different USR for the definition of a function, vs its declaration. llvm-svn: 295191
* [index] Provide a more general index::generateUSRForMacro() that doesn't ↵Argyrios Kyrtzidis2017-02-021-3/+12
| | | | | | depend on having a PreprocessingRecord. llvm-svn: 293904
* [index] Handle properly C++14's template variables.Argyrios Kyrtzidis2016-11-071-0/+20
| | | | | | | | | - Infer the right symbol kind. - Provide a templated USR, similar to how we handle class templates. rdar://28980398 llvm-svn: 286154
* [index] Fix assertion hit when handling a declaration of C++'s 'operator ↵Argyrios Kyrtzidis2016-11-021-3/+8
| | | | | | | | | | | new' function. Part of this is to allow creating a USR for the canonical decl of that which is implicit and does not have a source location. rdar://28978992 llvm-svn: 285868
* [NFC] Header cleanupMehdi Amini2016-07-181-1/+0
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
* [index] Create different USR if a property is a class property.Argyrios Kyrtzidis2016-07-151-5/+6
| | | | | | Avoids USR conflicts between class & instance properties of the same name. llvm-svn: 275630
* Use more ArrayRefsDavid Majnemer2016-06-241-1/+1
| | | | | | No functional change is intended, just a small refactoring. llvm-svn: 273647
* Enable support for __float128 in Clang and enable it on pertinent platformsNemanja Ivanovic2016-05-091-0/+2
| | | | | | | | | | | | | | | | | | This patch corresponds to reviews: http://reviews.llvm.org/D15120 http://reviews.llvm.org/D19125 It adds support for the __float128 keyword, literals and target feature to enable it. Based on the latter of the two aforementioned reviews, this feature is enabled on Linux on i386/X86 as well as SystemZ. This is also the second attempt in commiting this feature. The first attempt did not enable it on required platforms which caused failures when compiling type_traits with -std=gnu++11. If you see failures with compiling this header on your platform after this commit, it is likely that your platform needs to have this feature enabled. llvm-svn: 268898
* 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
* 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
* [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
* [index] Distinguish USRs of anonymous enums by using their first enumerator.Argyrios Kyrtzidis2016-03-041-2/+11
| | | | | | rdar://24609949. llvm-svn: 262695
* [index] Include parameter types in the USRs for C functions marked with ↵Argyrios Kyrtzidis2016-03-041-1/+2
| | | | | | 'overloadable' attribute. llvm-svn: 262694
* [index] In ObjC++ handle objc type parameters for function USRs.Argyrios Kyrtzidis2016-03-041-0/+17
| | | | llvm-svn: 262693
* [AST/index] Introduce an option 'SuppressTemplateArgsInCXXConstructors' in ↵Argyrios Kyrtzidis2016-02-151-1/+6
| | | | | | | | | | 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
* Fix remaining Clang-tidy readability-redundant-control-flow warnings; other ↵Eugene Zelenko2016-02-121-5/+8
| | | | | | | | minor fixes. Differential revision: http://reviews.llvm.org/D17218 llvm-svn: 260757
* [OpenCL] Add new types for OpenCL 2.0.Alexey Bader2015-09-151-0/+10
| | | | | | | | Patch by Pedro Ferreira. Reviewers: pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D12855 llvm-svn: 247676
* Remove and forbid raw_svector_ostream::flush() calls.Yaron Keren2015-08-131-3/+0
| | | | | | | | | | After r244870 flush() will only compare two null pointers and return, doing nothing but wasting run time. The call is not required any more as the stream and its SmallString are always in sync. Thanks to David Blaikie for reviewing. llvm-svn: 244928
* Rename MacroDefinition -> MacroDefinitionRecord, ↵Richard Smith2015-05-041-1/+1
| | | | | | | | | | Preprocessor::MacroDefinition -> MacroDefinition. clang::MacroDefinition now models the currently-defined value of a macro. The previous MacroDefinition type, which represented a record of a macro definition directive for a detailed preprocessing record, is now called MacroDefinitionRecord. llvm-svn: 236400
* [libclang] Use same USR encoding for 'char' regardless of what the target ↵Argyrios Kyrtzidis2014-12-081-1/+1
| | | | | | | | considers the sign to be. Should fix the clang-hexagon-elf bot. llvm-svn: 223642
* [libclang] Encode InjectedClassNameType in the USR.Argyrios Kyrtzidis2014-12-081-0/+4
| | | | llvm-svn: 223634
* [libclang] Encode location info for anonymous embedded tag decls.Argyrios Kyrtzidis2014-12-081-1/+5
| | | | | | Otherwise the USR will conflict with different embedded tag decls. llvm-svn: 223633
* [libclang] Use same USR encoding for 'class' as 'struct'.Argyrios Kyrtzidis2014-12-081-3/+3
| | | | | | | | 'class' and 'struct' can be used interchangebly for forward references. Use the same encoding otherwise we may get into a weird situation where the USR for the same declaration is different based on whether the definition of the tag reference is visible or not. llvm-svn: 223632
* [libclang] Encode C++11 rvalue reference types in the USR.Argyrios Kyrtzidis2014-12-081-0/+5
| | | | llvm-svn: 223631
* [libclang] Encode the C++11 method reference qualifier in the USR.Argyrios Kyrtzidis2014-12-081-0/+5
| | | | llvm-svn: 223630
* [libclang] Reflect in USR generation that 'signed char' and 'unsigned char' ↵Argyrios Kyrtzidis2014-12-081-1/+2
| | | | | | can overload a 'char' in C++, by giving them distinct encodings. llvm-svn: 223629
* [libclang] Function templates can be 'overloaded' by return type, so encode ↵Argyrios Kyrtzidis2014-12-081-0/+23
| | | | | | | | the return type in the USR and handle DependentNameType in order to be able to distinguish them. llvm-svn: 223628
* Added the pack_elements range accessor. Refactoring some for loops to use ↵Aaron Ballman2014-07-151-3/+2
| | | | | | range-based for loops instead. No functional changes intended. llvm-svn: 213095
* Avoid dubious IdentifierInfo::getNameStart() usesAlp Toker2014-06-071-1/+1
| | | | | | | | These cases in particular were incurring an extra strlen() when we already knew the length. They appear to be leftovers from when the interfaces worked with C strings that have continued to compile due to the implicit StringRef ctor. llvm-svn: 210403
* [C++11] Use 'nullptr'.Craig Topper2014-05-261-1/+1
| | | | llvm-svn: 209612
* libclang/libIndex: USR generation: mangle source location into USRs for macros,Dmitri Gribenko2014-03-281-24/+53
| | | | | | unless the macro comes from a system header llvm-svn: 205064
OpenPOWER on IntegriCloud