summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* 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
* clang-cl: ignore /RTC options (PR17129)Hans Wennborg2013-09-062-3/+3
| | | | | | | | I don't think Clang intends to implement this functionality. ASan should be used instead. Since /RTC is often passed by default from MSBuild, ignore the option to avoid bloating the output. llvm-svn: 190202
* Add Intrin.h to the cmake files.Eric Christopher2013-09-061-0/+1
| | | | llvm-svn: 190199
* Debug Info: Update testing case.Manman Ren2013-09-062-3/+3
| | | | | | | DIBuilder now uses an identifier to reference DIType in containing type field of a DICompositeType (in r190190). llvm-svn: 190191
* OpenMP: Data-sharing attributes analysis and clause 'shared' (fixed test ↵Alexey Bataev2013-09-0625-36/+903
| | | | | | threadprivate_messages.cpp) llvm-svn: 190183
* Don't remove trailing escaped newline from line comments.Alexander Kornienko2013-09-062-1/+3
| | | | llvm-svn: 190175
* Remove unused method Job::AddCommand.Hans Wennborg2013-09-062-9/+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
* [analyzer] SATestBuild: strip trailing newlines from command file.Jordan Rose2013-09-061-0/+1
| | | | | | | | | | When running a make-based command, SATestBuild tries to append a -jN flag with an appropriate N to run the build in parallel. However, it failed to take into account that each line read includes a trailing newline (unless it is the last line of a file without a trailing newline), which resulted in the "-jN" appearing on a line on its own. llvm-svn: 190164
* Follow up on commit r190159. Also test the KFreeBSD i686 platform defines + ↵Sylvestre Ledru2013-09-061-1/+6
| | | | | | minor cosmetics llvm-svn: 190162
* Add a test for the KFreeBSD define (#define __FreeBSD_kernel__ 1). This was ↵Sylvestre Ledru2013-09-061-0/+4
| | | | | | introduced in commit r190048 llvm-svn: 190159
* OpenCL allows the (pre/post)-(increment/decrement) operator on integer ↵David Tweed2013-09-062-0/+22
| | | | | | | | | | 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-063-3/+8
| | | | | | | | | | | | | | | | | | | | 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-062-2/+42
| | | | | | | | | | | | | | | | | | | | | 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-064-16/+23
| | | | | | | | | | | | | | | 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-066-39/+83
| | | | | | | | | | | 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-063-46/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-063-30/+78
| | | | | | | | | | | | 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-067-74/+113
| | | | | | | | | | | | | 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-062-5/+19
| | | | | | | | 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-062-0/+14
| | | | | | constructor. llvm-svn: 190111
* Improve error for "override" + non-virtual func.Eli Friedman2013-09-054-36/+106
| | | | | | | | | | | | | | | | | | | 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-052-9/+33
| | | | | | | | | 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
* manual: Fix RST reference to MS extension supportReid Kleckner2013-09-051-1/+1
| | | | llvm-svn: 190101
* Fix regression from r190016.Eli Friedman2013-09-051-1/+3
| | | | | | I don't have a reduced testcase yet. llvm-svn: 190094
* Debug Info: Update testing case.Manman Ren2013-09-051-11/+14
| | | | | | | DIBuilder now uses an identifier to reference DIType in base type field of ptr_to_member (in r190081). llvm-svn: 190082
* 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-052-0/+27
| | | | | | | | | | | | | | 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-052-18/+48
| | | | | | | 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-052-1/+4
| | | | | | | | 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-052-3/+8
| | | | | | | | | | | | | | 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-059-76/+189
| | | | | | | | | | | | | | | | | | 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-052-0/+9
| | | | | | | | | | Before: constexpr char hello [] { "hello" }; After: constexpr char hello[]{ "hello" }; llvm-svn: 190046
* Add new methods for TargetInfo:Stepan Dyatkovskiy2013-09-055-1/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Support suppressing unused arguments warnings as a core option so thatChandler Carruth2013-09-052-1/+5
| | | | | | it works in the CL flavor driver. llvm-svn: 190040
* clang-format: Fix parsing and indenting lambdas.Daniel Jasper2013-09-054-29/+37
| | | | | | | | | | | | | | | | 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-059-260/+431
| | | | | | | | | | | | | | | | | | 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
* [analyzer] Restructure a test filePavel Labath2013-09-051-708/+707
| | | | | | | | | | | | | | | | Summary: I've had a test failure here while experimenting and I've found that it's impossible to find what is wrong with the previous structure of the file. So I have grouped the expected output with the function that produces it, to make searching for discrepancies more obvious. Reviewers: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1595 llvm-svn: 190037
* Make error text if clang-format is not on the system PATH more helpful,Manuel Klimek2013-09-051-1/+10
| | | | | | | as this is going to be a common mistake (installing LLVM defaults to not putting the tools onto the PATH). llvm-svn: 190036
* For "expected unqualified-id" errors after a double colon, and the double colonRichard Trieu2013-09-052-2/+24
| | | | | | | | 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
* Add specific warning flags for GNU ext in lexer.Eli Friedman2013-09-053-9/+70
| | | | | | | | | | | | | This patch adds the following flags covering existing warnings: -Wgnu-zero-variadic-macro-arguments -Wgnu-imaginary-constant -Wgnu-binary-literal -Wgnu-zero-line-directive Patch by Peter Lewis. llvm-svn: 190017
* Note when a decl is used in AST files.Eli Friedman2013-09-0517-28/+83
| | | | | | | | | | | | | | | 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-042-5/+12
| | | | | | 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-042-8/+19
| | | | | | | | | | | | | | | | 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-042-34/+64
| | | | | | to Method/functions returning ObjC objects. wip. llvm-svn: 190005
OpenPOWER on IntegriCloud