summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Objective-C: Removes a bogus warning about auto-synthesisFariborz Jahanian2013-06-071-10/+10
| | | | | | of properties. Fixes // rdar://14085456 llvm-svn: 183542
* Thread the 'Invalid' out parameter through SourceManager::getSLocEntry() and ↵Argyrios Kyrtzidis2013-06-071-1/+4
| | | | | | | | callees of SourceManager::getSLocEntryByID(). Also add an 'Invalid' check in SourceManager::computeMacroArgsCache(). llvm-svn: 183538
* Improved handling of escaped newlines at the token start.Alexander Kornienko2013-06-072-44/+21
| | | | | | | | | | | | | | Summary: Remove them from the TokenText as well. Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D935 llvm-svn: 183536
* Handle Unicode characters in fix-it replacement strings.Jordan Rose2013-06-071-19/+17
| | | | | | Patch by Sukolsak Sakshuwong! llvm-svn: 183535
* fix up recogtion of block pointer type in my last patch.Fariborz Jahanian2013-06-071-1/+3
| | | | | | | | | // rdar://14085217. e-This line, and those below, will be ignored-- M lib/Sema/SemaExpr.cpp llvm-svn: 183531
* Fixed calculation of penalty when breaking tokens.Alexander Kornienko2013-06-074-29/+48
| | | | | | | | | | | | | | | | | | | | | Summary: Introduced two new style parameters: PenaltyBreakComment and PenaltyBreakString. Add penalty for each character of a breakable token beyond the column limit (this relates mainly to comments, as they are broken only on whitespace). Tuned PenaltyBreakComment to prefer comment breaking over breaking inside most binary expressions. Fixed a bug that prevented *, & and && from being considered TT_BinaryOperator in the presense of adjacent comments. Reviewers: klimek, djasper Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D933 llvm-svn: 183530
* Reverts r183466: "Perform dynamic alignment computations..."Manuel Klimek2013-06-077-197/+85
| | | | | | | | | This introduces bugs in TemplateSpecializationTypeLoc's angle bracket locations. Regression test follows in a subsequent commit. llvm-svn: 183513
* PR16243: Use CXXThisOverride during template instantiation, and fix up theRichard Smith2013-06-074-18/+20
| | | | | | | | places which weren't setting it up properly. This allows us to get the right cv-qualifiers for 'this' when it appears outside a method body in a class template. llvm-svn: 183483
* When we're synthesizing copy/move-assignment, we can't form a reference to anEli Friedman2013-06-071-1/+11
| | | | | | invalid field; make sure we don't try. Fixes <rdar://problem/14084171>. llvm-svn: 183479
* documentation: remove confusing reference to properties.Adrian Prantl2013-06-071-3/+3
| | | | llvm-svn: 183475
* ObjC Debug Info: Emit the names of accessors whenever they diverge fromAdrian Prantl2013-06-071-4/+34
| | | | | | | | the default names, not just when the isImplicit flag is set. rdar://problem/14035789 llvm-svn: 183474
* Improve documentation.Adrian Prantl2013-06-071-6/+12
| | | | llvm-svn: 183473
* blocks: fixes an ast bug when block pointer variableFariborz Jahanian2013-06-071-1/+4
| | | | | | | | | | is evaluated in a condition expression and then dereferenced to envoke the block. This is pr15663 and I applied a slight variation of the patch with a test case. (patch is from Arthur O'Dwyer). Also // rdar://14085217 llvm-svn: 183471
* Diagnose malformed x86 inline asm using 'y' constraint.Tim Northover2013-06-073-5/+27
| | | | | | | | X86's 'y' inline assembly constraint represents an MMX register, this change prevents Clang from hitting an assertion when passed an incompatible type to deal with. llvm-svn: 183467
* Perform dynamic alignment computations so that the data in TypeLocs isEli Friedman2013-06-077-85/+197
| | | | | | | | | | | | | | | correctly aligned. Not performing such computations led to misaligned loads, which crash on some platforms and are generally bad on other platforms. The implementation of TypeLocBuilder::pushImpl is rather messy; code using TypeLocBuilder accidentally assumes that partial TypeLocs are laid out like a complete TypeLoc. As a followup, I intend to work on fixing the TypeLocBuilder API to avoid exposing partial TypeLocs; this should substantially simplify the implemementation. Fixes PR16144. llvm-svn: 183466
* Implement DR7David Majnemer2013-06-061-5/+12
| | | | | | | | Disallowing deriving from classes that have private virtual base classes except in instances where the deriving class would be able to cast itself to the private virtual base via a different derivation. llvm-svn: 183462
* [analyzer] Address Jordan’s code review for r183451Anna Zaks2013-06-061-3/+3
| | | | llvm-svn: 183455
* [analyzer] Ensure that pieces with invalid locations always get removed from ↵Anna Zaks2013-06-061-9/+24
| | | | | | | | | | | the BugReport The function in which we were doing it used to be conditionalized. Add a new unconditional cleanup step. This fixes PR16227 (radar://14073870) - a crash when generating html output for one of the test files. llvm-svn: 183451
* [analyzer] fixup the commentAnna Zaks2013-06-061-1/+1
| | | | llvm-svn: 183450
* [analyzer; new edges] Simplify edges in a C++11 for-range loop.Jordan Rose2013-06-064-16/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously our edges were completely broken here; now, the final result is a very simple set of edges in most cases: one up to the "for" keyword for context, and one into the body of the loop. This matches the behavior for ObjC for-in loops. In the AST, however, CXXForRangeStmts are handled very differently from ObjCForCollectionStmts. Since they are specified in terms of equivalent statements in the C++ standard, we actually have implicit AST nodes for all of the semantic statements. This makes evaluation very easy, but diagnostic locations a bit trickier. Fortunately, the problem can be generally defined away by marking all of the implicit statements as part of the top-level for-range statement. One of the implicit statements in a for-range statement is the declaration of implicit iterators __begin and __end. The CFG synthesizes two separate DeclStmts to match each of these decls, but until now these synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG keeps track of its synthetic statements, and the AnalysisDeclContext will make sure to add them to the ParentMap. <rdar://problem/14038483> llvm-svn: 183449
* Fix incorrect line breaking before trailing block comments.Daniel Jasper2013-06-061-1/+1
| | | | | | | | | | | | | | | | | Before, clang-format would happily move a trailing block comment to a new line, which normally changes the perceived binding of that comment. E.g., it would move: void f() { /* comment */ ... } to: void f() { /* comment */ ... } llvm-svn: 183420
* Fix a crash with -Wassign-enum, where we didn't adjust the APInt type of theJoey Gouly2013-06-061-10/+11
| | | | | | | | | | constant. Also fix some spelling mistakes and formatting issues. Reviewed by Richard Smith over IRC. Fixes PR15069. llvm-svn: 183409
* ClangTool: strip -o from the command linePavel Labath2013-06-062-2/+20
| | | | | | | | | | | | | | Summary: This patch creates a new ArgumentsAdjuster, which removes all -o parameters from the command line. This adjuster is inserted by default into the ClangTool pipeline. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D925 llvm-svn: 183398
* Implement DR1270: braces can be elided in all aggregate initialization, notRichard Smith2013-06-061-22/+8
| | | | | | | just copy-list-initialization in a variable declaration. This effectively reverts r142147. llvm-svn: 183397
* Disallow reinterpret_cast from pointer to bool on WindowsHans Wennborg2013-06-061-2/+4
| | | | | | | | | | | | This became allowed by accident in r131201, but triggers an assert. That patch added an exception to allow conversion from pointers to narrow integral types for MSVC compatibility. However, a pointer can already be converted to bool in a civilized manner; allowing conversion via reinterpret_cast is a bad idea. Fixes PR16222. llvm-svn: 183394
* Fix clang-format's expression parser for leading }s.Daniel Jasper2013-06-061-1/+5
| | | | | | | | The leading "}" in the construct "} else if (..) {" was confusing the expression parser. Thus, no fake parentheses were generated and the indentation was broken in some cases. llvm-svn: 183393
* Improve c-style cast detection.Daniel Jasper2013-06-061-1/+4
| | | | | | | | | | | | | | Before: return (my_int) aaaa; template <> void f<int>(int i)SOME_ANNOTATION; f("aaaa" SOME_MACRO(aaaa)"aaaa"); After: return (my_int)aaaa; template <> void f<int>(int i) SOME_ANNOTATION; f("aaaa" SOME_MACRO(aaaa) "aaaa"); llvm-svn: 183389
* When a static storage duration temporary appears in a constant expression, itRichard Smith2013-06-061-2/+7
| | | | | | | | must be initialized by a constant expression (not just a core constant expression), because we're going to emit it as a global. Core issue for this is pending. llvm-svn: 183388
* Don't create a StringRef from a temporary string.Richard Trieu2013-06-061-1/+1
| | | | llvm-svn: 183372
* [analyzer] Look through ExprWithCleanups to see if an expr's consumed.Jordan Rose2013-06-061-2/+4
| | | | | | | | | | We based decisions during analysis and during path generation on whether or not an expression is consumed, so if a top-level expression has cleanups it's important for us to look through that. <rdar://problem/14076125> llvm-svn: 183368
* [analyzer] Improve debug output for PathDiagnosticPieces.Jordan Rose2013-06-061-54/+75
| | | | | | You can now dump a single PathDiagnosticPiece or PathDiagnosticLocation. llvm-svn: 183367
* [analyzer] Fix a crash that occurs when processing an rvalue array.Anna Zaks2013-06-061-1/+18
| | | | | | | | | | When processing ArrayToPointerDecay, we expect the array to be a location, not a LazyCompoundVal. Special case the rvalue arrays by using a location to represent them. This case is handled similarly elsewhere in the code. Fixes PR16206. llvm-svn: 183359
* [analyzer; new edges] Don't crash if the top-level entry edge is missing.Jordan Rose2013-06-061-7/+13
| | | | | | | | | | | We previously asserted that there was a top-level function entry edge, but if the function decl's location is invalid (or within a macro) this edge might not exist. Change the assertion to an actual check, and don't drop the first path piece if it doesn't match. <rdar://problem/14070304> llvm-svn: 183358
* [analyzer; new edges] Ignore self-edges, not all edges with the same location.Jordan Rose2013-06-061-6/+7
| | | | | | | | | | | | | | | The edge optimizer needs to see edges for, say, implicit casts (which have the same source location as their operand) to uniformly simplify the entire path. However, we still don't want to produce edges from a statement to /itself/, which could occur when two nodes in a row have the same statement location. This necessitated moving the check for redundant notes to after edge optimization, since the check relies on notes being adjacent in the path. <rdar://problem/14061675> llvm-svn: 183357
* If we're splitting the dwarf for fission and don't want to use theEric Christopher2013-06-051-0/+8
| | | | | | | | | | integrated assembler then go ahead and still split the dwarf anyhow. Add two tests, one to exercise existing behavior of not splitting when we're just emitting assembly files and the other to test that we split when we're not in integrated as mode. llvm-svn: 183355
* Objective-C: Provide fixit with suggested spelling correctionFariborz Jahanian2013-06-052-2/+63
| | | | | | for -Wundeclared-selector warnings. // rdar://14039037 llvm-svn: 183331
* PR14763: Debug info for non-trivial record parametersDavid Blaikie2013-06-051-16/+0
| | | | | | | | | | There seems to have been some erroneous code attempting to describe the ABI of parameters (non-trivial record parameters are passed by reference). This would break the type of the function (especially when it caused a mismatch between the type of a declaration & a definition) causing PR14763 and PR14645. llvm-svn: 183329
* When the template specialization header is missing, set a valid source ↵Argyrios Kyrtzidis2013-06-051-0/+1
| | | | | | | | | | | location for the template keyword when recovering. Otherwise ClassTemplateSpecializationDecl::getSourceRange() will mistakenly consider itself as an implicit partial specialization and lead to a crash. Fixes rdar://14063074 llvm-svn: 183325
* [ms-cxxabi] Thread GlobalDecls through to CodeGenModule::getFunctionLinkage.Peter Collingbourne2013-06-054-18/+18
| | | | | | | | This is so that we can give destructor variants different linkage later. Differential Revision: http://llvm-reviews.chandlerc.com/D819 llvm-svn: 183324
* [ms-cxxabi] Fix vbptr offsets in memptrs when the vbptr is in an nvbaseReid Kleckner2013-06-051-6/+2
| | | | | | | | Also addresses a review comment from John from on r180985 by removing the "== -1" check, since it's now reusing the correct code which has the comment. llvm-svn: 183318
* Silence GCC warning.Benjamin Kramer2013-06-051-0/+1
| | | | llvm-svn: 183317
* UTF-8 support for clang-format.Alexander Kornienko2013-06-057-167/+282
| | | | | | | | | | | | | | | | | | | | Summary: Detect if the file is valid UTF-8, and if this is the case, count code points instead of just using number of bytes in all (hopefully) places, where number of columns is needed. In particular, use the new FormatToken.CodePointCount instead of TokenLength where appropriate. Changed BreakableToken implementations to respect utf-8 character boundaries when in utf-8 mode. Reviewers: klimek, djasper Reviewed By: djasper CC: cfe-commits, rsmith, gribozavr Differential Revision: http://llvm-reviews.chandlerc.com/D918 llvm-svn: 183312
* Recommit r183298+r183300 'Get rid of ↵Timur Iskhodzhanov2013-06-051-159/+96
| | | | | | | | | VTableContext::ComputeMethodVTableIndices() and VTableContext::getNumVirtualFunctionPointers()' In r183298, I've used llvm::SmallPtrSet<..., 8> instead of llvm::SmallVector<..., 8> for NewVirtualFunctionsTy by mistake. This only manifested when a class had more than 8 virtual functions, which wasn't covered by unit-tests llvm-svn: 183310
* Revert r183298 and r183300 as the former broke the virtual function lookup ↵Timur Iskhodzhanov2013-06-051-96/+159
| | | | | | in libcxx __locale llvm-svn: 183305
* Make clang tools ignore -fcolor-diagnostics and -fdiagnostics-color ↵Alexander Kornienko2013-06-051-2/+10
| | | | | | | | | | | | | | | | | | | retrieved from the compilation database. Summary: Clang tools' diagnostic output could be force colored when a command line from the compilation database contains -fcolor-diagnostics or -fdiagnostics-color. This is not what we want e.g. for vim integration. Reviewers: klimek Reviewed By: klimek CC: cfe-commits, revane, jordan_rose Differential Revision: http://llvm-reviews.chandlerc.com/D917 llvm-svn: 183304
* Fix fallout from r183298, unused function (CollectPrimaryBases) causing the ↵David Blaikie2013-06-051-15/+0
| | | | | | -Werror build to fail llvm-svn: 183300
* Fix the DUMP_OVERRIDERS macro in the VTableBuilder.cppTimur Iskhodzhanov2013-06-051-3/+1
| | | | llvm-svn: 183299
* Get rid of VTableContext::ComputeMethodVTableIndices() and ↵Timur Iskhodzhanov2013-06-051-144/+96
| | | | | | VTableContext::getNumVirtualFunctionPointers(); also add some tests for the VTable indices output to make sure we don't regress llvm-svn: 183298
* PR16214: Debug Info: -flimit-debug-info doesn't omit definitions for types ↵David Blaikie2013-06-052-38/+26
| | | | | | | | | | | | | | | | | | | | used via typedefs In an effort to make -flimit-debug-info more consistent I over-shot the mark & made types used via typedefs never produce definitions in the debug info (even if the type was used in a way that would require a definition). The fix for this is to do exactly what I was hoping to do at some point - plumb the declaration/definition choice through the various layers of "CreateType" in CGDebugInfo. In this way we can produce declarations whenever they are sufficient & definitions otherwise - including when qualifiers are used, for example (discovered in PR14467). This may not be complete (there may be other types/situations where we need to propagate the "declaration/definition" choice) but it lays the basic foundation which we can enhance in future iterations. llvm-svn: 183296
* Default to PIE and using stack protection on OpenBSD.Rafael Espindola2013-06-052-0/+8
| | | | | | Patch by Matthew Dempsky. llvm-svn: 183295
OpenPOWER on IntegriCloud