summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Improve diagnostics when we fail to convert from a source type to aDouglas Gregor2010-04-091-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | destination type for initialization, assignment, parameter-passing, etc. The main issue fixed here is that we used rather confusing wording for diagnostics such as t.c:2:9: warning: initializing 'char const [2]' discards qualifiers, expected 'char *' [-pedantic] char *name = __func__; ^ ~~~~~~~~ We're not initializing a 'char const [2]', we're initializing a 'char *' with an expression of type 'char const [2]'. Similar problems existed for other diagnostics in this area, so I've normalized them all with more precise descriptive text to say what we're initializing/converting/assigning/etc. from and to. The warning for the code above is now: t.c:2:9: warning: initializing 'char *' from an expression of type 'char const [2]' discards qualifiers [-pedantic] char *name = __func__; ^ ~~~~~~~~ Fixes <rdar://problem/7447179>. llvm-svn: 100832
* For 'open' check in UnixAPIChecker, hard code value of 'O_CREAT' on Darwin.Ted Kremenek2010-04-081-18/+34
| | | | | | | This is still not an ideal solution, but should disable the check for other targets where the value of O_CREAT is different. llvm-svn: 100818
* Temporarily only enable 'open' check on Mac OS X to unbreak Windows ↵Ted Kremenek2010-04-081-0/+7
| | | | | | | | buildbot. I'm looking into an alternate fix right now. llvm-svn: 100816
* Downgrade the "declaration does not declare anything" error to aDouglas Gregor2010-04-081-3/+2
| | | | | | | warning. It's not harmful to have such pointless declarations, and GCC does not diagnose this issue consistently. llvm-svn: 100814
* Implement method type encoding in the presenseFariborz Jahanian2010-04-085-4/+9
| | | | | | of c-style arguments. Completes radar 7445205. llvm-svn: 100813
* Explain that a template needs arguments to make it into a type, forJeffrey Yasskin2010-04-081-0/+18
| | | | | | variable declarations. llvm-svn: 100809
* Set access properly on instantiated friend class template declarations.John McCall2010-04-081-2/+7
| | | | | | Fixes PR6752. llvm-svn: 100806
* Add static analyzer check for calls to 'pthread_once()' where the ↵Ted Kremenek2010-04-081-0/+45
| | | | | | | | control-flow has automatic storage. This matches the corresponding check for 'dispatch_once()'. llvm-svn: 100803
* Remove micro-optimization for not issueing CFG-based warnings for 'static ↵Ted Kremenek2010-04-082-62/+3
| | | | | | | | | | inline' functions unless they are used. I discussed this with Daniel Dunbar, and we agreed that this provides an inconsistent warnings experience for the user and that there were genuine cases where we wouldn't want to do this optimization. llvm-svn: 100800
* Introduce an egregious hack to work around a bug in libstdc++ 4.2.x'sDouglas Gregor2010-04-081-4/+37
| | | | | | | | | <tr1/hashtable> header, where a friend class template std::tr1::__detail::_Map_base is declared with the wrong template parameters. GCC doesn't catch the problem, so Clang does a little back-flip to avoid diagnosing just this one instance of the problem. llvm-svn: 100790
* Fix a misuse of iterators when iterating through block'sFariborz Jahanian2010-04-081-2/+2
| | | | | | parameters list for encoding. llvm-svn: 100788
* Make CXXScopeSpec invalid when incomplete, and propagate that into anyJeffrey Yasskin2010-04-0813-82/+87
| | | | | | | Declarator that depends on it. This fixes several redundant errors and bad recoveries. llvm-svn: 100779
* Rename CGVtable files to CGVTables.Anders Carlsson2010-04-085-5/+5
| | | | llvm-svn: 100778
* Clarify an assert.Anders Carlsson2010-04-081-0/+3
| | | | llvm-svn: 100776
* Unbreak the buildDouglas Gregor2010-04-081-1/+2
| | | | llvm-svn: 100775
* Eliminate excessive PCH deserialization caused by the search forDouglas Gregor2010-04-083-36/+12
| | | | | | | | | | | | | | | | | | | | | | __cxxabiv1::__fundamental_type_info in every translation unit. Previously, we would perform name lookup for __cxxabiv1::__fundamental_type_info at the end of IRGen for a each translation unit, to determine whether it was present. If so, we we produce type information for all of the fundamental types. However, this name lookup causes PCH deserialization of a significant part of the translation unit, which has a woeful impact on performance. With this change, we now look at each record type after we've generated its vtable to see if it is __cxxabiv1::__fundamental_type_info. If so, we generate type info for all of the fundamental types. This works because __cxxabiv1::__fundamental_type_info should always have a key function (typically the virtual destructor), that will be defined once in the support library. The fundamental type information will end up there. Fixes <rdar://problem/7840011>. llvm-svn: 100772
* Remove caseless switch.Benjamin Kramer2010-04-081-7/+3
| | | | llvm-svn: 100770
* Implement dependent friend function template specializations.John McCall2010-04-086-34/+149
| | | | llvm-svn: 100753
* Removed unused object.Ted Kremenek2010-04-081-1/+0
| | | | llvm-svn: 100750
* Fronted: Kill overly specialized RecordLayoutDumper, just make ↵Daniel Dunbar2010-04-084-40/+25
| | | | | | -dump-record-layouts a bit that Sema honors. llvm-svn: 100747
* AST: Move C++ record layout dumping to ASTContext::DumpRecordLayout.Daniel Dunbar2010-04-082-212/+205
| | | | llvm-svn: 100746
* IRgen: Move the bit-field access type into CGBitFieldInfo, and change ↵Daniel Dunbar2010-04-085-27/+39
| | | | | | bit-field LValues to just store the base address of object containing the bit-field. llvm-svn: 100745
* Patch to implement gcc's cstyle arguments in objcFariborz Jahanian2010-04-084-8/+44
| | | | | | methods. wip. llvm-svn: 100734
* refactor out a function.Chris Lattner2010-04-081-24/+29
| | | | llvm-svn: 100733
* Fix a (bogus) uninitialized-member-of-local warning.John McCall2010-04-081-1/+1
| | | | llvm-svn: 100732
* Use SmallVector instead of an std::queue.Ted Kremenek2010-04-081-2/+1
| | | | llvm-svn: 100730
* When a template (without arguments) is passed as a template typeJeffrey Yasskin2010-04-082-1/+30
| | | | | | | parameter, explicitly ask the user to give it arguments. We used to complain that it wasn't a type and expect the user to figure it out. llvm-svn: 100729
* Fix some redundant errors by changing CXXScopeSpec::isSet calls intoJeffrey Yasskin2010-04-074-5/+8
| | | | | | isNotEmpty calls. llvm-svn: 100722
* Implement checking for template literal operator functions. ThisAlexis Hunt2010-04-071-4/+21
| | | | | | | code won't actually get used yet because we don't handle non-type parameter packs, but when we do, this code should jump in and work. llvm-svn: 100716
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-075-12/+12
| | | | llvm-svn: 100708
* Updated comment to reflect changes made in the most recent draft.Alexis Hunt2010-04-071-5/+3
| | | | llvm-svn: 100707
* Fixed 80-cols violationAlexis Hunt2010-04-071-1/+1
| | | | llvm-svn: 100704
* add a new driver-level -ferror-limit=412 option, which causes clang to stopChris Lattner2010-04-071-0/+6
| | | | | | | | | | | | | | | | | emitting diagnostics after it has produced that many errors. Give this a default value of 20 which produces plenty of errors for people to fix before recompiling but not so many that their entire console scrolls away when the compiler gets confused. The experience looks like this: $ clang foo.c <tons of crap> foo.c:102:3: error: unknown type name 'somethingbad' somethingbad x; ^ fatal error: too many errors emitted, stopping now 36 warnings and 20 errors generated. llvm-svn: 100689
* add clang -cc1 level support for "-ferror-limit 42"Chris Lattner2010-04-073-2/+11
| | | | llvm-svn: 100687
* Return early from Sema::MarkDeclarationReferenced when we know thereDouglas Gregor2010-04-072-2/+11
| | | | | | | | | isn't any extra work to perform. Also, don't check for unused parameters when the warnings will be suppressed anyway. Improves performance of -fsyntax-only on 403.gcc's combine.c by ~2.5%. <rdar://problem/7836787> llvm-svn: 100686
* add capabilities to stop emitting errors after some limit.Chris Lattner2010-04-071-0/+7
| | | | | | Right now the limit is 0 (aka disabled) llvm-svn: 100684
* Don't emit an 'unused expression' warning for '||' and '&&' expressions that ↵Ted Kremenek2010-04-071-12/+15
| | | | | | | | contain assignments or similar side-effects. llvm-svn: 100676
* Instead of counting totally diagnostics, split the count into a countChris Lattner2010-04-072-7/+18
| | | | | | | | | | | | | | | of errors and warnings. This allows us to emit something like this: 2 warnings and 1 error generated. instead of: 3 diagnostics generated. This also stops counting 'notes' because they are just follow-on information about the previous diag, not a diagnostic in themselves. llvm-svn: 100675
* Improve handling of friend types in several ways:Douglas Gregor2010-04-072-64/+63
| | | | | | | | | | | - When instantiating a friend type template, perform semantic analysis on the resulting type. - Downgrade the errors concerning friend type declarations that do not refer to classes to ExtWarns in C++98/03. C++0x allows practically any type to be befriended, and ignores the friend declaration if the type is not a class. llvm-svn: 100635
* Split Sema::ActOnFriendTypeDecl into Sema::CheckFriendTypeDecl (forDouglas Gregor2010-04-072-35/+63
| | | | | | | | semantic analysis) and Sema::ActOnFriendTypeDecl (the action callback). This is a prerequisite for improving template instantiation of friend type declarations. llvm-svn: 100633
* @llvm.sqrt isn't really close enough to C's sqrt to justify emitting callsJohn McCall2010-04-071-7/+6
| | | | | | | | to the intrinsic, even when math-errno is off. Fixes rdar://problem/7828230 by falling back on the library function. llvm-svn: 100613
* a ridiculous amount of propagation through the backend later, Chris Lattner2010-04-071-2/+9
| | | | | | | | | | | | | | | | have the code generate slap a srcloc metadata on inline asm nodes. This allows us to diagnose invalid inline asms with such nice diagnostics as: <inline asm>:1:2: error: unrecognized instruction abc incl %eax ^ asm.c:2:12: note: generated from here __asm__ ("abc incl %0" : "+r" (X)); ^ 2 diagnostics generated. llvm-svn: 100608
* Teach -Wsign-compare to treat 1 << blah as "idiomatically non-negative".John McCall2010-04-071-0/+11
| | | | | | Fixes a spurious warning in LLVM. llvm-svn: 100595
* Fix crash in StoreManager::CastRegion() when the base region is a type with ↵Ted Kremenek2010-04-071-7/+8
| | | | | | 0 size. llvm-svn: 100594
* Check access for the implicit calls to destructors that occur when weJohn McCall2010-04-072-2/+6
| | | | | | | | have a temporary object in C++. Also fix a tag mismatch that Doug noticed. llvm-svn: 100593
* Implement code completion for Objective-C method declarations andDouglas Gregor2010-04-074-1/+238
| | | | | | | | | | | | | | | | definitions, e.g., after - or - (id) we'll find all of the "likely" instance methods that one would want to declare or define at this point. In the latter case, we only produce results whose return types match "id". llvm-svn: 100587
* Minor clean up.Fariborz Jahanian2010-04-062-21/+0
| | | | llvm-svn: 100583
* default access for synthesize ivar is @protect.Fariborz Jahanian2010-04-061-1/+1
| | | | | | Fixes radar 7823675. llvm-svn: 100582
* Patch to not build ivar ASTs when they are ilegallyFariborz Jahanian2010-04-062-12/+19
| | | | | | declared in categories. llvm-svn: 100577
* Devote a special diagnostic to the typoJohn McCall2010-04-061-0/+17
| | | | | | | (void*) someFunction(5, 10, 15, 20); where the cast is presumably meant to be to 'void'. llvm-svn: 100574
OpenPOWER on IntegriCloud