summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* ARCMigrate/Transforms.h: Remove \arg in comment. [-Wdocumentation]NAKAMURA Takumi2013-04-111-1/+1
| | | | llvm-svn: 179261
* Drop ObjCIndirectCopyRestoreExprs during template instantiation.John McCall2013-04-111-10/+5
| | | | | | | | | It's a kind of implicit conversion, which we generally drop, but more importantly it's got very specific placement requirements. rdar://13617051 llvm-svn: 179254
* Force a load when creating a reference to a temporary copied from a bitfield.Jordan Rose2013-04-113-155/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For this source: const int &ref = someStruct.bitfield; We used to generate this AST: DeclStmt [...] `-VarDecl [...] ref 'const int &' `-MaterializeTemporaryExpr [...] 'const int' lvalue `-ImplicitCastExpr [...] 'const int' lvalue <NoOp> `-MemberExpr [...] 'int' lvalue bitfield .bitfield [...] `-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X' Notice the lvalue inside the MaterializeTemporaryExpr, which is very confusing (and caused an assertion to fire in the analyzer - PR15694). We now generate this: DeclStmt [...] `-VarDecl [...] ref 'const int &' `-MaterializeTemporaryExpr [...] 'const int' lvalue `-ImplicitCastExpr [...] 'int' <LValueToRValue> `-MemberExpr [...] 'int' lvalue bitfield .bitfield [...] `-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X' Which makes a lot more sense. This allows us to remove code in both CodeGen and AST that hacked around this special case. The commit also makes Clang accept this (legal) C++11 code: int &&ref = std::move(someStruct).bitfield PR15694 / <rdar://problem/13600396> llvm-svn: 179250
* [analyzer] Refactoring: better doxygen comment; renaming isTrackedFamily to ↵Anton Yartsev2013-04-111-17/+20
| | | | | | isTrackedByCurrentChecker llvm-svn: 179242
* [analyzer] Address Jordan’s review of r179219Anna Zaks2013-04-102-2/+2
| | | | llvm-svn: 179235
* [analyzer] Address Jordan’s code review of r 179221Anna Zaks2013-04-101-13/+17
| | | | llvm-svn: 179234
* [analyzer] Switched to checkPreCall interface for detecting usage after free.Anton Yartsev2013-04-101-17/+30
| | | | | | Now the check is also applied to arguments for Objective-C method calls and to 'this' pointer. llvm-svn: 179230
* [analyzer] Fix a crash in SyntaxCString checker when given a custom strncat.Anna Zaks2013-04-101-0/+2
| | | | | | Fixes PR13476 llvm-svn: 179228
* [analyzer] When reporting a leak in RetainCount checker due to an early exit ↵Anna Zaks2013-04-101-14/+63
| | | | | | | | | from init, step into init. The heuristic here (proposed by Jordan) is that, usually, if a leak is due to an early exit from init, the allocation site will be a call to alloc. Note that in other cases init resets self to [super init], which becomes the allocation site of the object. llvm-svn: 179221
* [analyzer] Cleanup leak warnings: do not print the names of variables from ↵Anna Zaks2013-04-102-7/+20
| | | | | | other functions. llvm-svn: 179219
* For split dwarf we should also run the objcopy action if we'reEric Christopher2013-04-101-0/+8
| | | | | | just assembling a file and have passed the option. llvm-svn: 179218
* Remove unused arguments.Chad Rosier2013-04-101-4/+3
| | | | llvm-svn: 179217
* [driver] Add a -Ofast option, which enables -O3, -ffast-math, andChad Rosier2013-04-101-2/+14
| | | | | | | -fstrict-aliasing. rdar://13622687 llvm-svn: 179216
* Add an option to parse all comments as documentation commentsDmitri Gribenko2013-04-107-8/+17
| | | | | | Patch by Amin Shali. llvm-svn: 179180
* Fixes recovering from errors when parsing braced init lists.Manuel Klimek2013-04-101-0/+25
| | | | | | | Before we would build huge unwrapped lines which take a long time to optimze. llvm-svn: 179168
* Fix labels with trailing comments and cleanup.Daniel Jasper2013-04-103-75/+62
| | | | | | | | | | | | | | | | | | Before: class A { public : // test }; After: class A { public: // test }; Also remove duplicate methods calculating properties of AnnotatedTokens and make them members of AnnotatedTokens so that they are in a common place. llvm-svn: 179167
* Handle "typeof" in Objective-C format string checking. This previously crashed.Ted Kremenek2013-04-101-0/+4
| | | | | | | | Yes, this came from actual code. Fixes <rdar://problem/13557053>. llvm-svn: 179155
* Add support for computing the exception specification for an inheritingRichard Smith2013-04-101-4/+69
| | | | | | | | | | | constructor. This isn't quite perfect (as usual, we don't handle default arguments correctly yet, and we don't deal with copy/move constructors for arguments correctly either, but this will be fixed when we implement core issue 1351. This completes our support for inheriting constructors. llvm-svn: 179154
* Don't crash when mangling types defined in ObjC class extensions.John McCall2013-04-101-0/+9
| | | | | | | | | The original test case here was mangling a type name for TBAA, but we can provoke this in C++11 easily enough. rdar://13434937 llvm-svn: 179153
* C++11 inheriting constructors: support for inheriting constructor templates.Richard Smith2013-04-102-196/+296
| | | | llvm-svn: 179151
* <rdar://problem/13605348> Don't consider invalid user-defined literal ↵Douglas Gregor2013-04-101-0/+6
| | | | | | operators during overload resolution. llvm-svn: 179150
* [frontend] -frewrite-includes: turn implicit module imports into @imports.Argyrios Kyrtzidis2013-04-101-15/+24
| | | | | | rdar://13610250 llvm-svn: 179145
* [frontend] When preprocessing, turn implicit module imports into @imports.Argyrios Kyrtzidis2013-04-101-0/+29
| | | | | | part of rdar://13610250 llvm-svn: 179144
* [frontend] -frewrite-includes: if there was no inclusion, don't add lineinfo ↵Argyrios Kyrtzidis2013-04-101-3/+8
| | | | | | that indicates return from another file. llvm-svn: 179143
* Improve the diagnostics of the number-reading preprocessor directives.Michael Ilseman2013-04-101-4/+6
| | | | | | | | | | | | | | The GNU line marker directive was sharing code with the #line directive, but some of the warnings/errors were reporting as #line directive diagnostics in both cases. Previously: #line 11foo1 ==> "#line directive requires a simple digit sequence" # 11foo1 ==> "#line directive requires a simple digit sequence" Now, we get: #line 11foo1 ==> "#line directive requires a simple digit sequence" # 11foo1 ==> "GNU line marker directive requires a simple digit sequence" llvm-svn: 179139
* Suppress -Wunused-variable for variables declared in headers, which may inMatt Beaumont-Gay2013-04-101-2/+6
| | | | | | | | | | | fact be defined and used in another TU. Reshuffle some test cases because we suppress -Wunused-variable after we've emitted an error. This fixes PR15558. llvm-svn: 179138
* Objective-C: This patch fixes a none-issuance of warningFariborz Jahanian2013-04-091-1/+4
| | | | | | | | | | | when result type of protocol property and getter method differ by fixing a more serious problem. When a forward protocol declaration comes between its definition and its use in class protocol list, the forward protocol ast was being used in building the protocol list. // rdar://12522752 llvm-svn: 179108
* Fix comments before labels.Daniel Jasper2013-04-091-6/+13
| | | | | | | | | | | | | | | | | | | | | | Before: switch (...) { // a // b // c case first: break; } After: switch (...) { // a // b // c case first: break; } llvm-svn: 179107
* Again macros without trailing semicolons: don't care about declaration context.Alexander Kornienko2013-04-091-3/+30
| | | | | | | | | | | | | | | | Summary: Some codebases use these kinds of macros in functions, e.g. Chromium's IPC_BEGIN_MESSAGE_MAP, IPC_BEGIN_MESSAGE_HANDLER, etc. Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D645 llvm-svn: 179099
* [ms-cxxabi] Add "$$C" when mangling template arg QualTypesReid Kleckner2013-04-091-2/+6
| | | | | | Credit goes to Timur Iskhodzhanov for finding the problem and solution. llvm-svn: 179093
* One more follow-up to r179082 - parse PIC/PIE arguments even on platfroms ↵Alexey Samsonov2013-04-091-13/+14
| | | | | | that force default PIC (like Darwin x86-64), otherwise specifying -fPIC will produce bogus unused argument warning llvm-svn: 179092
* Follow-up for r179082: more careful handling of ↵Alexey Samsonov2013-04-091-5/+13
| | | | | | -f(no-)sanitize-address-zero-base-shadow on Android llvm-svn: 179089
* If the user requested a zero-base-shadow sanitizer, infer -pie and -fPIC ↵Peter Collingbourne2013-04-095-58/+76
| | | | | | | | when appropriate. Differential Revision: http://llvm-reviews.chandlerc.com/D502 llvm-svn: 179082
* [analyzer] Replace isIntegerType() with isIntegerOrEnumerationType().Jordan Rose2013-04-0912-26/+31
| | | | | | | | | | | | | | | | | | | | | | | | | Previously, the analyzer used isIntegerType() everywhere, which uses the C definition of "integer". The C++ predicate with the same behavior is isIntegerOrUnscopedEnumerationType(). However, the analyzer is /really/ using this to ask if it's some sort of "integrally representable" type, i.e. it should include C++11 scoped enumerations as well. hasIntegerRepresentation() sounds like the right predicate, but that includes vectors, which the analyzer represents by its elements. This commit audits all uses of isIntegerType() and replaces them with the general isIntegerOrEnumerationType(), except in some specific cases where it makes sense to exclude scoped enumerations, or any enumerations. These cases now use isIntegerOrUnscopedEnumerationType() and getAs<BuiltinType>() plus BuiltinType::isInteger(). isIntegerType() is hereby banned in the analyzer - lib/StaticAnalysis and include/clang/StaticAnalysis. :-) Fixes real assertion failures. PR15703 / <rdar://problem/12350701> llvm-svn: 179081
* When checking for illegal expressions in a default-argumentJohn McCall2013-04-091-0/+18
| | | | | | | | expression, look through pseudo-object expressions. rdar://13602832 llvm-svn: 179080
* Skip transparent contexts when looking for using directives in name lookup.Douglas Gregor2013-04-091-1/+5
| | | | | | Fixes the bootstrap regression I introduced in r179067. llvm-svn: 179079
* Mark as referenced the functions from instantiated UserDefinedLiterals.Argyrios Kyrtzidis2013-04-091-0/+2
| | | | | | Fixes rdar://13589856 llvm-svn: 179078
* [analyzer] Keep tracking the pointer after the escape to more aggressively ↵Anna Zaks2013-04-091-30/+43
| | | | | | | | | | | report mismatched deallocator Test that the path notes do not change. I don’t think we should print a note on escape. Also, I’ve removed a check that assumed that the family stored in the RefStete could be AF_None and added an assert in the constructor. llvm-svn: 179075
* Don't copy just to capture a strong block pointer under ARC.John McCall2013-04-081-7/+27
| | | | | | | | | It turns out that the optimizer can't eliminate this without extra information, for which there's a separate bug. rdar://13588325 llvm-svn: 179069
* <rdar://problem/13584715> Converted constant expressions are expected to ↵Douglas Gregor2013-04-081-1/+1
| | | | | | | | | | | | | | have integral values. We were assuming that any expression used as a converted constant expression would either not have a folded constant value or would be an integer, which is not the case for some ill-formed constant expressions. Because converted constant expressions are only used where integral values are expected, we can simply treat this as an error path. If that ever changes, we'll need to widen the interface of Sema::CheckConvertedConstantExpression() anyway. llvm-svn: 179068
* <rdar://problem/13540899> Collect using directives from all of the semantic ↵Douglas Gregor2013-04-081-8/+25
| | | | | | | | | | | | contexts not represented by scopes. This fixes a regression I introduced in r178136, where we would not consider the using directives from the semantic declaration contexts that aren't represented by the lexical scopes (Scope) when performing unqualified name lookup. This lead to horribly funny diagnostics like "no identifier named 'foo'; did you mean 'foo'?". llvm-svn: 179067
* Recognize function-like macro usages without semicolon in declaration context.Alexander Kornienko2013-04-081-9/+16
| | | | | | | | | | | | | | | | | | | | Summary: Preserve line breaks after function-like macro usages without semicolon, e.g.: QQQ(xxx) class X { }; Reviewers: djasper, klimek Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D638 llvm-svn: 179064
* Fix typo in assertion.Nick Lewycky2013-04-081-1/+1
| | | | llvm-svn: 179061
* The PNaCl target no longer permits __attribute__((regparm)).Eli Bendersky2013-04-082-34/+16
| | | | | | | Remove the custom lowering code dealing with it, disallow it in PNaclTargetInfo and adjust tests accordingly. llvm-svn: 179059
* <rdar://problem/13559825> Further reduce template instantiation depth down ↵Douglas Gregor2013-04-081-1/+1
| | | | | | to 256, since we're blowing the stack for a trivial "factorial" class template. llvm-svn: 179057
* Fix PR15634, better error message for template deduction failure.Richard Trieu2013-04-081-4/+26
| | | | | | | | | | | | | When two template decls with the same name are used in this diagnostic, force them to print their qualified names. This changes the bad message of: candidate template ignored: could not match 'array' against 'array' to the better message of: candidate template ignored: could not match 'NS2::array' against 'NS1::array' llvm-svn: 179056
* <rdar://problem/13540921> Fix a crasher when an Objective-C for-in loop gets ↵Douglas Gregor2013-04-082-15/+41
| | | | | | a non-variable iteration declaration. llvm-svn: 179053
* fix indentationAdrian Prantl2013-04-081-1/+1
| | | | llvm-svn: 179052
* Revamp indentation behavior for complex binary expressions.Daniel Jasper2013-04-083-43/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea is to indent according to operator precedence and pretty much identical to how stuff would be indented with parenthesis. Before: bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > ccccccccccccccccccccccccccccccccccccccccc; After: bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > ccccccccccccccccccccccccccccccccccccccccc; llvm-svn: 179049
* Thread safety analysis: turn on checking within lock and unlock functions.DeLesley Hutchins2013-04-082-12/+54
| | | | | | These checks are enabled with the -Wthread-safety-beta flag. llvm-svn: 179046
OpenPOWER on IntegriCloud