summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Teach the AST importer to merge enumerator constants. FixesDouglas Gregor2012-11-141-2/+20
| | | | | | <rdar://problem/12676166>, and tested on the LLDB side of the world. llvm-svn: 167990
* When evaluating variably modified types for function parameters, dig out theEli Friedman2012-11-141-1/+10
| | | | | | | | | | type as written from the ParmVarDecl; it's unclear whether the standard (C99 6.9.1p10) requires this, but we're following the precedent set by gcc, and hopefully nobody will ever ask about this again. PR9559 / <rdar://problem/12621983>. llvm-svn: 167985
* Remove the cellspu port.Eric Christopher2012-11-141-9/+5
| | | | | | Approved by Chris Lattner. llvm-svn: 167983
* ParseTemplate.cpp: Prune obsolete descriptions in ↵NAKAMURA Takumi2012-11-141-10/+0
| | | | | | | | | | | | | | | | ParseSingleDeclarationAfterTemplate(), for now. [-Wdocumentation] /// \param TemplateParams if non-NULL, the template parameter lists /// that preceded this declaration. In this case, the declaration is a /// template declaration, out-of-line definition of a template, or an /// explicit template specialization. When NULL, the declaration is an /// explicit template instantiation. /// /// \param TemplateLoc when TemplateParams is NULL, the location of /// the 'template' keyword that indicates that we have an explicit /// template instantiation. llvm-svn: 167982
* The ObjC++-to-C++ personality trick is only necessary on NeXT runtimes,John McCall2012-11-141-4/+5
| | | | | | | which is not coincidentally the only place it works, either (because of how it tests for EH_TYPE symbols). llvm-svn: 167935
* fixes a buildbot failure.Fariborz Jahanian2012-11-141-0/+1
| | | | llvm-svn: 167934
* Fix 80-column violation.Fariborz Jahanian2012-11-141-3/+5
| | | | llvm-svn: 167932
* objective-C blocks: Provide layout map for byrefFariborz Jahanian2012-11-147-80/+235
| | | | | | variables captured in a block. // rdar://12184410 llvm-svn: 167931
* s/tranform/transform/Benjamin Kramer2012-11-1416-18/+18
| | | | llvm-svn: 167929
* Move some GNUStep-specific code out of CGObjCGNU.John McCall2012-11-141-22/+25
| | | | | | Patch by Jonathan Schleifer. llvm-svn: 167925
* PR14279: Work around this major miscompilation by treating move operations asRichard Smith2012-11-141-5/+14
| | | | | | | | non-trivial if they would not call a move operation, even if they would in fact call a trivial copy operation. A proper fix is to follow, but this small directed fix is intended for porting to the 3.2 release branch. llvm-svn: 167920
* When we have a MemberExpr referring to an overloaded static member function,Richard Smith2012-11-141-0/+1
| | | | | | | | | and we resolve it to a specific function based on the type which it's used as, don't forget to mark it as referenced. Fixes a regression introduced in r167514. llvm-svn: 167918
* Code cleanup: Remove trailing whitespace in unwind.h.Logan Chien2012-11-141-20/+20
| | | | llvm-svn: 167915
* Remove debugging assert.David Blaikie2012-11-141-3/+0
| | | | | | Found by Richard Smith in post-commit review of r167906. llvm-svn: 167911
* SemaTemplateDeduction.cpp: Prune two obsolete descriptions. [-Wdocumentation]NAKAMURA Takumi2012-11-141-9/+0
| | | | | | | | | | | | | | | | | * getMostSpecialized() /// \param Index if non-NULL and the result of this function is non-nULL, /// receives the index corresponding to the resulting function template /// specialization. * DeduceTemplateArguments() /// \param Name the name of the function being called. This is only significant /// when the function template is a conversion function template, in which /// case this routine will also perform template argument deduction based on /// the function to which llvm-svn: 167909
* ParseTemplate.cpp: Doxygen fix in AnnotateTemplateIdToken(). [-Wdocumentation]NAKAMURA Takumi2012-11-141-1/+1
| | | | llvm-svn: 167908
* Suppress elided variadic macro argument extension diagnostic for macros usingEli Friedman2012-11-145-4/+43
| | | | | | | | | | | | | | | | | | | | | | the related comma pasting extension. In certain cases, we used to get two diagnostics for what is essentially one extension. This change suppresses the first diagnostic in certain cases where we know we're going to print the second diagnostic. The diagnostic is redundant, and it can't be suppressed in the definition of the macro because it points at the use of the macro, so we want to avoid printing it if possible. The implementation works by detecting constructs which look like comma pasting at the time of the definition of the macro; this information is then used when the macro is used. (We can't actually detect whether we're using the comma pasting extension until the macro is actually used, but we can detecting constructs which will be comma pasting if the varargs argument is elided.) <rdar://problem/12292192> llvm-svn: 167907
* Provide the correct mangling and linkage for certain unnamed nested classes.David Blaikie2012-11-144-4/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | This corrects the mangling and linkage of classes (& their member functions) in cases like this: struct foo { struct { void func() { ... } } x; }; we were accidentally giving this nested unnamed struct 'no' linkage where it should've had the linkage of the outer class. The mangling was incorrecty too, mangling as TU-wide unnamed type mangling of $_X rather than class-scoped mangling of UtX_. This also fixes -Wunused-member-function which would incorrectly diagnose 'func' as unused due to it having no linkage & thus appearing to be TU-local when in fact it might be correctly used in another TU. Similar mangling should be applied to function local classes in similar cases but I've deferred that for a subsequent patch. Review/discussion by Richard Smith, John McCall, & especially Eli Friedman. llvm-svn: 167906
* Fix an assertion failure printing the unused-label fixit in files using CRLF ↵Eli Friedman2012-11-141-1/+8
| | | | | | line endings. <rdar://problem/12639047>. llvm-svn: 167900
* Remove another questionable use of hasTrivial*. The relevant thing for thisRichard Smith2012-11-142-115/+114
| | | | | | | test was whether the /selected/ operator= was trivial, not whether the class had any trivial (or any non-trivial) operator=s. llvm-svn: 167897
* Accept and pass arguments to __unknown_anytype in argumentJohn McCall2012-11-144-0/+39
| | | | | | | | | | | | | | | | | | | | | positions of Objective-C methods. It is possible to recover a lot of type information about Objective-C methods from the reflective metadata for their implementations. This information is not rich when it comes to struct types, however, and it is not possible to produce a type in the debugger's round-tripped AST which will really do anything useful during type-checking. Therefore we allow __unknown_anytype in these positions, which essentially disables type-checking for that argument. We infer the parameter type to be the unqualified type of the argument expression unless that expression is an explicit cast, in which case it becomes the type-as-written of that cast. rdar://problem/12565338 llvm-svn: 167896
* Revert "Use the 'count' attribute instead of the 'upper_bound' attribute."Eric Christopher2012-11-131-12/+9
| | | | | | | | temporarily since it breaks the gdb bots. This reverts commit r167807/30305bec25cac981c6d4a3b8be004401310a82a7. llvm-svn: 167887
* Don't try to save the assigned value in a Objective-C property assignmentEli Friedman2012-11-131-7/+15
| | | | | | | | | if the type of the value is a non-trivial class type. Fixes PR14318. (There's a minor ObjC++ language change here: given that we can't save the value, the type of the assignment expression is void in such cases.) llvm-svn: 167884
* [ms] Make mangleIntegerLiteral less aware of exact type of the literal.Nico Weber2012-11-131-7/+8
| | | | | | | | | | | | | Integer literal mangling does not actually depend on exact type of the literal. This will simplify calling mangleIntegerLiteral when literal type is not known, for example, when sizes or offsets are mangled as integer literals. Also, call mangleNumber instead of directly printing mangled values of 0/1, to avoid this knowledge from being in multiple places. Patch from Evgeny Eltsin! llvm-svn: 167878
* For classes that have the warn_unused_result attribute, don't apply theKaelyn Uhrain2012-11-131-1/+5
| | | | | | | attribute to the class' methods even when they return an instance of the class (e.g. assignment operators). llvm-svn: 167873
* [analyzer] Address Jordan's code review for r167813.Anna Zaks2012-11-131-20/+15
| | | | | | | This simplifies logic, fixes a bug, and adds a test case. Thanks Jordan! llvm-svn: 167868
* Revert r167801, "[preprocessor] When #including something that contributes noDaniel Dunbar2012-11-132-23/+1
| | | | | | tokens at all,". This change broke External/Nurbs in LLVM test-suite. llvm-svn: 167858
* Simplify function try/catch scope handling.David Blaikie2012-11-131-3/+3
| | | | | | Based on post-commit review feedback for r167766 by Richard Smith. llvm-svn: 167856
* Fix AST-matcher descendant visiting for Types, TypeLocs and ↵Daniel Jasper2012-11-131-1/+7
| | | | | | | | NestedNamespecifierLocs. The RecursiveASTVisitor assumes that any given Traverse-method can be called with a NULL-node. So the subclass needs to handle these appropriately. llvm-svn: 167850
* This patch makes the behavior of clang consistent with the behavior of gcc ↵Benjamin Kramer2012-11-131-7/+19
| | | | | | | | | | | | | 4.6 in cases where both -fPIC and -fPIE is used. - Separately check if -fPIE was specified in the command line and define both __PIC__ and __PIE__ when -fPIE is used. We need to check this separately because -fPIE will infer -fPIC even if its not explicitly used. - Fixed existing tests. - Added new tests for cases where both -fPIC and -fPIE is used. Author: Tareq A. Siraj <tareq.a.siraj@intel.com> Fixes: PR13221 Review: http://llvm-reviews.chandlerc.com/D94 llvm-svn: 167846
* UCNs in char literals are done (in LiteralSupport), remove FIXME. Expand UCN ↵Nico Weber2012-11-131-2/+1
| | | | | | FIXME in LexNumericConstant. llvm-svn: 167818
* Copy the decls returned by DeclContext::lookup_result to aArgyrios Kyrtzidis2012-11-131-12/+27
| | | | | | | | | new container so we can safely iterate over them. The container holding the lookup decls can under certain conditions be changed while iterating (e.g. because of deserialization). llvm-svn: 167816
* Fix a Malloc Checker FP by tracking return values from initWithCharacterAnna Zaks2012-11-131-20/+81
| | | | | | | | | | and other functions. When these functions return null, the pointer is not freed by them/ownership is not transfered. So we should allow the user to free the pointer by calling another function when the return value is NULL. llvm-svn: 167813
* Use the 'count' attribute instead of the 'upper_bound' attribute.Bill Wendling2012-11-131-9/+12
| | | | | | | | | If we have a type 'int a[1]' and a type 'int b[0]', the generated DWARF is the same for both of them because we use the 'upper_bound' attribute. Instead use the 'count' attrbute, which gives the correct number of elements in the array. <rdar://problem/12566646> llvm-svn: 167807
* Fix IR generation for bool on PPC (and any other target where bool is not 8 ↵Eli Friedman2012-11-131-5/+7
| | | | | | | | bits in memory). PR11777. llvm-svn: 167802
* [preprocessor] When #including something that contributes no tokens at all,Argyrios Kyrtzidis2012-11-132-1/+23
| | | | | | | | | don't recursively continue lexing. This avoids a stack overflow with a sequence of many empty #includes. rdar://11988695 llvm-svn: 167801
* In Lexer::LexTokenInternal, avoid code duplication; no functionality change.Argyrios Kyrtzidis2012-11-131-39/+26
| | | | llvm-svn: 167800
* Disable accelerator tables when compiling with LTO.Bill Wendling2012-11-131-9/+16
| | | | | | | | LTO doesn't generate correct accelerator tables. This is due to the general lack correct of debug info for LTO. Disable it when using LTO. <rdar://problem/12401423> llvm-svn: 167799
* Fix some wrong-code bugs in implicitly-defined assignment operators:Richard Smith2012-11-131-35/+43
| | | | | | | - In C++11, perform overload resolution over all assignment operators, rather than just looking for copy/move assignment operators. - Clean up after temporaries produced by operator= immediately, rather than accumulating them until the end of the function. llvm-svn: 167798
* A couple of small fixes to r167783Kaelyn Uhrain2012-11-131-1/+1
| | | | llvm-svn: 167791
* [analyzer] Address Jordan's feedback for r167780.Anna Zaks2012-11-131-4/+5
| | | | llvm-svn: 167790
* Fix bad CFG construction bug when handling C++ 'try' statements.Ted Kremenek2012-11-131-13/+14
| | | | | | | | | | | | | | | | | This code assigned the last created CFGBlock* to the variable 'Block', which is a scratch variable which is null'ed out after a block is completed. By assigning the last created block to 'Block', we start editing a completed block, inserting CFGStmts that should be in another block. This was the case with 'try'. The test case that showed this had a while loop inside a 'try', and the logic before the while loop was being included as part of the "condition block" for the loop. This showed up as a bogus dead store, but could have lots of implications. Turns out this bug was replicated a few times within CFG.cpp, so I went and fixed up those as well. llvm-svn: 167788
* When filtering the list of associated namespaces so that we don't suggest peopleNick Lewycky2012-11-131-11/+9
| | | | | | | add functions to namespace 'std', also filter out namespaces with '__' anywhere in the name. llvm-svn: 167786
* Enable C++11 attribute syntax for warn_unused_result and allow it to beKaelyn Uhrain2012-11-122-1/+11
| | | | | | | | | | | | | applied to CXXRecordDecls, where functions with that return type will inherit the warn_unused_result attribute. Also includes a tiny fix (with no discernable behavior change for existing code) to re-sync AttributeDeclKind enum and err_attribute_wrong_decl_type with warn_attribute_wrong_decl_type since the enum is used with both diagnostic messages to chose the correct description. llvm-svn: 167783
* [analyzer] Follow up to r167762 - precisely determine the adjustmentAnna Zaks2012-11-121-3/+13
| | | | | | | | | | | | | | | | | conditions. The adjustment is needed only in case of dynamic dispatch performed by the analyzer - when the runtime declaration is different from the static one. Document this explicitly in the code (by adding a helper). Also, use canonical Decls to avoid matching against the case where the definition is different from found declaration. This fix suppresses the testcase I added in r167762, so add another testcase to make sure we do test commit r167762. llvm-svn: 167780
* Factor duplicated implicit memcpy call generation code out of copy/moveRichard Smith2012-11-121-200/+69
| | | | | | | | assignment generation. This incidentally avoids reusing the same Expr* across multiple statements in the same object; that was generating slightly broken ASTs, but I couldn't trigger any observable bad behavior, so no test. llvm-svn: 167779
* Finish reverting r167761, it's causing test failures.Eric Christopher2012-11-121-0/+3
| | | | llvm-svn: 167777
* Fix more try scoping bugs introduced by r167650.David Blaikie2012-11-122-9/+6
| | | | | | | Introduces more clear scoping flags & flag combinations which should hopefully be more understandable. llvm-svn: 167766
* [analyzer] Fix a regression (from r 165079): compare canonical types.Anna Zaks2012-11-121-0/+2
| | | | | | | | | | | Suppresses a leak false positive (radar://12663777). In addition, we'll need to rewrite the adjustReturnValue() method not to return UnknownVal by default, but rather assert in cases we cannot handle. To make it possible, we need to correctly handle some of the edge cases we already know about. llvm-svn: 167762
* Don't test for incomplete types.Bill Wendling2012-11-121-3/+0
| | | | llvm-svn: 167761
OpenPOWER on IntegriCloud