summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Enable AVX on AMD Bulldozer processors.Craig Topper2012-05-011-1/+1
| | | | llvm-svn: 155900
* Abstract the emission of global destructors into ABI-specific codeJohn McCall2012-05-017-67/+96
| | | | | | | | | | | | | and only consider using __cxa_atexit in the Itanium logic. The default logic is to use atexit(). Emit "guarded" initializers in Microsoft mode unconditionally. This is definitely not correct, but it's closer to correct than just not emitting the initializer. Based on a patch by Timur Iskhodzhanov! llvm-svn: 155894
* PR12710 - broken default argument handling for templates.David Blaikie2012-05-011-7/+5
| | | | | | | | | | | | | | | I broke this in r155838 by not actually instantiating non-dependent default arg expressions. The motivation for that change was to avoid producing duplicate conversion warnings for such default args (we produce them once when we parse the template - there's no need to produce them at each instantiation) but without actually instantiating the default arg, things break in weird ways. Technically, I think we could still get the right diagnostic experience without the bugs if we instantiated the non-dependent args (for non-dependent params only) immediately, rather than lazily. But I'm not sure if such a refactoring/ change would be desirable so here's the conservative fix for now. llvm-svn: 155893
* Teach RetainCountchecker about IORegistryEntrySearchCFProperty returning ↵Ted Kremenek2012-05-011-0/+1
| | | | | | retained objects. I know there is an SDK enhancement request for this to have the cf_returns_retained annotation, so this is just a stop gap. llvm-svn: 155887
* Refactor the C++ ABI code a little bit to take advantage ofJohn McCall2012-05-015-165/+190
| | | | | | | | what I'm going to treat as basically universal properties of array-cookie code. Implement MS array cookies on top of that. Based on a patch by Timur Iskhodzhanov! llvm-svn: 155886
* Fix use of uninitialized variable caught by GCC's -Wmaybe-uninitialized.David Blaikie2012-05-011-1/+3
| | | | | | Review by Doug Gregor. llvm-svn: 155880
* When mangling a synthetic function declaration, we might not haveJohn McCall2012-05-011-5/+9
| | | | | | | type-source information for its parameters. Don't crash when mangling them in the MS C++ ABI. Patch by Timur Iskhodzhanov! llvm-svn: 155879
* Turn the mixed-sign-comparison diagnostic into a runtime behaviorDouglas Gregor2012-05-011-3/+4
| | | | | | diagnostic, from Eitan Adler! llvm-svn: 155876
* Print inline for inline namespaces, from Faisal ValiDouglas Gregor2012-05-011-0/+2
| | | | llvm-svn: 155875
* Let's use the correct bool this time.Kaelyn Uhrain2012-05-011-1/+1
| | | | llvm-svn: 155871
* A couple of very small tweaks suggested by Doug in reply to r155580 and r155163.Kaelyn Uhrain2012-05-012-3/+2
| | | | llvm-svn: 155870
* Remove ref/value inconsistency in redecl_iterator.David Blaikie2012-05-013-3/+3
| | | | | | | | | | | | | Similar to r155808 - this mistake has been made in a few iterators. Based on Chandler Carruth's feedback to r155808 I added an implicit conversion to Decl* to ease adoption/usage. Useful for the pointer comparison, but not the dyn_cast (due to template argument deduction causing the conversion not to be used) - there for future convenience, though. This idiom (op T* for iterators) seems to be fairly idiomatic within the LLVM codebase & I'll likely add it as I fix up the other iterators here. llvm-svn: 155869
* My first effort to do this more subtly failed, so elaboratelyJohn McCall2012-05-011-31/+59
| | | | | | | test for an invalid declaration at every single place in the constant evaluator that's about to request a struct layout. llvm-svn: 155868
* malloc size checker: Ignore const'ness of pointer types when determining of ↵Ted Kremenek2012-05-011-1/+24
| | | | | | | | a sizeof() type is compatible with a pointed type. Fixes <rdar://problem/11292586>. llvm-svn: 155864
* Add support for openSUSE 12.2, from Ismail Donmez!Douglas Gregor2012-04-301-1/+3
| | | | llvm-svn: 155860
* clang_getCursorLexicalParent should return a translation unit cursor for ↵Douglas Gregor2012-04-301-0/+1
| | | | | | declarations at the global scope, from Evan P. Fixes PR9083. llvm-svn: 155858
* Remove -Wc++98-compat warning for an outrageously-rare circumstance of 'this'Richard Smith2012-04-301-4/+0
| | | | | | | | | | being used in an exception specification in a way which isn't otherwise ill-formed in C++98: this warning also incorrectly triggered on uses of 'this' inside thread-safety attributes, and the mechanism required to tell these cases apart is more complex than can be justified by the (minimal) value of this part of -Wc++98-compat. llvm-svn: 155857
* When going through references to check if the function returns the addressArgyrios Kyrtzidis2012-04-301-24/+34
| | | | | | | | | | | | | | | | of a local variable, make sure we don't infinitely recurse when the reference binds to itself. e.g: int* func() { int& i = i; // assign non-exist variable to a reference which has same name. return &i; // return pointer } rdar://11345441 llvm-svn: 155856
* modern objective-c translator. named aggregate typesFariborz Jahanian2012-04-301-13/+68
| | | | | | | | defined inside the objc class belong to class's decl. scope. This is to conform to objective-c rules. // rdar://11351299 llvm-svn: 155855
* Store the source range of a CXXOperatorCallExpr in the Expr object instead ofArgyrios Kyrtzidis2012-04-303-3/+5
| | | | | | | | | | | | | | | calculating it recursively. boost::assign::tuple_list_of uses the trick of chaining call operator expressions in order to declare a "list of tuples", e.g: std::vector<tuple> v = boost::assign::tuple_list_of(1, "foo")(2, "bar")(3, "qqq"); Due to CXXOperatorCallExpr calculating its source range recursively we would get significant slowdowns with a large number of chained call operator expressions and the potential for stack overflow. rdar://11350116 llvm-svn: 155848
* minor refactoring of modern objc translator.Fariborz Jahanian2012-04-301-5/+17
| | | | llvm-svn: 155843
* Add FixItHint for -Wnull-conversion to initialize with an appropriate literal.David Blaikie2012-04-304-38/+53
| | | | | | Reviewed by Doug Gregor. llvm-svn: 155839
* Fix PR12378: provide conversion warnings on default args of function templatesDavid Blaikie2012-04-302-4/+11
| | | | | | | | | | | | | Apparently we weren't checking default arguments when they were instantiated. This adds the check, fixes the lack of instantiation caching (which seems like it was mostly implemented but just missed the last step), and avoids implementing non-dependent default args (for non-dependent parameter types) as uninstantiated default arguments (so that we don't warn once for every instantiation when it's not instantiation dependent). Reviewed by Richard Smith. llvm-svn: 155838
* HandleDeclarator() returns NULL for semantic disasters. Deal with itDouglas Gregor2012-04-301-1/+1
| | | | | | | when we're in an Objective-C container context. Fixes <rdar://problem/11286701>. llvm-svn: 155836
* Add -Wloop-analysis. This warning will fire on for loops which the variablesRichard Trieu2012-04-301-0/+216
| | | | | | in the loop conditional do not change. llvm-svn: 155835
* modern objective-c translation: de-virtualize allFariborz Jahanian2012-04-301-9/+9
| | | | | | local rewriting functions. llvm-svn: 155826
* Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie2012-04-3054-293/+302
| | | | | | | | | | | | | filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) llvm-svn: 155808
* PR11926 + duplicates: Fix crash in -Wuninitialized when using a compiler likeRichard Smith2012-04-301-1/+2
| | | | | | | | | | | g++4.7, which reuses stack space allocated for temporaries. CFGElement::getAs returns a suitably-cast version of 'this'. Patch by Markus Trippelsdorf! No test: this code has the same observable behavior as the old code when built with most compilers, and the tests were already failing when built with a compiler for which this produced a broken binary. llvm-svn: 155803
* PR9546, DR1268: A prvalue cannot be reinterpret_cast to an rvalue referenceRichard Smith2012-04-291-4/+3
| | | | | | type. But a glvalue can be reinterpret_cast to either flavor of reference. llvm-svn: 155789
* PR12688: ParseCXXClassMemberDeclaration's sometimes-null ThisDecl takes anotherRichard Smith2012-04-291-1/+1
| | | | | | | victim. Don't crash if we have a delay-parsed exception specification for a class member which is invalid in a way which precludes building a FunctionDecl. llvm-svn: 155788
* [class.copy]p23: Fix an assertion caused by incorrect argument numbering in aRichard Smith2012-04-291-2/+2
| | | | | | | diagnostic, add a test for this paragraph, and tighten up the diagnostic wording a little. llvm-svn: 155784
* Currently __builtin_annotation() only annotates an i32.Julien Lerouge2012-04-281-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | i32 __builtin_annotation(i32, string); Applying it to i64 (e.g., long long) generates the following IR. trunc i64 {{.*}} to i32 call i32 @llvm.annotation.i32 zext i32 {{.*}} to i64 The redundant truncation and extension make the result difficult to use. This patch makes __builtin_annotation() generic. type __builtin_annotation(type, string); For the i64 example, it simplifies the generated IR to: call i64 @llvm.annotation.i64 Patch by Xi Wang! llvm-svn: 155764
* improve error recovery for extra ')'s after a if/switch/while condition. ↵Chris Lattner2012-04-281-0/+10
| | | | | | | | | | | | | | | | | | Before: t.c:3:9: error: expected expression if (x)) { ^ .. which isn't even true - a statement or expression is fine. After: t.c:3:9: error: extraneous ')' after condition, expected a statement if (x)) { ^ This is the second part of PR12595 llvm-svn: 155762
* switch some uses of ExpectAndConsume(tok::semi to use ExpectAndConsumeSemi. ↵Chris Lattner2012-04-284-10/+6
| | | | | | | | | | | | | | | | | | | | This allows us to improve this diagnostic (telling us to insert another ")": t.c:2:19: error: expected ';' at end of declaration int x = 4+(5-12)); ^ ; to: t.c:2:19: error: extraneous ')' before ';' int x = 4+(5-12)); ^ ...telling us to remove the ")". This is PR12595. There are more uses of ExpectAndConsumeSemi that could be switched over, but I don't hit them on a daily basis :) llvm-svn: 155759
* isCXX98PODType: Avoid dispatch on the language standard when recursing.Benjamin Kramer2012-04-281-2/+2
| | | | llvm-svn: 155758
* C++11 weakens the requirement for types used with offsetof from POD to ↵Benjamin Kramer2012-04-281-2/+10
| | | | | | standard layout type. llvm-svn: 155757
* Rename isPODType (using the C++98 rules) into isCXX98PODType and make ↵Benjamin Kramer2012-04-282-1/+10
| | | | | | | | | | isPODType decide which one to use based on LangOptions. - -Wc++98-compat depends on the c++98 definition - Now __is_pod returns the right thing in c++11 and c++98 mode - All changes to the type traits test are validated against g++ 4.7 llvm-svn: 155756
* Revert "Use the C++11 definition of PODness for __is_pod in C++11 mode."Benjamin Kramer2012-04-281-2/+1
| | | | | | This is just papering over a major bug in isPODType, real fix coming up soon. llvm-svn: 155755
* Use the C++11 definition of PODness for __is_pod in C++11 mode.Benjamin Kramer2012-04-281-1/+2
| | | | | | Keep the old definition for C++98 so we don't break tr1::is_pod. llvm-svn: 155754
* [analyzer] Remove references to idx::TranslationUnit. Index is dead, ↵Jordy Rose2012-04-283-10/+5
| | | | | | cross-TU inlining never panned out. llvm-svn: 155751
* objective-c modern translator: Correctly translateFariborz Jahanian2012-04-271-1/+38
| | | | | | | nonfragile ivar access code when ivar type is a locally defined struct/union type. // rdar://11323187 llvm-svn: 155740
* When @encode'ing a C++ class that has empty base classes, we can endDouglas Gregor2012-04-271-5/+2
| | | | | | | up with gaps when the class inherits from the same empty base class more than once. Fixes <rdar://problem/11324167>. llvm-svn: 155738
* modern objective-c translator: _OBJC_PROTOCOL_REFERENCE_* Fariborz Jahanian2012-04-271-2/+1
| | | | | | symbols should be static. // rdar://11337074 llvm-svn: 155736
* [driver] Don't try to set the deployment target when there is no boundChad Rosier2012-04-272-4/+4
| | | | | | | | | architecture; this was happening for tools such as lipo and dsymutil. Also, if no -arch option has been specified, set the architecture based on the TC default. rdar://11329656 llvm-svn: 155730
* PR12224 (sort of): Diagnose inheriting constructor declarations in C++11 mode.Richard Smith2012-04-271-2/+4
| | | | | | | We do not support IRGen for these, and get some parts of the semantic analysis wrong. llvm-svn: 155728
* Imrpove the note text for when a non-type decl hides a tag typeKaelyn Uhrain2012-04-272-2/+2
| | | | llvm-svn: 155723
* Fix logic such that we only call getToolChain once. No functional changeChad Rosier2012-04-271-1/+3
| | | | | | intended. llvm-svn: 155719
* Remove redundant calls to BAA->getArchName(). No functional changeChad Rosier2012-04-271-2/+3
| | | | | | intended. llvm-svn: 155718
* Revert 155679; Not a typo.Chad Rosier2012-04-271-1/+1
| | | | llvm-svn: 155708
* Use enum to set debug info size generated by ClangAlexey Samsonov2012-04-277-15/+32
| | | | llvm-svn: 155697
OpenPOWER on IntegriCloud