summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* New libclang API to expose container type for code completion, fromDouglas Gregor2011-07-211-5/+12
| | | | | | Connor Wakamo! llvm-svn: 135651
* When copping out on a friend template declaration, be sure to mark itsAlexis Hunt2011-07-211-4/+6
| | | | | | access specifier as public. llvm-svn: 135649
* Rework the detailed preprocessing record to separate preprocessingDouglas Gregor2011-07-214-70/+61
| | | | | | | | | | | | | | | entities generated directly by the preprocessor from those loaded from the external source (e.g., the ASTReader). By separating these two sets of entities into different vectors, we allow both to grow independently, and eliminate the need for preallocating all of the loaded preprocessing entities. This is similar to the way the recent SourceManager refactoring treats FileIDs and the source location address space. As part of this, switch over to building a continuous range map to track preprocessing entities. llvm-svn: 135646
* Addressing code review comments for commit 135509 - Add FixItHints in case a ↵Anna Zaks2011-07-211-8/+32
| | | | | | C++ function call is missing * or & operators on llvm-svn: 135643
* objc-arc: Fixes a crash @throw'ing an objc message.Fariborz Jahanian2011-07-201-1/+2
| | | | | | // pr10411 llvm-svn: 135638
* Continuing to improve and generalize how IDs are handled in ASTReader. This ↵Jonathan D. Turner2011-07-201-12/+12
| | | | | | patch cleans up and generalizes TypeID loading and uses a similar table-lookup to Doug's previous Decl patch. llvm-svn: 135622
* Temporarily revert r135614 while I fix the cmake build.Chad Rosier2011-07-205-124/+15
| | | | llvm-svn: 135621
* When the compiler crashes, the compiler driver now produces diagnostic ↵Chad Rosier2011-07-205-15/+124
| | | | | | | | | information including the fully preprocessed source file(s) and command line arguments. The developer is asked to attach this diagnostic information to a bug report. llvm-svn: 135614
* Fix -Wuninitialized regression involving functions invalidating parameters ↵Ted Kremenek2011-07-201-1/+3
| | | | | | passed by reference. llvm-svn: 135610
* If -ccc-host-triple i386-pc-win32-macho or -ccc-host-triple Chad Rosier2011-07-201-1/+9
| | | | | | | | x86_64-pc-win32-macho is used in conjunction with -no-integrated-as go ahead and use the Darwin system assembler. rdar://9785470 llvm-svn: 135604
* arc-objc++: Issue an arc specific diagnostic when overload resolutionFariborz Jahanian2011-07-201-1/+14
| | | | | | | fails because of lifetime differences of parameter and argument type. // rdar://9790531 llvm-svn: 135593
* Unbreak build after API change.Benjamin Kramer2011-07-201-6/+7
| | | | llvm-svn: 135585
* add raw_ostream and Twine to LLVM.h, eliminating a ton of llvm:: qualifications.Chris Lattner2011-07-202-8/+8
| | | | llvm-svn: 135577
* now that we have a centralized place to do so, add some using declarations forChris Lattner2011-07-2015-91/+92
| | | | | | | some common llvm types: stringref and smallvector. This cleans up the codebase quite a bit. llvm-svn: 135576
* introduce a centralized place to introduce and inject llvm types into theChris Lattner2011-07-201-1/+1
| | | | | | | | clang namespace. There are a number of LLVM types that are used pervasively and it doesn't make sense to keep qualifying them. Start with casting operators. llvm-svn: 135574
* fix rdar://9780211 - Clang crashes with an assertion failure building ↵Chris Lattner2011-07-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | WKView.mm from WebKit This is something of a hack, the problem is as follows: 1. we instantiate both copied of RetainPtr with the two different argument types (an id and protocol-qualified id). 2. We refer to the ctor of one of the instantiations when introducing global "x", this causes us to emit an llvm::Function for a prototype whose "this" has type "RetainPtr<id<bork> >*". 3. We refer to the ctor of the other instantiation when introducing global "y", however, because it *mangles to the same name as the other ctor* we just use a bitcasted version of the llvm::Function we previously emitted. 4. We emit deferred declarations, causing us to emit the body of the ctor, however the body we emit is for RetainPtr<id>, which expects its 'this' to have an IR type of "RetainPtr<id>*". Because of the mangling collision, we don't have this case, and explode. This is really some sort of weird AST invariant violation or something, but hey a bitcast makes the pain go away. llvm-svn: 135572
* fix a case where we're using ConvertType for a memory object.Chris Lattner2011-07-201-1/+1
| | | | | | It doesn't matter in practice, but it is good to be tidy. llvm-svn: 135571
* as eli points out, we're not doing memory stuff here. While ConvertType Chris Lattner2011-07-202-3/+2
| | | | | | | and ConvertTypeForMem are the same for pointers, it is best to just use ConvertType. Thanks Eli! llvm-svn: 135567
* fix PR10395 - array decay can produce an interesting type whenChris Lattner2011-07-201-1/+4
| | | | | | | decaying an array of incomplete type (which has type [0 x i8]*) to a normal pointer (which has incompletetype*). llvm-svn: 135565
* Use a ContinuousRangeMap to map from the global macro definition ID inDouglas Gregor2011-07-201-16/+19
| | | | | | | | | | | the AST reader down to the AST file + local ID, rather than walking the PCH chain. More cleanup/generalization, although there is more work to do for preprocessed entities. In particular, the "preallocation" scheme for preprocessed entities is not going to work well with late loading of PCH files, and it's likely we'll have to do something akin to the SourceManager's negative/positive loading. llvm-svn: 135556
* Use a ContinuousRangeMap to map from the global selector ID in the ASTDouglas Gregor2011-07-201-17/+18
| | | | | | | reader down to the AST file + local ID, rather than walking the PCH chain. No functionality change; this is generalization and cleanup. llvm-svn: 135554
* PR10392: "#pragma GCC visibility" must not expand macros in itsJoerg Sonnenberger2011-07-201-5/+5
| | | | | | arguments. llvm-svn: 135552
* Use a ContinuousRangeMap to map from the global identifier ID in theDouglas Gregor2011-07-201-19/+17
| | | | | | | AST reader down to the AST file + local ID, rather than walking the PCH chain. No functionality change; this is generalization and cleanup. llvm-svn: 135551
* Use a ContinuousRangeMap to map from the global declaration ID in theDouglas Gregor2011-07-202-13/+13
| | | | | | | | AST reader down to the AST file + local ID within that file, rather than lamely walking the PCH chain. There's no actual functionality change now, but this is cleaner and more general. llvm-svn: 135548
* SpellingJoerg Sonnenberger2011-07-201-1/+1
| | | | llvm-svn: 135545
* Replace r134583's fix for PR10290 with one which also works for ↵Richard Smith2011-07-203-44/+25
| | | | | | non-value-dependent cases. llvm-svn: 135543
* This fix (thanks to Doug Gregor) corrects a bugSean Callanan2011-07-191-3/+12
| | | | | | | | | | | | in ImportDefinition when replacing a previously forward-declared CXXRecordDecl with its full definition. The forward-declared type's DefinitionData had not been intialized for the forward-declared type, so adding fields to the Decl caused CXXRecordDecl::addedMember() to crash when accessing the DefinitionData. llvm-svn: 135530
* Fix false negative in -Wuninitialized involving a () wrapping an ↵Ted Kremenek2011-07-191-6/+11
| | | | | | lvalue-to-rvalue conversion in a DeclStmt. llvm-svn: 135525
* Fix assertion failure in UninitializedValues.cpp where an lvalue to rvalue ↵Ted Kremenek2011-07-191-2/+3
| | | | | | conversion is wrapped in a parenthesis. llvm-svn: 135519
* [analyzer] Very minor cleanup in PthreadLockChecker. No functionality change.Jordy Rose2011-07-191-9/+9
| | | | llvm-svn: 135518
* [analysis] Add checks for double-locking and lock order reversal bugs forJordy Rose2011-07-191-44/+105
| | | | | | pthread and XNU locks. Patch by Rui Paulo! llvm-svn: 135515
* Refactor r135502 to avoid an empty if else condition, per Eric's suggestion ↵Chad Rosier2011-07-191-4/+8
| | | | | | (good call!). llvm-svn: 135510
* Add FixItHints in case a C++ function call is missing * or & operators on ↵Anna Zaks2011-07-191-6/+125
| | | | | | one/several of it's parameters (addresses http://llvm.org/PR5941). llvm-svn: 135509
* Clang asserts "Invalid environment!" when using -ccc-host-triple Chad Rosier2011-07-191-0/+4
| | | | | | | | arch-pc-win32-macho (e.g., x86_64-pc-win32-macho), which appears to be a false positive. rdar://9786307 llvm-svn: 135502
* Update CMake build.Benjamin Kramer2011-07-191-0/+1
| | | | llvm-svn: 135492
* [arcmt] Add some additional driver flags to optionally emit or save the ↵Argyrios Kyrtzidis2011-07-197-11/+278
| | | | | | | | | | | pre-migration ARC errors. -arcmt-migrate-emit-errors : Emits the pre-migration ARC errors but it doesn't affect anything else -arcmt-migrate-report-output : Writes out the pre-migration ARC errors to the provided plist file rdar://9791454 llvm-svn: 135491
* Revamp the SourceManager to separate the representation of parsedDouglas Gregor2011-07-199-333/+567
| | | | | | | | | | | | | | | | | | | | | | | | | | | source locations from source locations loaded from an AST/PCH file. Previously, loading an AST/PCH file involved carefully pre-allocating space at the beginning of the source manager for the source locations and FileIDs that correspond to the prefix, and then appending the source locations/FileIDs used for parsing the remaining translation unit. This design forced us into loading PCH files early, as a prefix, whic has become a rather significant limitation. This patch splits the SourceManager space into two parts: for source location "addresses", the lower values (growing upward) are used to describe parsed code, while upper values (growing downward) are used for source locations loaded from AST/PCH files. Similarly, positive FileIDs are used to describe parsed code while negative FileIDs are used to file/macro locations loaded from AST/PCH files. As a result, we can load PCH/AST files even during parsing, making various improvemnts in the future possible, e.g., teaching #include <foo.h> to look for and load <foo.h.gch> if it happens to be already available. This patch was originally written by Sebastian Redl, then brought forward to the modern age by Jonathan Turner, and finally polished/finished by me to be committed. llvm-svn: 135484
* Reduce -Wuninitialized time by 22% (on sqlite) by removing the recursive AST ↵Ted Kremenek2011-07-192-100/+101
| | | | | | | | | | | | | | | crawl. This is accomplished by forcing the needed expressions for -Wuninitialized to always be CFGElements in the CFG. This allows us to remove a fair amount of the code for -Wuninitialized. Some fallout: - AnalysisBasedWarnings.cpp now specifically toggles the CFGBuilder to create a CFG that is suitable for -Wuninitialized. This is a layering violation, since the logic for -Wuninitialized is in libAnalysis. This can be fixed with the proper refactoring. - Some of the source locations for -Wunreachable-code warnings have shifted. While not ideal, this is okay because that analysis already needs some serious reworking. llvm-svn: 135480
* Add hooks into the CFG builder to force that specific expressions are always ↵Ted Kremenek2011-07-191-5/+7
| | | | | | CFGElements. llvm-svn: 135479
* Fix typo.Nick Lewycky2011-07-191-1/+1
| | | | llvm-svn: 135473
* Match createTargetMachine API change.Evan Cheng2011-07-191-11/+13
| | | | llvm-svn: 135469
* Simplify.Devang Patel2011-07-191-6/+2
| | | | llvm-svn: 135456
* Implement a __WCHAR_UNSIGNED__ macro and use it to include WCHAR_MIN andAlexis Hunt2011-07-192-0/+17
| | | | | | | WCHAR_MAX in limits.h, thus solving the problem where the system header thinks it knows better. llvm-svn: 135455
* Check column number also.Devang Patel2011-07-181-3/+5
| | | | llvm-svn: 135437
* Remember to add a has_feature macro for __underlying_type now that it isAlexis Hunt2011-07-181-0/+1
| | | | | | correctly impelmented llvm-svn: 135401
* Define DiagnosticBuilder<<APValue so it's easy to include APValues inJeffrey Yasskin2011-07-181-0/+45
| | | | | | diagnostics. llvm-svn: 135398
* Migrate LLVM and Clang to use the new makeArrayRef(...) functions where ↵Frits van Bommel2011-07-183-11/+8
| | | | | | | | previously explicit non-default constructors were used. Mostly mechanical with some manual reformatting. llvm-svn: 135390
* lib/Headers/mm_malloc.h: Use __mingw_aligned_malloc() in _mm_malloc() on mingw.NAKAMURA Takumi2011-07-181-1/+3
| | | | | | By default, mingw does not have _mm_alloc() nor _aligned_malloc(). llvm-svn: 135388
* [arcmt] When a NSData's 'bytes' family of methods are used on a local var,Argyrios Kyrtzidis2011-07-181-0/+34
| | | | | | | | | add __attribute__((objc_precise_lifetime)) to make sure that the object (and its data) will not get released before the var goes out-of-scope. rdar://9206226 llvm-svn: 135382
* [arcmt] NSInvocation's [get/set]ReturnValue and [get/set]Argument are only safeArgyrios Kyrtzidis2011-07-187-3/+100
| | | | | | with __unsafe_unretained parameters. Emit error for strong/weak ones. rdar://9206226 llvm-svn: 135381
OpenPOWER on IntegriCloud