summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* This patch (thanks to Doug Gregor) fixes aSean Callanan2011-07-221-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | problem where Clang was setting the hasExternalVisibleDecls() bit for all DeclContexts it imported. This caused Clang to make unnecessary calls to findExternalVisibleDecls() when an external AST source was installed. In fact, Clang sometimes interpreted a failure by one of these spurious calls to find a Decl as meaning the Decl didn't exist, even though findExternalLexicalDecls() did locate that decl. This produced amusing errors of the form: - error: no member named 'b' in 'A'; did you mean 'b'? - Now, if hasExternalVisibleDecls() or hasExternalLexicalDecls() should be set, the external AST source must do so itself. llvm-svn: 135824
* kill a FIXME in IsIntegralPromotionDavid Majnemer2011-07-221-4/+1
| | | | | | | | IsIntegralPromotion should consider the signedness of FromType when calculating promotions. This, as of now, cannot be exercised on any platform so there is no corresponding test. llvm-svn: 135803
* Remove prepending of '$' to module names.Jonathan D. Turner2011-07-222-4/+4
| | | | llvm-svn: 135775
* Switch all of the "isysroot" const char*'s throughout the AST readerDouglas Gregor2011-07-227-37/+33
| | | | | | and writer to StringRef or std::string, as appropriate. llvm-svn: 135769
* Rename ASTReader::PerFileData to serialization::Module, pulling it outDouglas Gregor2011-07-227-86/+88
| | | | | | | of ASTReader so it can become its own full-fledged class (eventually). No functionality change. llvm-svn: 135767
* Document the existing objc_precise_lifetime attribute.John McCall2011-07-223-18/+99
| | | | | | | | | Introduce and document a new objc_returns_inner_pointer attribute, and consume it by performing a retain+autorelease on message receivers when they're not immediately loaded from an object with precise lifetime. llvm-svn: 135764
* Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to useJay Foad2011-07-226-11/+8
| | | | | | ArrayRef. llvm-svn: 135761
* fix PR10384: C++ allows external arrays of incomplete type as well.Chris Lattner2011-07-221-0/+8
| | | | | | Many thanks to Eli for reducing this great testcase. llvm-svn: 135752
* Introduce a global bit-offset continuous range map into the ASTReader,Douglas Gregor2011-07-223-90/+36
| | | | | | | | | | | | | | | | | so that we have one, simple way to map from global bit offsets to local bit offsets. Eliminates a number of loops over the chain, and generalizes for more interesting bit remappings. Also, as an amusing oddity, we were computing global bit offsets *backwards* for preprocessed entities (e.g., the directly included PCH file in the chain would start at offset zero, rather than the original PCH that occurs first in translation unit). Even more amusingly, it made precompiled preambles work, because we were forgetting to adjust the local bit offset to a global bit offset when storing preprocessed entity offsets in the ASTUnit. Two wrongs made a right, and now they're both right. llvm-svn: 135750
* Fix an embarrassing bug in relocatable PCH support, where we wereDouglas Gregor2011-07-221-1/+10
| | | | | | | passing a temporary const char* down as the "isysroot" parameter and then accessing it later. Fixes <rdar://problem/9035180>. llvm-svn: 135749
* Move duplicate uninitialized warning suppression into theChandler Carruth2011-07-222-14/+8
| | | | | | | | | | | | AnalysisBasedWarnings Sema layer and out of the Analysis library itself. This returns the uninitialized values analysis to a more pure form, allowing its original logic to correctly detect some categories of definitely uninitialized values. Fixes PR10358 (again). Thanks to Ted for reviewing and updating this patch after his rewrite of several portions of this analysis. llvm-svn: 135748
* In ARC, non-atomic getters do not need to retain and autoreleaseJohn McCall2011-07-221-17/+20
| | | | | | | their loaded values, although it still worth doing this for __weak properties to get the autoreleased-return-value optimization. llvm-svn: 135747
* Move this ObjCImplementationDecl member function into libASTJohn McCall2011-07-222-13/+13
| | | | | | where it belongs. llvm-svn: 135746
* In Objective-C, pull arbitrary attributes from overriddenJohn McCall2011-07-223-174/+171
| | | | | | | | | | | | | | | methods, including indirectly overridden methods like those declared in protocols and categories. There are mismatches that we would like to diagnose but aren't yet, but this is fine for now. I looked at approaches that avoided doing this lookup unless we needed it, but the infer-related-result-type checks were doing it anyway, so I left it with the same fast-path check for no previous declartions of that selector. llvm-svn: 135743
* Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.Jordy Rose2011-07-228-65/+41
| | | | | | | | | This was previously not-const only because it has to lazily construct a chain of ivars the first time it is called (and after the chain is invalidated). In practice, all the clients were just const_casting their const Decls; all those now-unnecessary const_casts have been removed. llvm-svn: 135741
* objective-c: Any use of @synthesize or @dynamic lexically after a method (or ↵Fariborz Jahanian2011-07-221-0/+8
| | | | | | | | | | C function) implementation will be rejected with a compilation error in ARC mode, and a compiler warning otherwise. This may cause breakage in non-arc (and arc) tests which don't expect warning/error. Feel free to fix the tests, or reverse the patch, if I am unavailable. // rdar://9818354 - WIP llvm-svn: 135740
* In the AST reader, factor out the mapping of local type IDs to globalDouglas Gregor2011-07-223-79/+90
| | | | | | | | type IDs into a single place, and make sure that all of the callers use the appropriate functions to do the mapping. Since the mapping is still the identity function, this is essentially a no-op. llvm-svn: 135733
* Avoid warning on "clang -c -Dfoo test.i". Lines like these are createdRafael Espindola2011-07-211-0/+6
| | | | | | | when using ccache and libtool.m4 assumes that the compiler cannot print warnings about options it knows about. llvm-svn: 135723
* Clean up the rest of the local -> global declaration ID mappingsDouglas Gregor2011-07-212-12/+8
| | | | | | within the ASTReader (I hope). llvm-svn: 135720
* In the ASTReader, factor out the loading of (local) declaration IDs,Douglas Gregor2011-07-213-273/+292
| | | | | | | | | | | | | such that every declaration ID loaded from an AST file will go through a central local -> global mapping function. At present, this change does nothing, since the local -> global mapping function is the identity function. This is the mechanical part of the refactoring; a follow-up patch will address a few remaining areas where it's not obvious whether we're dealing with local or global IDs. llvm-svn: 135711
* Cleaning up more of the ID situation in the AST reader. This patch relaxes ↵Jonathan D. Turner2011-07-211-24/+25
| | | | | | and generalizes how CXX base specifiers are identified and loaded by using a ContinuousRangeMap. This also adds a global bit offset (or base) to the PerFileData. llvm-svn: 135705
* Add some debugging output to the AST reader, so we can see the global ↵Douglas Gregor2011-07-211-0/+54
| | | | | | remappings we generate llvm-svn: 135701
* In the AST reader, keep track of the total number of source locationsDouglas Gregor2011-07-211-13/+10
| | | | | | | entries incrementally, rather than iterating over the chain when loading a single AST file. llvm-svn: 135692
* For ASTUnit::Save, write the AST to a temporary and then rename it to the ↵Argyrios Kyrtzidis2011-07-211-4/+26
| | | | | | | | actual filename. Should avoid race conditions. Addresses rdar://9788943. llvm-svn: 135691
* Cut down one open/close pair of system calls by using Path's makeUnique ↵Argyrios Kyrtzidis2011-07-212-2/+2
| | | | | | instead of createTemporaryFileOnDisk. llvm-svn: 135690
* Add FixIt hint for missing 'id' type.Fariborz Jahanian2011-07-211-1/+2
| | | | | | // rdar://9615045 llvm-svn: 135685
* objc - Diagnose missing method return type specifier underFariborz Jahanian2011-07-211-1/+3
| | | | | | a warning flag. // rdar://9615045 llvm-svn: 135681
* Define the _MIPS_SIM builtin macro on MIPS platforms. Patch by Robert Millan!Bruno Cardoso Lopes2011-07-211-1/+19
| | | | llvm-svn: 135675
* Convert ConstantExpr::getGetElementPtr andJay Foad2011-07-216-14/+14
| | | | | | ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673
* Speculatively revert 135649 to bring back the g++ testing bots.Eric Christopher2011-07-211-6/+4
| | | | llvm-svn: 135668
* Move AnalysisManager constructor out of line. No functionality change (yet).Ted Kremenek2011-07-211-0/+23
| | | | llvm-svn: 135667
* Simplify passing of CFGBuildOptions around for AnalysisContext. No ↵Ted Kremenek2011-07-213-28/+50
| | | | | | functionality change. llvm-svn: 135666
* Remove warning for conditional operands of differend signedness from ↵Richard Trieu2011-07-211-20/+7
| | | | | | -Wsign-compare. Cases that previously warn on this will have a different warning emitted from -Wsign-conversion. llvm-svn: 135664
* 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
OpenPOWER on IntegriCloud