summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [TrailingObjects] Convert Decl* classes.James Y Knight2015-12-296-28/+32
| | | | | | | | Also remove now-redundant explicit alignment specification on some of the classes converted prior to TrailingObjects automatically ensuring proper alignment. llvm-svn: 256585
* [MS ABI] Add a mangling for _ComplexDavid Majnemer2015-12-291-5/+10
| | | | | | | | | | | | | MSVC doesn't implement a mangling for C99's _Complex so we must invent our own. For now, treating it like a class type called _Complex in the __clang namespace. This means that 'void f(__Complex int))' will demangle as: 'void f(struct __clang::_Complex<int>)' llvm-svn: 256583
* [MS ABI] Mark an unreachable path appropriatelyDavid Majnemer2015-12-291-8/+2
| | | | | | No functional change is intended, just a small cleanup. llvm-svn: 256582
* fix typos; NFCSanjay Patel2015-12-292-3/+3
| | | | llvm-svn: 256576
* Teach typo correction to properly handle mapping declarations to theirRichard Smith2015-12-297-29/+27
| | | | | | | | | | underlying decls. Preserve the found declaration throughout, and only map to the underlying declaration when we want to check whether it's the right kind. This allows us to provide the right source location for the found declaration, and prepares for the possibility of underlying decls with a different name from the found decl. llvm-svn: 256575
* [TrailingObjects] Convert AST classes that had a ASTTemplateKWAndArgsInfo.James Y Knight2015-12-295-210/+175
| | | | | | | | | | | | | | | | | | | | So, also: - Moved the TemplateArgumentLoc array out of the ASTTemplateKWAndArgsInfo class (making it a simple fixed-size object), to avoid needing to have a variable-length object as part of a variable-length object. Now the objects that have a ASTTemplateKWAndArgsInfo also have some TemplateArgumentLoc objects appended directly. - Removed some internal-use accessors which became simply a wrapper on getTrailingObjects. - Moved MemberNameQualifier out of the MemberExpr class, renamed it MemberExprNameQualifier, because the template can't refer to a class nested within the class it's defining. llvm-svn: 256570
* [analyzer] Nullability: allow cast to _Nonnull to suppress warning about ↵Devin Coughlin2015-12-291-12/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | returning nil. The nullability checker currently allows casts to suppress warnings when a nil literal is passed as an argument to a parameter annotated as _Nonnull: foo((NSString * _Nonnull)nil); // no-warning It does so by suppressing the diagnostic when the *type* of the argument expression is _Nonnull -- even when the symbolic value returned is known to be nil. This commit updates the nullability checker to similarly honor such casts in the analogous scenario when nil is returned from a function with a _Nonnull return type: return (NSString * _Nonnull)nil; // no-warning This commit also normalizes variable naming between the parameter and return cases and adds several tests demonstrating the limitations of this suppression mechanism (such as when nil is cast to _Nonnull and then stored into a local variable without a nullability qualifier). These tests are marked with FIXMEs. rdar://problem/23176782 llvm-svn: 256567
* [MS ABI] Implement a mangling for _Atomic typesDavid Majnemer2015-12-291-5/+10
| | | | | | | | | | | | | MSVC doesn't implement a mangling for C11's _Atomic so we must invent our own. For now, treating it like a class type called _Atomic in the __clang namespace. This means that 'void f(__Atomic(int))' will demangle as: 'void f(struct __clang::_Atomic<int>)' llvm-svn: 256557
* [MS ABI] Cleanup our mangling of vector typesDavid Majnemer2015-12-291-10/+13
| | | | | | | | | | | | | | We used to produce a type which demangled to: union __clang_vec8_F That 'F' is the mangling for 'short' but it is present in the mangled name in an inappropriate place, leading to it not getting demangled. Instead, create a synthetic class type in a synthetic namespace called __clang. With this, it now demangles to: union __clang::__vector<short,8> llvm-svn: 256556
* [MS ABI] Cleanup the mangling of artifical typesDavid Majnemer2015-12-291-46/+97
| | | | | | | Hand-rolling the mangling results in us not correctly adding names to the backreference map. llvm-svn: 256555
* clang-format: [JS/TypeScript] Support "enum" as property name.Daniel Jasper2015-12-292-8/+17
| | | | | | | | | | | Before: enum: string []; After: enum: string[]; llvm-svn: 256546
* [ms inline asm] Add support for label names with '$' charsMarina Yatsina2015-12-291-1/+9
| | | | | | | | | In MS inline asm syntax a label with '$' char produces an error, while in AT&T it does not. In AT&T inline asm syntax Clang escapes the '$' char and replaces it with "$$". Adopted same approach for MS syntax. Differential Revision: http://reviews.llvm.org/D15795 llvm-svn: 256545
* Revert r93378, which is incorrect but currently unobservable (because theRichard Smith2015-12-291-3/+0
| | | | | | | underlying declaration of a NamedDecl happens to always have the same name and identifier namespace as the decl itself today). llvm-svn: 256529
* Fix up a comment and a bit of trailing whitespace.Eric Christopher2015-12-281-2/+2
| | | | llvm-svn: 256525
* Small refactoring in CheckerContext::isCLibraryFunction(). NFC.Devin Coughlin2015-12-281-6/+2
| | | | | | | | | | Use getRedeclContext() instead of a manually-written loop and fix a comment. A patch by Aleksei Sidorin! Differential Revision: http://reviews.llvm.org/D15794 llvm-svn: 256524
* We check for dwarf 5 in the backend, so go ahead and pass it along viaEric Christopher2015-12-281-1/+2
| | | | | | | | | | the front end as well. Note that DWARF5 isn't finalized and any feature support is subject to change and accepting of the option doesn't mean we're supporting the full range of the current standard. llvm-svn: 256516
* Do not crash if class is defined in wrong scope.Serge Pavlov2015-12-281-1/+3
| | | | | | | | | | | This patch fixes PR16677. The latter represents the case when due to misprinted character class definition occurs in the scope of template arguments. Base class of this class depends on the template parameter in the same scope and cannot be resolved, it causes crash. Right behavior is to make semantic processing even if the definition is wrong, as the code that emits appropriate message is called after the processing. llvm-svn: 256511
* Fix up comment in header.Eric Christopher2015-12-281-1/+1
| | | | llvm-svn: 256508
* Avoid crash when dumping LocInfoType.Serge Pavlov2015-12-281-0/+10
| | | | | | | | | LocInfoType is a helper type used internally inside Sema and Parser, it does not exist in valid AST. LocInfoType uses code value outside the range of valid Type codes, as a result, dumping such type causes error. The fix allows correct dumping LocInfoType. llvm-svn: 256503
* Silence enumeral and non-enumeral type in conditional expression warning; NFC.Aaron Ballman2015-12-281-1/+1
| | | | llvm-svn: 256501
* Refactor: Simplify boolean conditional return statements in lib/LexAlexander Kornienko2015-12-282-10/+4
| | | | | | | | | | | | | | Summary: Use clang-tidy to simplify boolean conditional return statements Reviewers: dblaikie Subscribers: dblaikie, cfe-commits Patch by Richard Thomson! Differential Revision: http://reviews.llvm.org/D10017 llvm-svn: 256499
* Refactor: Simplify boolean conditional return statements in ↵Alexander Kornienko2015-12-281-4/+1
| | | | | | | | | | | | | | | | lib/StaticAnalyzer/Frontend Summary: Use clang-tidy to simplify boolean conditional return statements Reviewers: dcoughlin, alexfh Subscribers: alexfh, cfe-commits Patch by Richard Thomson! Differential Revision: http://reviews.llvm.org/D10023 llvm-svn: 256497
* Refactor: Simplify boolean conditional return statements in lib/FrontendAlexander Kornienko2015-12-281-3/+1
| | | | | | | | | | | | | | Summary: Use clang-tidy to simplify boolean conditional return statements Reviewers: alexfh Subscribers: alexfh, cfe-commits Patch by Richard Thomson! Differential Revision: http://reviews.llvm.org/D10016 llvm-svn: 256496
* [X86] Better support for the MCU psABI (clang part)Michael Kuperstein2015-12-281-30/+65
| | | | | | | | | | | | | | | | This adds support for the MCU psABI in a way different from r251223 and r251224, basically reverting most of these two patches. The problem with the approach taken in r251223/4 is that it only handled libcalls that originated from the backend. However, the mid-end also inserts quite a few libcalls and assumes these use the platform's default calling convention. The previous patch tried to insert inregs when necessary both in the FE and, somewhat hackily, in the CG. Instead, we now define a new default calling convention for the MCU, which doesn't use inreg marking at all, similarly to what x86-64 does. Differential Revision: http://reviews.llvm.org/D15055 llvm-svn: 256495
* Refactor: Simplify boolean conditional return statements in ↵Alexander Kornienko2015-12-2811-70/+29
| | | | | | | | | | | | | | | | lib/StaticAnalyzer/Checkers Summary: Use clang-tidy to simplify boolean conditional return values Reviewers: dcoughlin, krememek Subscribers: krememek, cfe-commits Patch by Richard Thomson! Differential Revision: http://reviews.llvm.org/D10021 llvm-svn: 256491
* clang-format: Fix incorrect function type detection.Daniel Jasper2015-12-281-15/+8
| | | | | | | | | | Before: int x = f (&h)(); After: int x = f(&h)(); llvm-svn: 256488
* [OPENMP 4.5] Sema/parsing support for extended format of 'schedule' clause.Alexey Bataev2015-12-287-117/+226
| | | | | | | | | OpenMP 4.0-3.1 supports the next format of ‘schedule’ clause: schedule(kind[, chunk_size]) Where kind can be one of ‘static’, ‘dynamic’, ‘guided’, ‘auto’ or ‘runtime’. OpenMP 4.5 defines the format: schedule([modifier [, modifier]:]kind[, chunk_size]) Modifier can be one of ‘monotonic’, ‘nonmonotonic’ or ‘simd’. llvm-svn: 256487
* [OPENMP 4.5] Do not allow 'linear' clause along with 'ordered(expr)' clause.Alexey Bataev2015-12-281-0/+15
| | | | | | According to OpenMP 4.5 "A linear clause or an ordered clause with a parameter can be specified on a loop directive but not both."" llvm-svn: 256485
* [Sema] ArrayRef-ize ActOnBaseSpecifiers. NFCCraig Topper2015-12-273-14/+12
| | | | llvm-svn: 256478
* Constify NestedNameSpecifier::dump and add a no-argument dump function ↵Yaron Keren2015-12-271-1/+6
| | | | | | suitable for calling from a debugger. llvm-svn: 256472
* On {mips,mipsel,mips64,mips64el}-freebsd, we need to pass any -G option to ↵Dimitry Andric2015-12-271-0/+6
| | | | | | | | | | | | | | | | the assembler. Summary: See also: https://sourceware.org/binutils/docs/as/MIPS-Options.html#index-g_t_0040code_007b_002dG_007d-option-_0028MIPS_0029-1392 Reviewers: theraven, atanasyan, brooks, emaste Subscribers: rnk, emaste, cfe-commits, seanbruno, dim Differential Revision: http://reviews.llvm.org/D10137 llvm-svn: 256468
* Fix C++ support on recent DragonFly BSD releasesDimitry Andric2015-12-273-36/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: [ Copied from https://llvm.org/bugs/show_bug.cgi?id=25597 ] Clang support for DragonFly BSD is lagging a bit, resulting in poor support for c++. DragonFlyBSD is unique in that it has two base compilers. At the time of the last Clang update for DragonFly, these compilers were GCC 4.4 and GCC 4.7 (default). With DragonFly Release 4.2, GCC 4.4 was replaced with GCC 5.0, partially because the C++11 support of GCC 4.7 was incomplete. The DragonFly project will Release version 4.4 soon. This patch updates the Clang driver to use libstdc++ from GCC 5.2 The support for falling back to the alternate compiler was removed for two reasons: 1) The last release to use GCC 4.7 is DF 4.0 which has already reached EOL 2) GCC 4.7 libstdc++ is insufficient for many "ports" Therefore, I think it is reasonable that the development version of clang expects GCC 5.2 to be in place and not try to fall back to another compiler. The attached patch will do this. The Tools.cpp file was signficantly modified to fix the linking which had been changed somewhere along the line. The rest of the changes should be self-explanatory. Reviewers: joerg, rsmith, davide Subscribers: jrmarino, davide, cfe-commits Differential Revision: http://reviews.llvm.org/D15166 llvm-svn: 256467
* ArrayRef-ize TemplateParameterList. NFCDavid Majnemer2015-12-278-23/+23
| | | | llvm-svn: 256463
* For FreeBSD on mips, pass -G options to the linkerDimitry Andric2015-12-271-0/+11
| | | | | | | | | | | | | | | | | Summary: On {mips,mipsel,mips64,mips64el}-freebsd, we need to pass any -G option to the linker. See also: https://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html#index-G-2007 This has been adapted from https://reviews.freebsd.org/D1190, with an added test case. Reviewers: theraven, atanasyan, emaste Subscribers: brooks, tomatabacu, cfe-commits, seanbruno, emaste Differential Revision: http://reviews.llvm.org/D9114 llvm-svn: 256461
* [OPENMP] Do not allow to use threadprivate or thread local variables as loop ↵Alexey Bataev2015-12-251-6/+4
| | | | | | | | iteration variables. According to OpenMP the loop iteration variable may not appear in a threadprivate directive. llvm-svn: 256417
* clang-format: [TableGen] Support ;-less include lines.Daniel Jasper2015-12-252-8/+17
| | | | llvm-svn: 256412
* Revert r256399 "[Sema] ArrayRef-ize ActOnBaseSpecifiers. NFC"Craig Topper2015-12-255-18/+21
| | | | | | It broke lldb build. llvm-svn: 256403
* [Sema] ArrayRef-ize SubstExprs. NFCCraig Topper2015-12-242-5/+6
| | | | llvm-svn: 256401
* [Sema] ArrayRef-ize ActOnTemplateParameterList. NFCCraig Topper2015-12-244-13/+11
| | | | llvm-svn: 256400
* [Sema] ArrayRef-ize ActOnBaseSpecifiers. NFCCraig Topper2015-12-245-21/+18
| | | | llvm-svn: 256399
* [Sema] ArrayRef-ize BuildObjCDictionaryLiteral. NFCCraig Topper2015-12-243-21/+18
| | | | llvm-svn: 256398
* [Sema] ArrayRef-ize ParseObjCStringLiteral and ↵Craig Topper2015-12-243-21/+14
| | | | | | CodeCompleteObjCProtocolReferences. NFC llvm-svn: 256397
* Some minor correction based on David Blaikie post-commit code review for ↵Ekaterina Romanova2015-12-242-4/+3
| | | | | | r255281. llvm-svn: 256396
* use auto for obvious type; NFCSanjay Patel2015-12-241-1/+1
| | | | llvm-svn: 256393
* Replace llvm::utostr calls in Twine context with Twines. NFC.Benjamin Kramer2015-12-242-3/+3
| | | | llvm-svn: 256377
* [TrailingObjects] Convert ASTTemplateKWAndArgsInfo and ↵James Y Knight2015-12-246-73/+50
| | | | | | | | | | | | | | | | | | | ASTTemplateArgumentListInfo. Doing so required separating them so that the former doesn't inherit from the latter anymore. Investigating that, it became clear that the inheritance wasn't actually providing real value in any case. So also: - Remove a bunch of redundant functions (getExplicitTemplateArgs, getOptionalExplicitTemplateArgs) on various Expr subclasses which depended on the inheritance relationship. - Switched external callers to use pre-existing accessors that return the data they're actually interested in (getTemplateArgs, getNumTemplateArgs, etc). - Switched internal callers to use pre-existing getTemplateKWAndArgsInfo. llvm-svn: 256359
* [StaticAnalyzer] Use front() and back() instead of dereferencing begin() and ↵Craig Topper2015-12-242-6/+6
| | | | | | rbegin(). Makes the code a little cleaner. NFC llvm-svn: 256358
* Replace isa+cast with dyn_cast and obey the no else after return rule.Yaron Keren2015-12-231-6/+2
| | | | llvm-svn: 256349
* clang-format: Lower penalty for breaking between array subscripts.Daniel Jasper2015-12-231-1/+1
| | | | | | | | | | | | Before: aaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaa(aaaaaaaaaaaa)][bbbbbbbbbbb( bbbbbbbbbbbb)] After: aaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaa(aaaaaaaaaaaa)] [bbbbbbbbbbb(bbbbbbbbbbbb)] llvm-svn: 256343
* clang-format: Fix incorrect pointer detection.Daniel Jasper2015-12-231-1/+1
| | | | | | | | | | Before: return * this += 1; After: return *this += 1; llvm-svn: 256342
OpenPOWER on IntegriCloud