summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang
Commit message (Collapse)AuthorAgeFilesLines
* Fix array_pod_sort predicates after LLVM change.Benjamin Kramer2013-09-221-12/+3
| | | | llvm-svn: 191176
* Add the intrinsic __builtin_convertvectorHal Finkel2013-09-182-0/+2
| | | | | | | | | | | | | | | | | | LLVM supports applying conversion instructions to vectors of the same number of elements (fptrunc, fptosi, etc.) but there had been no way for a Clang user to cause such instructions to be generated when using builtin vector types. C-style casting on vectors is already defined in terms of bitcasts, and so cannot be used for these conversions as well (without leading to a very confusing set of semantics). As a result, this adds a __builtin_convertvector intrinsic (patterned after the OpenCL __builtin_astype intrinsic). This is intended to aid the creation of vector intrinsic headers that create generic IR instead of target-dependent intrinsics (in other words, this is a generic _mm_cvtepi32_ps). As noted in the documentation, the action of __builtin_convertvector is defined in terms of the action of a C-style cast on each vector element. llvm-svn: 190915
* [libclang] Don't report a DecayedType as "unexposed", report it as the ↵Argyrios Kyrtzidis2013-09-161-0/+5
| | | | | | | | original (as written) type. Patch by Anders Waldenborg! llvm-svn: 190796
* Remove unnecessary inclusion of Sema.hDavid Blaikie2013-09-135-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let me tell you a tale... Within some twisted maze of debug info I've ended up implementing an insane man's Include What You Use device. When the debugger emits debug info it really shouldn't, I find out why & then realize the code could be improved too. In this instance CIndexDiagnostics.cpp had a lot more debug info with Clang than GCC. Upon inspection a major culprit was all the debug info describing clang::Sema. This was emitted because clang::Sema is befriended by DiagnosticEngine which was rightly required, but GCC doesn't emit debug info for friends so it never emitted anything for Clang. Clang does emit debug info for friends (will be fixed/changed to reduce debug info size). But why didn't Clang just emit a declaration of Sema if this entire TU didn't require a definition? 1) Diagnostic.h did the right thing, only using a declaration of Sema and not including Sema.h at all. 2) Some other dependency of CIndexDiagnostics.cpp didn't do the right thing. ASTUnit.h, only needing a declaration, still included Sema.h (hence this commit which removes that include and adds the necessary includes to the cpp files that were relying on this) 3) -flimit-debug-info didn't save us because of EnterExpressionEvaluationContext, defined inline in Sema.h which fires the "requiresCompleteType" check/flag (since it uses nested types from Sema and calls Sema member functions) and thus, if debug info is ever emitted for the type, the whole type is emitted and not just a declaration. Improving -flimit-debug-info to account for this would be... hard. Modifying the code so that's not 'required to be complete' might be possible, but probably only by moving EnterExpressionEvaluationContext either into Sema, or out of Sema.h. That might be a bit too much of a contortion to be bothered with. Also, this is only one of the cases where emitting debug info for friends caused us to emit a lot more debug info (this change reduces Clang's DWO size by 0.93%, dropping friends entirely reduces debug info by 3.2%) - I haven't hunted down the other cases, but I assume they might be similar (Sema or something like it). IWYU or a similar tool might help us reduce build times a bit, but analyzing debug info to find these differences isn't worthwhile. I'll take the 3.2% win, provide this small improvement to the code itself, and move on. llvm-svn: 190715
* [libclang] In clang_getLocation, check that the provided line/column is valid.Argyrios Kyrtzidis2013-09-121-0/+2
| | | | | | rdar://14971432 llvm-svn: 190568
* Fix 2 cases of uninitialized reads of an invalid PresumedLoc.Evgeniy Stepanov2013-09-111-13/+15
| | | | | | | | | The code in CGExpr was added back in 2012 (r165536) but not exercised in tests until recently. Detected on the MemorySanitizer bootstrap bot. llvm-svn: 190521
* OpenMP: Data-sharing attributes analysis and clause 'shared' (fixed test ↵Alexey Bataev2013-09-062-0/+9
| | | | | | threadprivate_messages.cpp) llvm-svn: 190183
* Remove unused typedef.Eric Christopher2013-09-031-1/+0
| | | | llvm-svn: 189844
* Revert "OpenMP: Data-sharing attributes analysis and clause 'shared'"Rafael Espindola2013-09-032-9/+0
| | | | | | | | This reverts commit r189795. threadprivate_messages.cpp is faling on windows. llvm-svn: 189811
* OpenMP: Data-sharing attributes analysis and clause 'shared'Alexey Bataev2013-09-032-0/+9
| | | | llvm-svn: 189795
* Add ms_abi and sysv_abi attribute handling.Charles Davis2013-08-301-0/+2
| | | | | | Based on a patch by Benno Rice! llvm-svn: 189644
* Delete CC_Default and use the target default CC everywhereReid Kleckner2013-08-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Makes functions with implicit calling convention compatible with function types with a matching explicit calling convention. This fixes things like calls to qsort(), which has an explicit __cdecl attribute on the comparator in Windows headers. Clang will now infer the calling convention from the declarator. There are two cases when the CC must be adjusted during redeclaration: 1. When defining a non-inline static method. 2. When redeclaring a function with an implicit or mismatched convention. Fixes PR13457, and allows clang to compile CommandLine.cpp for the Microsoft C++ ABI. Excellent test cases provided by Alexander Zinenko! Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1231 llvm-svn: 189412
* Use pop_back_val() instead of both back() and pop_back().Robert Wilhelm2013-08-231-2/+1
| | | | | | No functionality change intended. llvm-svn: 189112
* Split isFromMainFile into two functions.Eli Friedman2013-08-221-1/+1
| | | | | | | | | Basically, isInMainFile considers line markers, and isWrittenInMainFile doesn't. Distinguishing between the two is useful when dealing with files which are preprocessed files or rewritten with -frewrite-includes (so we don't, for example, print useless warnings). llvm-svn: 188968
* Remove more uses of 'index' as namespace scope.Argyrios Kyrtzidis2013-08-211-6/+6
| | | | | | Follow up to r188850. llvm-svn: 188854
* Avoid using the 'index' namespace as scope.Argyrios Kyrtzidis2013-08-211-8/+9
| | | | | | This should fix the bogus ambiguous reference errors reported by gcc 4.2.1 that the FreeBSD bot is using. llvm-svn: 188850
* Use cstdio instead of stdio.hDmitri Gribenko2013-08-192-2/+2
| | | | llvm-svn: 188678
* libclang: cleanup unused includes in public headerDmitri Gribenko2013-08-182-0/+2
| | | | llvm-svn: 188625
* Rename libIDE to libIndex.Argyrios Kyrtzidis2013-08-173-17/+17
| | | | | | | 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
* Replace some DenseMap keys with simpler structures that don't need another ↵Benjamin Kramer2013-08-161-34/+1
| | | | | | DenseMapInfo specialization. llvm-svn: 188580
* Introduce the clangIDE library.Argyrios Kyrtzidis2013-08-163-814/+35
| | | | | | | | | | Libclang has a lot of functionality that is inaccessible. The purpose of clangIDE is to move most of the functionality of libclang to it so we can expose it and have libclang be more of a thin C wrapper over clangIDE. Start by moving the USR generation functionality into clangIDE. llvm-svn: 188569
* Added source locs for angled parentheses in class/var template partial specs.Enea Zaffanella2013-08-102-5/+8
| | | | llvm-svn: 188134
* Add clang_Location_isFromMainFile() to libclang.Stefanus Du Toit2013-08-082-0/+12
| | | | | | | | Also bump the minor version number and update libclang.exports. Reviewed by: Dmitri Gribenko, Doug Gregor llvm-svn: 187994
* Started implementing variable templates. Top level declarations should be ↵Larisse Voufo2013-08-062-1/+99
| | | | | | fully supported, up to some limitations documented as FIXMEs or TODO. Static data member templates work very partially. Static data member templates of class templates need particular attention... llvm-svn: 187762
* Assume UniqueID is zero for invalid PPRegion to fix uninitialized reads ↵Alexey Samsonov2013-08-021-1/+1
| | | | | | reported by MSan llvm-svn: 187647
* Use llvm::sys::fs::UniqueID for windows and unix.Rafael Espindola2013-08-012-27/+25
| | | | | | | | | | | | | | | | | | | This unifies the unix and windows versions of FileManager::UniqueDirContainer and FileManager::UniqueFileContainer by using UniqueID. We cannot just replace "struct stat" with llvm::sys::fs::file_status, since we want to be able to construct fake ones, and file_status has different members on unix and windows. What the patch does is: * Record only the information that clang is actually using. * Use llvm::sys::fs::status instead of stat and fstat. * Use llvm::sys::fs::UniqueID * Delete the old windows versions of UniqueDirContainer and UniqueFileContainer since the "unix" one now works on windows too. llvm-svn: 187619
* [libclang] Expose the rest of the array types.Argyrios Kyrtzidis2013-07-231-0/+24
| | | | | | Patch by Che-Liang Chiou! llvm-svn: 186967
* OpenMP: basic support for #pragma omp parallelAlexey Bataev2013-07-193-0/+102
| | | | llvm-svn: 186647
* Use SmallVectorImpl::reverse_iterator instead of SmallVector to avoid ↵Craig Topper2013-07-081-1/+1
| | | | | | specifying the vector size. llvm-svn: 185784
* [libclang] Add the new function to libclang.exportsArgyrios Kyrtzidis2013-07-051-0/+1
| | | | llvm-svn: 185725
* [libclang] Introduce clang_Cursor_isObjCOptional, which returns whether the ↵Argyrios Kyrtzidis2013-07-051-0/+13
| | | | | | | | declaration was affected by "@optional" rdar://14348525. llvm-svn: 185722
* Use SmallVectorImpl instead of SmallVector for iterators and references to ↵Craig Topper2013-07-043-6/+6
| | | | | | avoid specifying the vector size unnecessarily. llvm-svn: 185610
* Following the modification introduced in llvm by commit 185311Sylvestre Ledru2013-07-011-2/+2
| | | | | | | | | | | | | | | | | | The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD. This kind of simplification is sometimes useful, but in general it's not correct. As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the build definitions used for FreeBSD, whereas for userland-related issues we want to match the definitions used for other systems with Glibc. The current modification adjusts the build system so that they can be distinguished, and explicitly adds GNU/kFreeBSD to the build checks in which it belongs. Fixes bug #16445. Patch by Robert Millan in the context of Debian. llvm-svn: 185312
* Bug fix: Make RecursiveASTVisitor<T>::TraverseLambdaExpr callJames Dennett2013-06-301-0/+2
| | | | | | | WalkUpFromLambdaExpr, so that the Visit* functions are called on that AST node. llvm-svn: 185277
* Don't use PathV1.h in CIndexCodeCompletion.cpp.Rafael Espindola2013-06-261-3/+3
| | | | llvm-svn: 184940
* [AST] Introduce a new DecayedType sugar nodeReid Kleckner2013-06-242-0/+12
| | | | | | | | | | | | | | The goal of this sugar node is to be able to look at an arbitrary FunctionType and tell if any of the parameters were decayed from an array or function type. Ultimately this is necessary to implement Microsoft's C++ name mangling scheme, which mangles decayed arrays differently from normal pointers. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1014 llvm-svn: 184763
* Add some invalid-decl checks to clang_Type_getOffsetOf.Matt Beaumont-Gay2013-06-241-1/+3
| | | | | | | print-size-type.cpp was checking for specific record layout output for invalid decls; I've removed the checks but left the records as tests for not crashing. llvm-svn: 184751
* Comment parsing: allow "\param ..." to describe variadic argumentsDmitri Gribenko2013-06-241-16/+36
| | | | | | | | Original patch by Fariborz Jahanian; extended by me. Fixes rdar://14124644 llvm-svn: 184688
* Comment parsing: followup to r184610: allow multiple \returnsDmitri Gribenko2013-06-221-2/+2
| | | | | | | | | Remove unneeded member in CommentSema, add a test for the XML schema (the schema already allowed multiple paragraphs in <ResultDiscussion>, but there were no tests for that), fix HTML generation (it is not allowed to have <p> inside <dl>). llvm-svn: 184652
* [document parsing]: Allow multiple adjacent \return and the likeFariborz Jahanian2013-06-211-8/+13
| | | | | | | commands. Render them properly in XML output. // rdar://14207725 llvm-svn: 184610
* Simplify a loop in ProcessCodeCompleteResults(). Pointed out by David BlaikieDmitri Gribenko2013-06-181-6/+6
| | | | llvm-svn: 184169
* ArrayRef'ize CodeCompletionContext::getNumSelIdents()Dmitri Gribenko2013-06-181-8/+6
| | | | llvm-svn: 184168
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-141-1/+1
| | | | | | | | | | | | | | | | | | The big changes are: - Deleting Driver/(Arg|Opt)* - Rewriting includes to llvm/Option/ and re-sorting - 'using namespace llvm::opt' in clang::driver - Fixing the autoconf build by adding option everywhere As discussed in the review, this change includes using directives in header files. I'll make follow up changes to remove those in favor of name specifiers. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D975 llvm-svn: 183989
* Use the sys::ExecuteAndWait that takes StringRefs.Rafael Espindola2013-06-131-0/+1
| | | | | | Also don't depend on Program.h including PathV1.h. llvm-svn: 183935
* libclang: Remove clang::RemapFiles, it's dead code.Benjamin Kramer2013-06-132-73/+0
| | | | llvm-svn: 183902
* libclang: Port CIndexer::getClangResourcesPath to PathV2. No functionality ↵Benjamin Kramer2013-06-132-16/+14
| | | | | | change. llvm-svn: 183901
* PR12086, PR15117Richard Smith2013-06-122-0/+2
| | | | | | | | | | | | | | | | | | | Introduce CXXStdInitializerListExpr node, representing the implicit construction of a std::initializer_list<T> object from its underlying array. The AST representation of such an expression goes from an InitListExpr with a flag set, to a CXXStdInitializerListExpr containing a MaterializeTemporaryExpr containing an InitListExpr (possibly wrapped in a CXXBindTemporaryExpr). This more detailed representation has several advantages, the most important of which is that the new MaterializeTemporaryExpr allows us to directly model lifetime extension of the underlying temporary array. Using that, this patch *drastically* simplifies the IR generation of this construct, provides IR generation support for nested global initializer_list objects, fixes several bugs where the destructors for the underlying array would accidentally not get invoked, and provides constant expression evaluation support for std::initializer_list objects. llvm-svn: 183872
* Include PathV1.h in files that use it.Rafael Espindola2013-06-111-0/+1
| | | | | | This is preparation for replacing Path.h with PathV2.h. llvm-svn: 183781
* [libclang] CMake: add an option to control building libclang as a static ↵Argyrios Kyrtzidis2013-06-061-1/+4
| | | | | | | | library (off by default) This avoids building libclang twice by default. llvm-svn: 183437
* [libclang] When annotating tokens, don't override a property annotation with ↵Argyrios Kyrtzidis2013-06-041-0/+5
| | | | | | | | a getter/setter method annotation. rdar://13764549 llvm-svn: 183242
OpenPOWER on IntegriCloud