summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Attribute tablegen now understands that attribute arguments can be optional. ↵Aaron Ballman2013-09-093-228/+52
| | | | | | This allows for automated checking of the number of arguments expected vs number of arguments given for attributes. Greatly reduces the amount of manual checking required. llvm-svn: 190368
* Fix a crash introduced in r189828.Matt Beaumont-Gay2013-09-091-1/+1
| | | | | | | The predicates in CXXRecordDecl which test various properties of special members can't be called on incomplete decls. llvm-svn: 190353
* Modern ObjectiveC translator. Fix translation of Fariborz Jahanian2013-09-091-36/+26
| | | | | | | | message sent to aggregate-valued methods. Fix visibility of trampoline type used in translation of such expressions. // rdar://14932320 llvm-svn: 190341
* C++ modules: if a class is defined in multiple modules (for instance, becauseRichard Smith2013-09-093-99/+157
| | | | | | | | | | | | it is an implicit instantiation of a class template specialization), pick the first-loaded definition to be the canonical definition, and merge all other definitions into it. This is still rather incomplete -- we need to extend every form of declaration that can appear within a CXXRecordDecl to be redeclarable if it came from an AST file (this includes fields, enumerators, ...). llvm-svn: 190315
* CGDebugInfo: Hoist string allocation in a helper function. No functionality ↵Benjamin Kramer2013-09-092-32/+19
| | | | | | change. llvm-svn: 190314
* Sema: Don't crash on visibility attributes with an identifier argument.Benjamin Kramer2013-09-091-3/+4
| | | | | | PR17105. llvm-svn: 190312
* Fix constructor-related typos.Benjamin Kramer2013-09-098-34/+34
| | | | | | Noticed by Roman Divacky. llvm-svn: 190311
* Silencing an MSVC warning about an empty control statement (it dislikes ; ↵Aaron Ballman2013-09-091-2/+2
| | | | | | but is fine with {}). llvm-svn: 190305
* Removing the endian attribute and updating associated test cases. This ↵Aaron Ballman2013-09-091-22/+0
| | | | | | functionality was never completely implemented, and this is an improvement over silently eating the attribute. llvm-svn: 190303
* The OpenCL standard specifies the sizes and alignments of various types than ↵David Tweed2013-09-092-2/+31
| | | | | | | | | | | other C-family languages, as well as specifying errno is not set by the math functions. Make the clang front-end set those appropriately when the OpenCL language option is set. Patch by Erik Schnetter! llvm-svn: 190296
* Additional fix for PR16752 and for commit 190044:Stepan Dyatkovskiy2013-09-091-1/+2
| | | | | | -- For TargetInfo::getRealTypeByWidth also added support for IEEEQuad float type. llvm-svn: 190294
* C++ modules: fix a bug where loading a declaration with some name would preventRichard Smith2013-09-092-14/+28
| | | | | | | | | | | | | | | | | name lookup from lazily deserializing the other declarations with the same name, by tracking a bit to indicate whether a name in a DeclContext might have additional external results. This also allows lazier reconciling of the lookup table if a module import adds decls to a pre-existing DC. However, this exposes a pre-existing bug, which causes a regression in test/Modules/decldef.mm: if we have a reference to a declaration, and a later-imported module adds a redeclaration, nothing causes us to load that redeclaration when we use or emit the reference (which can manifest as a reference to an undefined inline function, a use of an incomplete type, and so on). decldef.mm has been extended with an additional testcase which fails with or without this change. llvm-svn: 190293
* Implement aarch64 neon instruction set AdvSIMD (3V Diff), covering the ↵Jiangning Liu2013-09-091-0/+16
| | | | | | | | following 26 instructions, SADDL, UADDL, SADDW, UADDW, SSUBL, USUBL, SSUBW, USUBW, ADDHN, RADDHN, SABAL, UABAL, SUBHN, RSUBHN, SABDL, UABDL, SMLAL, UMLAL, SMLSL, UMLSL, SQDMLAL, SQDMLSL, SMULL, UMULL, SQDMULL, PMULL llvm-svn: 190289
* clang-format: Keep empty lines and format 1-line nested blocks.Daniel Jasper2013-09-081-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | Let clang-format consistently keep up to one empty line (configured via FormatStyle::MaxEmptyLinesToKeep) in nested blocks, e.g. lambdas. Also, actually format single statements in nested blocks. Before: DEBUG({ int i; }); DEBUG({ int i; // an empty line here would just be removed. int j; }); After: DEBUG({ int i; }); DEBUG({ int i; int j; }); llvm-svn: 190278
* Debug Info: pass in DIScope instead of DIDescriptor in createFieldType.Manman Ren2013-09-082-2/+2
| | | | | | Improve readability. No functionality change. llvm-svn: 190268
* Correct typo.David Majnemer2013-09-071-2/+2
| | | | llvm-svn: 190257
* Fixed bug in call to CXXTemporaryObjectExpr ctor.Enea Zaffanella2013-09-071-1/+1
| | | | llvm-svn: 190249
* 'return' before 'else' is bad styleDavid Majnemer2013-09-071-6/+8
| | | | llvm-svn: 190241
* AST: __uuidof should leak through templated typesDavid Majnemer2013-09-072-13/+64
| | | | | | | | | | | | | | | Summary: __uuidof on templated types should exmaine if any of its template parameters have a uuid declspec. If exactly one does, then take it. Otherwise, issue an appropriate error. Reviewers: rsmith, thakis, rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1419 llvm-svn: 190240
* Fix missing source location in CXXTemporaryObjectExpr nodes.Enea Zaffanella2013-09-076-21/+30
| | | | | | | | For clarity, renamed (get/set)ParenRange as (get/set)ParenOrBraceRange in CXXConstructExpr nodes. Added testcase. llvm-svn: 190239
* ObjectiveC migrator: When inferring a property,Fariborz Jahanian2013-09-061-60/+75
| | | | | | | | preserve getter's attribute. Also, do not attach an inferred NS_RETURNS_INNER_POINTER to the inferred property (it is illegal). llvm-svn: 190223
* Remove error-prone 'list initialization' flag from an implicit conversionRichard Smith2013-09-061-22/+10
| | | | | | | sequence. All that matters here is whether we're doing the std::initializer_list special case thing. llvm-svn: 190213
* clang-format: Fix regression introduced by r190038.Daniel Jasper2013-09-061-1/+6
| | | | | | | | | | | | | Before: Constructor() : aaaaaaaaaaaaaaaaaaaa(a), bbbbbbbbbbbbbbbbbbbbbbbb(b) { } After: Constructor() : aaaaaaaaaaaaaaaaaaaa(a), bbbbbbbbbbbbbbbbbbbbbbbb(b) { } llvm-svn: 190209
* clang-format: Format typed enums with nested names.Daniel Jasper2013-09-061-1/+2
| | | | | | | | | The explicit type specified for an enum can actually have a nested name specifier. This fixes llvm.org/PR17125. llvm-svn: 190208
* clang-format: Don't confuse operator[] with lambdas.Daniel Jasper2013-09-061-1/+2
| | | | | | | | | | | | | Before: double &operator[](int i) { return 0; } int i; After: double &operator[](int i) { return 0; } int i; This fixes llvm.org/PR17134. llvm-svn: 190207
* Preserve exception specs in function decl merging.Eli Friedman2013-09-061-2/+4
| | | | | | | | | Exception specs are not part of the canonical type, but we shouldn't drop them just because we merged a noreturn attribute. Fixes PR17110. llvm-svn: 190206
* Unbreak the Clang -Werror build after r190183.David Blaikie2013-09-061-0/+2
| | | | | | | Best guess at the right answer here - no guarantees of fitness for any particular purpose. llvm-svn: 190203
* Add Intrin.h to the cmake files.Eric Christopher2013-09-061-0/+1
| | | | llvm-svn: 190199
* OpenMP: Data-sharing attributes analysis and clause 'shared' (fixed test ↵Alexey Bataev2013-09-0610-18/+638
| | | | | | threadprivate_messages.cpp) llvm-svn: 190183
* Don't remove trailing escaped newline from line comments.Alexander Kornienko2013-09-061-1/+1
| | | | llvm-svn: 190175
* Remove unused method Job::AddCommand.Hans Wennborg2013-09-061-5/+0
| | | | | | | | I was going to update the comment referring to PipedJob, which was removed some time ago, but then it turned out that this method is not actually used at all. llvm-svn: 190171
* OpenCL allows the (pre/post)-(increment/decrement) operator on integer ↵David Tweed2013-09-061-0/+3
| | | | | | | | | | vector types, so allow that case and add appropriate tests. Patch by Ruiling Song! llvm-svn: 190129
* clang-format: Fix regression introduced by r189353.Daniel Jasper2013-09-062-3/+4
| | | | | | | | | | | | | | | | | | | | Before: FirstToken->WhitespaceRange.getBegin() .getLocWithOffset(First->LastNewlineOffset); After: FirstToken->WhitespaceRange.getBegin().getLocWithOffset( First->LastNewlineOffset); Re-add logic to prevent breaking after an empty set of parentheses. Basically it seems that calling a function without parameters is more like navigating along the same object than it is a separate step of a builder-type call. We might need to extends this in future to allow "short" parameters that e.g. are an index accessing a specific element. llvm-svn: 190126
* Avoid double edges when constructing CFGsPavel Labath2013-09-061-2/+5
| | | | | | | | | | | | | | | | | | | | | Summary: If a noreturn destructor is executed while returning a value from a function, the resulting CFG has had two edges to the exit block. This crashed the analyzer, because it expects that blocks with no terminators have only one outgoing edge. I added code to avoid creating the second edge in this case. PS: The crashes did not manifest themselves always, as usually the NoReturnFunctionChecker would stop program evaluation before the analyzer hit the assertion, but in the case of lifetime extended temporaries, the checker failed to do that (which is a separate bug in itself). Reviewers: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1513 llvm-svn: 190125
* clang-format: Fix regression introduced by r189337.Daniel Jasper2013-09-063-16/+19
| | | | | | | | | | | | | | | Before: if (aaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) == 5) ... After: if (aaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) == 5) ... Also precompute startsBinaryExpression() to improve performance. llvm-svn: 190124
* clang-format: Fix comment formatting bugs in nested blocks.Daniel Jasper2013-09-065-39/+54
| | | | | | | | | | | This fixes two issues: 1) The indent of a line comment was not adapted to the subsequent statement as it would be outside of a nested block. 2) A missing DryRun flag caused actualy breaks to be inserted in overly long comments while trying to come up with the best line breaking decisions. llvm-svn: 190123
* PR17046, PR17092: Debug Info assert-on-valid due to member loss when context ↵David Blaikie2013-09-061-41/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | creation recreates the item the context is created for By removing the possibility of strange partial definitions with no members that older GCC's produced for the otherwise unreferenced outer types of referenced inner types, we can simplify debug info generation and correct this bug. Newer (4.8.1 and ToT) GCC's don't produce this quirky debug info, and instead produce the full definition for the outer type (except in the case where that type is dynamic and its vtable is not emitted in this TU). During the creation of the context for a type, we may revisit that type (due to the need to visit template parameters, among other things) and used to end up visiting it first there. Then when we would reach the original code attempting to define that type, we would lose debug info by overwriting its members. By avoiding the possibility of latent "defined with no members" types, we can be sure than whenever we already have a type in a cache (either a definition or declaration), we can just return that. In the case of a full definition, our work is done. In the case of a partial definition, we must already be in the process of completing it. And in the case of a declaration, the completed/vtable/etc callbacks can handle converting it to a definition. llvm-svn: 190122
* Add self-comparison warnings for fields.Eli Friedman2013-09-061-30/+43
| | | | | | | | | | | | This expands very slightly what -Wtautological-compare considers to be tautological to include implicit accesses to C++ fields and ObjC ivars. I don't want to turn this into a full expression-identity check, but these additions seem pretty well-contained, and maintain the theme of checking for "x == x". <rdar://problem/14431127> llvm-svn: 190118
* Consumed Analysis: The 'consumable' attribute now takes a identifier ↵David Blaikie2013-09-062-52/+85
| | | | | | | | | | | | | specifying the default assumed state for objects of this class This information is used for return states and pass-by-value parameter states. Patch by Chris Wailes. Review by DeLesley Hutchins and Aaron Ballman. llvm-svn: 190116
* When creating an implicit conversion sequence for a reference of type T from anRichard Smith2013-09-061-5/+12
| | | | | | | | initializer list containing a single element of type T, be sure to mark the sequence as a list conversion sequence so that it is known to be worse than an implicit conversion sequence that initializes a std::initializer_list object. llvm-svn: 190115
* Reduce stack usage of TreeTransform.Eli Friedman2013-09-061-0/+5
| | | | | | | | | | | | | | | Without this patch, TreeTransform::TransformExpr uses a ridiculous amount of stack space (around 5000 bytes). Preventing inlining brings the stack usage down to something sane. On a testcase I have, on my computer, this allows changing -ftemplate-depth from 210 to around 750 before we crash. I'm not sure I should commit the testcase, though: I don't want to cause test failures on platforms with less stack space available. <rdar://problem/14098189>. llvm-svn: 190114
* C++11 attributes after 'constructor-name (' unambiguously signal that we have aRichard Smith2013-09-061-0/+9
| | | | | | constructor. llvm-svn: 190111
* Improve error for "override" + non-virtual func.Eli Friedman2013-09-051-34/+77
| | | | | | | | | | | | | | | | | | | Consider something like the following: struct X { virtual void foo(float x); }; struct Y : X { void foo(double x) override; }; The error is almost certainly that Y::foo() has the wrong signature, rather than incorrect usage of the override keyword. This patch adds an appropriate diagnostic for that case. Fixes <rdar://problem/14785106>. llvm-svn: 190109
* Add a bit more info to modules fatal error.Eli Friedman2013-09-051-2/+4
| | | | | | | Just a minor tweak to make it easier to track down the cause of fatal errors with modules. llvm-svn: 190108
* ObjectiveC migrator: tighten the rules for whenFariborz Jahanian2013-09-051-8/+32
| | | | | | | | | inferring NS_RETURNS_RETAINED, etc., return annotations. Do not infer if these annotations are implicit from the naming convention. Also add inference for NS_CONSUMES_SELF annotation. llvm-svn: 190106
* Fix regression from r190016.Eli Friedman2013-09-051-1/+3
| | | | | | I don't have a reduced testcase yet. llvm-svn: 190094
* Unbreak build with libc++, whose std::list<T> requires T to be complete.Douglas Gregor2013-09-051-1/+4
| | | | llvm-svn: 190075
* Mark lambda closure classes as being implicitly-generated.James Dennett2013-09-051-0/+1
| | | | | | | | | | | | | | Summary: Closure classes for C++ lambdas are always compiler-generated. This one-line change calls setImplicit(true) on them at creation time, such that a default RecursiveASTVisitor (or any for which shouldVisitImplicitCode returns false) will skip them. Reviewers: rsmith, dblaikie Reviewed By: dblaikie CC: klimek, revane, cfe-commits, jordan_rose Differential Revision: http://llvm-reviews.chandlerc.com/D1593 llvm-svn: 190073
* ObjectiveC modern translator: fix up generated fast enumerationFariborz Jahanian2013-09-051-18/+23
| | | | | | | code to work for bit 32bit and 64bit APIs. // rdar://14913632 llvm-svn: 190072
* clang-cl: Use .obj as extension for unnamed object files (PR17095)Hans Wennborg2013-09-051-1/+1
| | | | | | | | We already use .obj as extension when the user provides a stem file name (via /Fo), but were failing in the most basic case when the file name is based on the input file. llvm-svn: 190071
OpenPOWER on IntegriCloud