summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Add ATTRIBUTE_UNUSED to silence unused-function warning in releaseDaniel Jasper2013-09-051-1/+2
| | | | | | builds. llvm-svn: 190061
* Fixes PR 17106 (explicitly typed enums are formatted differently).Manuel Klimek2013-09-051-3/+1
| | | | | | | | | | | | | | Before: enum X : int { A, B, C }; After: enum X : int { A, B, C }; llvm-svn: 190054
* Handle zero-width and double-width characters in string literals and comments.Alexander Kornienko2013-09-057-55/+115
| | | | | | | | | | | | | | | | | | Summary: Count column width instead of the number of code points. This also includes correct handling of tabs inside string literals and comments (with an exception of multiline string literals/comments, where tabs are present before the first escaped newline). Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D1601 llvm-svn: 190052
* Fix the profile of the function (fix commit 190048)Sylvestre Ledru2013-09-051-2/+1
| | | | llvm-svn: 190051
* Fix bug #17104 - Target info for GNU/kFreeBSD were missing.Sylvestre Ledru2013-09-051-0/+28
| | | | | | | | | As a result, Clang doesn't define the pre-processor macros that are expected on this platform. Thanks to Robert Millan for the patch llvm-svn: 190048
* clang-format: Quickfix for braced init lists detected as lambdas.Daniel Jasper2013-09-051-0/+6
| | | | | | | | | | Before: constexpr char hello [] { "hello" }; After: constexpr char hello[]{ "hello" }; llvm-svn: 190046
* Add new methods for TargetInfo:Stepan Dyatkovskiy2013-09-053-1/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | getRealTypeByWidth and getIntTypeByWidth for ASTContext names are almost same(invokes new methods from TargetInfo): getIntTypeForBitwidth and getRealTypeForBitwidth. As first commit for PR16752 fix: 'mode' attribute for unusual targets doesn't work properly Description: Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp). For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only. Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct. Please consider the next solution: 1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth virtual methods. By default current behaviour could be implemented here. 2. Fix handleModeAttr according to new methods in TargetInfo. This approach is implemented in the patch attached to this post. Fixes: 1st Commit (Current): Add new methods for TargetInfo: getRealTypeByWidth and getIntTypeByWidth for ASTContext names are almost same(invokes new methods from TargetInfo): getIntTypeForBitwidth and getRealTypeForBitwidth 2nd Commit (Next): Fix SemaDeclAttr, handleModeAttr function. llvm-svn: 190044
* Address post-commit review comments from r190038.Daniel Jasper2013-09-053-5/+22
| | | | | | Mostly additional comments :-). llvm-svn: 190042
* clang-format: Fix parsing and indenting lambdas.Daniel Jasper2013-09-053-26/+36
| | | | | | | | | | | | | | | | Before: void f() { other(x.begin(), x.end(), // [&](int, int) { return 1; }); } After: void f() { other(x.begin(), x.end(), // [&](int, int) { return 1; }); } llvm-svn: 190039
* clang-format: Enable formatting of nested blocks.Daniel Jasper2013-09-058-193/+376
| | | | | | | | | | | | | | | | | | Among other things, this enables (better) formatting lambdas and constructs like: MACRO({ long_statement(); long_statement_2(); }, { long_statement(); long_statement_2(); }, { short_statement(); }, ""); This fixes llvm.org/PR15381. llvm-svn: 190038
* For "expected unqualified-id" errors after a double colon, and the double colonRichard Trieu2013-09-051-2/+9
| | | | | | | | is at the end of the line, point to the location after the double colon instead of at the next token. There is more context to be given this way. In addition, the next token can be several lines later. llvm-svn: 190029
* Note when a decl is used in AST files.Eli Friedman2013-09-0511-26/+56
| | | | | | | | | | | | | | | When an AST file is built based on another AST file, it can use a decl from the fist file, and therefore mark the "isUsed" bit. We need to note this in the AST file so that the bit is set correctly when the second AST file is loaded. This patch introduces the distinction between setIsUsed() and markUsed() so that we don't call into the ASTMutationListener callback when it wouldn't be appropriate. Fixes PR16635. llvm-svn: 190016
* PR17103: Scoped enumerations with signed integer types have signed integerRichard Smith2013-09-041-4/+4
| | | | | | representation. Don't emit comparisons on them as 'icmp ult'! llvm-svn: 190010
* Tweak implementation of -Wwrite-strings to better match the behavior of ↵Richard Smith2013-09-041-7/+18
| | | | | | | | | | | | | | | | current GCCs: * In C, as before, if the "warning flag" is enabled, warnings are produced by forcing string literals to have const-qualified types (the produced warnings are *not* -Wwrite-strings warnings). However, more recent GCCs (at least 4.4 onwards) now take -w into account here, so we now do the same. * In C++, this flag is entirely sane: it behaves just like any other warning flag. Stop triggering -fconst-strings here. This is a bit cleaner, but there's no real functionality change except in the case where -Xclang -fno-const-strings is also specified. llvm-svn: 190006
* ObjectiveC migrator: start introducing NS_XXX annotationsFariborz Jahanian2013-09-041-14/+44
| | | | | | to Method/functions returning ObjC objects. wip. llvm-svn: 190005
* Reapply r189013 (reverted in r189906) now that the underlying issue is fixed ↵David Blaikie2013-09-042-42/+32
| | | | | | | | | | | | | | and tested (in r189996) Debug info emission was tripping over an IRGen bug (fixed in r189996) that was resulting in duplicate emission of static data members of class templates in namespaces. We could add more test coverage to debug info for this issue specifically, but I think the underlying IRGen test is more targeted and sufficient for the issue. llvm-svn: 190001
* Do not emit duplicate global initializers for template static data members ↵David Blaikie2013-09-041-1/+6
| | | | | | | | | | | | | | | | | inside namespaces A quirk of AST representation leads to class template static data member definitions being visited twice during Clang IRGen resulting in duplicate (benign) initializers. Discovered while investigating a possibly-related debug info bug tickled by the duplicate emission of these members & their associated debug info. With thanks to Richard Smith for help investigating, understanding, and helping with the fix. llvm-svn: 189996
* Remove the -fuse-gold-plugin driver option.Rafael Espindola2013-09-041-5/+2
| | | | | | | | * It was redundant with -flto. * It was confusing since -uAnythingElse is a different option. * GCC uses -fuse-linker-plugin, so it was not even a compatibility option. llvm-svn: 189976
* ObjectiveC migrator. Refactor last patch on Fariborz Jahanian2013-09-041-17/+8
| | | | | | annotations. (was r189892). llvm-svn: 189956
* ASTDumper: fix dump of CXXCatchStmtPavel Labath2013-09-041-0/+6
| | | | | | | | | | Summary: I added the display of the VarDecl contained in the statement. CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1596 llvm-svn: 189941
* Handle 'Cpp03' and 'Cpp11' strings in LanguageStandard serialization forAlexander Kornienko2013-09-041-0/+2
| | | | | | | consistency of serialized form with the actual enum member names without a prefix. llvm-svn: 189936
* Remove code duplication in unwrapped line parser.Manuel Klimek2013-09-041-10/+1
| | | | llvm-svn: 189933
* Implement parsing of blocks (^{ ... }) in the unwrapped line parser.Manuel Klimek2013-09-042-14/+31
| | | | | | | | | | | | | | | | | | | | | | This patch makes sure we produce the right number of unwrapped lines, a follow-up patch will make the whitespace formatting consistent. Before: void f() { int i = {[operation setCompletionBlock : ^{ [self onOperationDone]; }] } ; } After: void f() { int i = {[operation setCompletionBlock : ^{ [self onOperationDone]; }] }; } llvm-svn: 189932
* Inplement aarch64 neon instructions in AdvSIMD(shift). About 24 shift ↵Hao Liu2013-09-041-37/+110
| | | | | | | | | | instructions: sshr,ushr,ssra,usra,srshr,urshr,srsra,ursra,sri,shl,sli,sqshlu,sqshl,uqshl,shrn,sqrshr$ and 4 convert instructions: scvtf,ucvtf,fcvtzs,fcvtzu llvm-svn: 189926
* Fix layout of lambda captures.Manuel Klimek2013-09-042-10/+18
| | | | | | | | | | | | | | | | | | Before: int c = [ &, &a, a]{ [ =, c, &d]{ return b++; }(); }(); After: int c = [&, &a, a] { [=, c, &d] { return b++; }(); }(); llvm-svn: 189924
* Clear LookupResult object if invalid candidate is found.Serge Pavlov2013-09-041-3/+9
| | | | | | | If source code is invalid, error recovery can lead to name lookup in a set containing invalid declaration. The lookup is stopped once found such declaration, but LookupResult object could remain in inconsistent state. Its destructor triggered a check, which caused assert violation. This patch fixes PR16964 and PR12791. llvm-svn: 189916
* Revert "DebugInfo: Remove explicit declaration-emissiong handling now that ↵David Blaikie2013-09-042-32/+42
| | | | | | | | | | | we have a more principled approach (the 'requires complete type' callback)" This reverts commit r189013. This is causing a segfault crash in a test case I have. Reverting while I investigate the issue. llvm-svn: 189906
* Order initializers of static data members of explicit specializationsReid Kleckner2013-09-041-5/+6
| | | | | | | | I tried to implement this properly in r189051, but I didn't have enough test coverage. Richard kindly provided more test cases than I could possibly imagine and now we should have the correct condition. llvm-svn: 189898
* ObjectiveC migrator: Cannot use bridging annotations forFariborz Jahanian2013-09-041-31/+30
| | | | | | | ObjectiveC methods. Apply specific annotations for them instead as determined by the static analyzer. llvm-svn: 189892
* Parser: support Microsoft syntax for 'typename typedef'David Majnemer2013-09-031-1/+18
| | | | | | | | | | | | | | | | | | | | | | 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
* Emit uuid globals as linkonce_odrReid Kleckner2013-09-031-1/+1
| | | | | | 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-031-20/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-034-11/+18
| | | | | | 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-031-39/+35
| | | | | | 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
* Consumed analysis: add return_typestate attribute.DeLesley Hutchins2013-09-033-35/+182
| | | | | | | | | | 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
* 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-032-12/+20
| | | | llvm-svn: 189833
* Add an implicit dtor CFG node just before C++ 'delete' expressions.Jordan Rose2013-09-033-0/+54
| | | | | | | | | | | | | | 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-031-2/+2
| | | | llvm-svn: 189823
* First step towards correctly formatting lambdas.Manuel Klimek2013-09-032-0/+82
| | | | | | | | | | 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-0310-638/+18
| | | | | | | | This reverts commit r189795. threadprivate_messages.cpp is faling on windows. llvm-svn: 189811
* Use -### instead of -ccc-print-options.Rafael Espindola2013-09-031-26/+2
| | | | | | | Convert the last few tests using -ccc-print-options to -### and remove -ccc-print-options. llvm-svn: 189802
OpenPOWER on IntegriCloud