summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Parser: support Microsoft syntax for 'typename typedef'David Majnemer2013-09-032-2/+27
| | | | | | | | | | | | | | | | | | | | | | Summary: Transform the token sequence for: typename typedef T U; to: typename T typedef U; Raise a diagnostic when this happens but only if we succeeded handling the typename. Reviewers: rsmith, rnk Reviewed By: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1433 llvm-svn: 189867
* Consumed analysis: update to comments in test cases.DeLesley Hutchins2013-09-031-2/+5
| | | | | | Patch by chris.wailes@gmail.com. llvm-svn: 189866
* Emit uuid globals as linkonce_odrReid Kleckner2013-09-032-3/+3
| | | | | | Patch by Nico Rieck! llvm-svn: 189860
* Reference extension is weird/surprising and unnecessary, let's not do that.David Blaikie2013-09-031-1/+1
| | | | | | Found by Chris Wailes llvm-svn: 189859
* Simplify. This function bails out a few lines above if !Found.empty().Richard Smith2013-09-031-1/+1
| | | | llvm-svn: 189857
* Don't emit an available_externally vtable pointing to linkonce_odr funcs.Rafael Espindola2013-09-034-57/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes pr13124. From the discussion at http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-June/022606.html we know that we cannot make funcions in a weak_odr vtable also weak_odr. They should remain linkonce_odr. The side effect is that we cannot emit a available_externally vtable unless we also emit a copy of the function. This also has an issue: If codegen is going to output a function, sema has to mark it used. Given llvm.org/pr9114, it looks like sema cannot be more aggressive at marking functions used because of vtables. This leaves us with a few unpleasant options: * Marking functions in vtables used if possible. This sounds a bit sloppy, so we should avoid it. * Producing available_externally vtables only when all the functions in it are already used or weak_odr. This would cover cases like -------------------- struct foo { virtual ~foo(); }; struct bar : public foo { virtual void zed(); }; void f() { foo *x(new bar); delete x; } void g(bar *x) { x->~bar(); // force the destructor to be used } -------------------------- and ---------------------------------- template<typename T> struct bar { virtual ~bar(); }; template<typename T> bar<T>::~bar() { } // make the destructor weak_odr instead of linkonce_odr extern template class bar<int>; void f() { bar<int> *x(new bar<int>); delete x; } ---------------------------- These look like corner cases, so it is unclear if it is worth it. * And finally: Just nuke this optimization. That is what this patch implements. llvm-svn: 189852
* Switched FormatAttr to using an IdentifierArgument instead of a ↵Aaron Ballman2013-09-038-16/+24
| | | | | | StringArgument since that is a more accurate modeling. llvm-svn: 189851
* Refactor computation of whether a variable declaration's type should be mergedRichard Smith2013-09-032-41/+36
| | | | | | with a prior declaration. No functionality change intended. llvm-svn: 189850
* Fix non-void return warning, and format.Eric Christopher2013-09-031-3/+4
| | | | llvm-svn: 189845
* Remove unused typedef.Eric Christopher2013-09-031-1/+0
| | | | llvm-svn: 189844
* Consumed analysis: add return_typestate attribute.DeLesley Hutchins2013-09-039-56/+275
| | | | | | | | | | Patch by chris.wailes@gmail.com Functions can now declare what state the consumable type the are returning will be in. This is then used on the caller side and checked on the callee side. Constructors now use this attribute instead of the 'consumes' attribute. llvm-svn: 189843
* ARM: Update testcases for improved codegen.Jim Grosbach2013-09-031-3/+3
| | | | | | From llvm r189841. llvm-svn: 189842
* Update GCC attribute argument parsing comment to better reflect what's going onRichard Smith2013-09-031-12/+15
| | | | | | here. llvm-svn: 189838
* Factor out parsing and allocation of IdentifierLoc objects.Richard Smith2013-09-034-13/+24
| | | | llvm-svn: 189833
* Add an implicit dtor CFG node just before C++ 'delete' expressions.Jordan Rose2013-09-036-0/+134
| | | | | | | | | | | | | | This paves the way for adding support for modeling the destructor of a region before it is deleted. The statement "delete <expr>" now generates this series of CFG elements: 1. <expr> 2. [B1.1]->~Foo() (Implicit destructor) 3. delete [B1.1] Patch by Karthik Bhat! llvm-svn: 189828
* Attempt to migrate default dwarf version to 4 for linux.Eric Christopher2013-09-032-3/+3
| | | | llvm-svn: 189823
* Pass -target instead of using "REQUIRES: clang-driver".Rafael Espindola2013-09-031-5/+2
| | | | llvm-svn: 189822
* First step towards correctly formatting lambdas.Manuel Klimek2013-09-033-2/+124
| | | | | | | | | | Implements parsing of lambdas in the UnwrappedLineParser. This introduces the correct line breaks; the formatting of lambda captures are still incorrect, and the braces are also still formatted as if they were braced init lists instead of blocks. llvm-svn: 189818
* Remove useless reinterpret_casts from Stmt.cppPavel Labath2013-09-031-9/+9
| | | | | | | | | | | | | | Summary: I have no idea why these were there in the first place, but now they are certainly not necessary. Reviewers: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1581 llvm-svn: 189813
* Revert "OpenMP: Data-sharing attributes analysis and clause 'shared'"Rafael Espindola2013-09-0326-904/+37
| | | | | | | | This reverts commit r189795. threadprivate_messages.cpp is faling on windows. llvm-svn: 189811
* Disable this on mingw again.Rafael Espindola2013-09-031-0/+3
| | | | | | I will investigate why it still fails, but for now this gets the bots green. llvm-svn: 189807
* Remove unused group.Rafael Espindola2013-09-031-1/+0
| | | | llvm-svn: 189805
* Use -### instead of -ccc-print-options.Rafael Espindola2013-09-037-76/+23
| | | | | | | Convert the last few tests using -ccc-print-options to -### and remove -ccc-print-options. llvm-svn: 189802
* Remove DynCastMatcher, since it is pretty much the same as ↵Samuel Benzaquen2013-09-031-24/+12
| | | | | | | | | | | | | | | | Matcher<T>::WrappedMatcher. Summary: Remove DynCastMatcher, since it is pretty much the same as Matcher<T>::WrappedMatcher. This reduces the number of template instantiations and number of symbols in the object file. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1560 llvm-svn: 189800
* OpenMP: Data-sharing attributes analysis and clause 'shared'Alexey Bataev2013-09-0326-37/+904
| | | | llvm-svn: 189795
* Remove 3 unused ccc options.Rafael Espindola2013-09-031-5/+0
| | | | llvm-svn: 189794
* the call to UsualArithmeticConversions should come after the call to ↵Jin-Gu Kang2013-09-022-8/+19
| | | | | | CheckVectorOperands on CheckConditionalOperands function. This problem caused compilation error with test17 on "test/CodeGen/ext-vector.c". llvm-svn: 189773
* Mark that qualifiers can prefix the auto type. This seems to just haveChandler Carruth2013-09-025-5/+5
| | | | | | | | | | | | | | | | | | been an oversight, as it definitely works. Every test which changed had the const written on the LHS of the auto already. Notably, this also makes things like cpp11-migrate's formation of 'const auto &' variables much more familiar. Yes, many people feel that 'const' and other qualifiers belong on the RHS of the type. I'm not going to argue about that because Clang already *overwhelming* places the qualifiers on the LHS when it can and on the RHS when it must. We shouldn't diverge for auto. We should add a tool to clang-tidy that fixes this in either direction, and then wire up clang-tidy to tools like cpp11-migrate to fix their placement after transforms. llvm-svn: 189769
* Added WebKit style to the BasedOnStyle handling and to the relevant help ↵Alexander Kornienko2013-09-024-8/+12
| | | | | | messages. llvm-svn: 189765
* Whitespace changes in help messages + updated help output in .rst file.Alexander Kornienko2013-09-022-7/+15
| | | | llvm-svn: 189762
* Trying to fix tests with in-tree builds, that contain a .clang-format files inAlexander Kornienko2013-09-021-2/+2
| | | | | | both tools/clang and llvm directories. llvm-svn: 189761
* Fix gnueeabi typo in testsRenato Golin2013-09-021-5/+5
| | | | llvm-svn: 189759
* Store first and last newline position in the token text for string literals ↵Alexander Kornienko2013-09-024-33/+36
| | | | | | | | | | | | | | | | | | and comments. Summary: Store first and last newline position in the token text for string literals and comments to avoid doing .find('\n') for each possible solution. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D1556 llvm-svn: 189758
* Test for empty .clang-format file.Alexander Kornienko2013-09-021-0/+4
| | | | | | | | | | | | | | Summary: Test clang-format's handling of empty .clang-format files. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D1562 llvm-svn: 189757
* clang-format: Fix segfault in overloaded operator parsing.Daniel Jasper2013-09-022-2/+5
| | | | | | | | | Before, constructs like: using A::operator+; caused a segfault. This fixes llvm.org/PR17050. llvm-svn: 189749
* [analyzer] Add very limited support for temporary destructorsPavel Labath2013-09-026-15/+147
| | | | | | | | | | | | | | | | | | | | | This is an improved version of r186498. It enables ExprEngine to reason about temporary object destructors. However, these destructor calls are never inlined, since this feature is still broken. Still, this is sufficient to properly handle noreturn temporary destructors. Now, the analyzer correctly handles expressions like "a || A()", and executes the destructor of "A" only on the paths where "a" evaluted to false. Temporary destructor processing is still off by default and one has to explicitly request it by setting cfg-temporary-dtors=true. Reviewers: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1259 llvm-svn: 189746
* clang-format: Fix case-indentation in macros.Daniel Jasper2013-09-022-4/+7
| | | | | | | | | | | | | | Before: #define OPERATION_CASE(name) \ case OP_name: \ return operations::Operation##name After: #define OPERATION_CASE(name) \ case OP_name: \ return operations::Operation##name llvm-svn: 189743
* Switch the default mode for clang-format to '-file'. Make 'LLVM' theChandler Carruth2013-09-026-19/+19
| | | | | | | | | | | | | | | | | | | fallback syntax used when we fail to find a '.clang-format' file. Adjust variable names appropriately. Update the editor integration pieces that specify a '-style' option to specify it as '-style=file'. I left the functionality in place because even if the preferred method is to use '.clang-format' files, this way if someone needs to clobber the style in their editor we show how to do so in these examples. Also check in a '.clang-format' file for Clang to ensure that separate checkouts and builds of Clang from LLVM can still get the nice formatting. =] This unfortunately required nuking the test for the absence of a '.clang-format' file as now the directory happening to be under your clang source tree will cause there to always be a file. ;] llvm-svn: 189741
* Improving objc_ownership attribute test coverage.Aaron Ballman2013-09-011-0/+6
| | | | llvm-svn: 189731
* Clean out unused diagnostics.Benjamin Kramer2013-08-312-8/+0
| | | | llvm-svn: 189721
* The diagnostic err_init_conversion_failed uses the enumRichard Trieu2013-08-313-1/+52
| | | | | | | | | | InitializedEntity::EntityKind as an index for one of its %select. Over time, EntityKind has been expanded, but the diagnostic text has not been updated. This adds additional text to the %select to cover the new enum values. A comment has been added to the end of the enum regarding this situation. This fixes the crasher in PR17043. llvm-svn: 189716
* Possibly appeasing the build bots from r189711Aaron Ballman2013-08-311-0/+1
| | | | llvm-svn: 189712
* Consolidating the notion of a GNU attribute parameter with the attribute ↵Aaron Ballman2013-08-3112-387/+397
| | | | | | argument list. llvm-svn: 189711
* Typo.Eric Christopher2013-08-311-1/+1
| | | | llvm-svn: 189710
* Add initial clang targeted compatible decls for Intrin.h. Step towardsEric Christopher2013-08-311-0/+341
| | | | | | | | | a windows compatible builtin header. Currently uses x86intrin.h for implementing intel intrinsics in a clang specific manner. llvm-svn: 189709
* ObjectiveC migrator: If we find a method that returns a C pointer Fariborz Jahanian2013-08-303-3/+227
| | | | | | | | of some sort (but not an object, block pointer or CF pointers), and is not annotated with the objc_returns_inner_pointer attribute, we should suggest NS_RETURNS_INNER_POINTER annotation for these methods. llvm-svn: 189707
* Consumed analysis: add 'consumable' class attribute.DeLesley Hutchins2013-08-308-85/+107
| | | | | | | | | | | | Patch by chris.wailes@gmail.com Adds the 'consumable' attribute that can be attached to classes. This replaces the previous method of scanning a class's methods to see if any of them have consumed analysis attributes attached to them. If consumed analysis attributes are attached to methods of a class that isn't marked 'consumable' a warning is generated. llvm-svn: 189702
* [analyzer] Treat the rvalue of a forward-declared struct as Unknown.Jordan Rose2013-08-302-2/+10
| | | | | | | | | | This will never happen in the analyzed code code, but can happen for checkers that over-eagerly dereference pointers without checking that it's safe. UnknownVal is a harmless enough value to get back. Fixes an issue added in r189590, caught by our internal buildbot. llvm-svn: 189688
* ObjectiveC migrator: infer NS_ENUM even when userFariborz Jahanian2013-08-303-10/+50
| | | | | | | | | | specified NSUInteger as the followup typedef. With this change, NS_OPTIONS is only inferred based on looking up how enumerators are speficied (if they her hexadecimal, power of 2, or have bitwise constant expressions). llvm-svn: 189682
* Reduce the number of symbols by changing how templates are instantiated per ↵Samuel Benzaquen2013-08-304-69/+62
| | | | | | | | | | | | | | | | function bound in the registry. Summary: Reduce the number of symbols by changing how templates are instantiated per function bound in the registry. This change reduces the number of sections in Registry.cpp.o by a little over 10%. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1557 llvm-svn: 189676
OpenPOWER on IntegriCloud