aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Index/USRGeneration.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-05-20[index] Fix forward declarations interfering with USR generation of external ↵Argyrios Kyrtzidis1-1/+1
source symbols Patch by Nathan Hawes. https://reviews.llvm.org/D33346 llvm-svn: 303484
2017-04-28[index] Handle vector types in USR generatorAlex Lorenz1-1/+7
rdar://25339187 llvm-svn: 301635
2017-04-21[index] Take into account the category's external_symbol attr for ↵Argyrios Kyrtzidis1-19/+45
namespacing its methods llvm-svn: 301051
2017-04-21[index] Take advantage of 'external_source_symbol' attribute for indexing ↵Argyrios Kyrtzidis1-14/+69
purposes - Ignore decls marked as 'generated_declaration' - Include the 'defined_in' in the USR for additional namespacing llvm-svn: 300949
2017-02-16[OpenCL] Correct ndrange_t implementationAnastasia Stulova1-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
2017-02-15[index] USR generation: use getTemplateArgs() instead of ↵Argyrios Kyrtzidis1-2/+2
getTemplateInstantiationArgs() Otherwise we may end up creating a different USR for the definition of a function, vs its declaration. llvm-svn: 295191
2017-02-02[index] Provide a more general index::generateUSRForMacro() that doesn't ↵Argyrios Kyrtzidis1-3/+12
depend on having a PreprocessingRecord. llvm-svn: 293904
2016-11-07[index] Handle properly C++14's template variables.Argyrios Kyrtzidis1-0/+20
- Infer the right symbol kind. - Provide a templated USR, similar to how we handle class templates. rdar://28980398 llvm-svn: 286154
2016-11-02[index] Fix assertion hit when handling a declaration of C++'s 'operator ↵Argyrios Kyrtzidis1-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
2016-07-18[NFC] Header cleanupMehdi Amini1-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
2016-07-15[index] Create different USR if a property is a class property.Argyrios Kyrtzidis1-5/+6
Avoids USR conflicts between class & instance properties of the same name. llvm-svn: 275630
2016-06-24Use more ArrayRefsDavid Majnemer1-1/+1
No functional change is intended, just a small refactoring. llvm-svn: 273647
2016-05-09Enable support for __float128 in Clang and enable it on pertinent platformsNemanja Ivanovic1-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
2016-04-15Revert 266186 as it breaks anything that includes type_traits on some platformsNemanja Ivanovic1-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
2016-04-13Enable support for __float128 in ClangNemanja Ivanovic1-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
2016-04-13[OpenCL] Move OpenCLImageTypes.def from clangAST to clangBasic library.Alexey Bader1-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
2016-04-08[OpenCL] Complete image types support.Alexey Bader1-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
2016-03-04[index] Distinguish USRs of anonymous enums by using their first enumerator.Argyrios Kyrtzidis1-2/+11
rdar://24609949. llvm-svn: 262695
2016-03-04[index] Include parameter types in the USRs for C functions marked with ↵Argyrios Kyrtzidis1-1/+2
'overloadable' attribute. llvm-svn: 262694
2016-03-04[index] In ObjC++ handle objc type parameters for function USRs.Argyrios Kyrtzidis1-0/+17
llvm-svn: 262693
2016-02-15[AST/index] Introduce an option 'SuppressTemplateArgsInCXXConstructors' in ↵Argyrios Kyrtzidis1-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
2016-02-12Fix remaining Clang-tidy readability-redundant-control-flow warnings; other ↵Eugene Zelenko1-5/+8
minor fixes. Differential revision: http://reviews.llvm.org/D17218 llvm-svn: 260757
2015-09-15[OpenCL] Add new types for OpenCL 2.0.Alexey Bader1-0/+10
Patch by Pedro Ferreira. Reviewers: pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D12855 llvm-svn: 247676
2015-08-13Remove and forbid raw_svector_ostream::flush() calls.Yaron Keren1-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
2015-05-04Rename MacroDefinition -> MacroDefinitionRecord, ↵Richard Smith1-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
2014-12-08[libclang] Use same USR encoding for 'char' regardless of what the target ↵Argyrios Kyrtzidis1-1/+1
considers the sign to be. Should fix the clang-hexagon-elf bot. llvm-svn: 223642
2014-12-08[libclang] Encode InjectedClassNameType in the USR.Argyrios Kyrtzidis1-0/+4
llvm-svn: 223634
2014-12-08[libclang] Encode location info for anonymous embedded tag decls.Argyrios Kyrtzidis1-1/+5
Otherwise the USR will conflict with different embedded tag decls. llvm-svn: 223633
2014-12-08[libclang] Use same USR encoding for 'class' as 'struct'.Argyrios Kyrtzidis1-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
2014-12-08[libclang] Encode C++11 rvalue reference types in the USR.Argyrios Kyrtzidis1-0/+5
llvm-svn: 223631
2014-12-08[libclang] Encode the C++11 method reference qualifier in the USR.Argyrios Kyrtzidis1-0/+5
llvm-svn: 223630
2014-12-08[libclang] Reflect in USR generation that 'signed char' and 'unsigned char' ↵Argyrios Kyrtzidis1-1/+2
can overload a 'char' in C++, by giving them distinct encodings. llvm-svn: 223629
2014-12-08[libclang] Function templates can be 'overloaded' by return type, so encode ↵Argyrios Kyrtzidis1-0/+23
the return type in the USR and handle DependentNameType in order to be able to distinguish them. llvm-svn: 223628
2014-07-15Added the pack_elements range accessor. Refactoring some for loops to use ↵Aaron Ballman1-3/+2
range-based for loops instead. No functional changes intended. llvm-svn: 213095
2014-06-07Avoid dubious IdentifierInfo::getNameStart() usesAlp Toker1-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
2014-05-26[C++11] Use 'nullptr'.Craig Topper1-1/+1
llvm-svn: 209612
2014-03-28libclang/libIndex: USR generation: mangle source location into USRs for macros,Dmitri Gribenko1-24/+53
unless the macro comes from a system header llvm-svn: 205064
2014-03-23remove a bunch of unused private methodsNuno Lopes1-10/+0
found with a smarter version of -Wunused-member-function that I'm playwing with. Appologies in advance if I removed someone's WIP code. ARCMigrate/TransProperties.cpp | 8 ----- AST/MicrosoftMangle.cpp | 1 Analysis/AnalysisDeclContext.cpp | 5 --- Analysis/LiveVariables.cpp | 14 ---------- Index/USRGeneration.cpp | 10 ------- Sema/Sema.cpp | 33 +++++++++++++++++++++--- Sema/SemaChecking.cpp | 3 -- Sema/SemaDecl.cpp | 20 ++------------ StaticAnalyzer/Checkers/GenericTaintChecker.cpp | 1 9 files changed, 34 insertions(+), 61 deletions(-) llvm-svn: 204561
2014-03-17[C++11] Replacing FunctionProtoType iterators param_type_begin() and ↵Aaron Ballman1-5/+2
param_type_end() with iterator_range param_types(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 204045
2014-03-07[C++11] Replacing FunctionDecl iterators param_begin() and param_end() with ↵Aaron Ballman1-5/+2
iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203248
2014-02-23[Index] Make the USRs more stable.Argyrios Kyrtzidis1-17/+30
- Only include offsets with local (in function scope) symbols, where we don't encode scoping - Only include the filename with non-system symbols. Presumably the system headers will not provide conflicting definitions. rdar://15976823 llvm-svn: 201990
2014-01-25Rename getResultType() on function and method declarations to getReturnType()Alp Toker1-1/+1
A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082
2014-01-20Rename FunctionProtoType accessors from 'arguments' to 'parameters'Alp Toker1-2/+3
Fix a perennial source of confusion in the clang type system: Declarations and function prototypes have parameters to which arguments are supplied, so calling these 'arguments' was a stretch even in C mode, let alone C++ where default arguments, templates and overloading make the distinction important to get right. Readability win across the board, especially in the casting, ADL and overloading implementations which make a lot more sense at a glance now. Will keep an eye on the builders and update dependent projects shortly. No functional change. llvm-svn: 199686
2013-08-21Avoid using the 'index' namespace as scope.Argyrios Kyrtzidis1-16/+19
This should fix the bogus ambiguous reference errors reported by gcc 4.2.1 that the FreeBSD bot is using. llvm-svn: 188850
2013-08-17Rename libIDE to libIndex.Argyrios Kyrtzidis1-0/+800
Per feedback from Chandler, it's better to have libraries with more specific functionality. LibIndex will contain the indexing functionality of libclang, which includes USR generation. llvm-svn: 188601