summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [Options] make Option a value type.Michael J. Spencer2012-10-105-53/+50
| | | | llvm-svn: 165663
* [analyzer] Treat fields of unions as having symbolic offsets.Jordan Rose2012-10-101-1/+5
| | | | | | | | | | | | | | | | | This allows only one field to be active at a time in RegionStore. This isn't quite the correct behavior for unions, but it at least would handle the case of "value goes in, value comes out" from the same field. RegionStore currently has a number of places where any access to a union results in UnknownVal being returned. However, it is clearly missing some cases, or the original issue wouldn't have occurred. It is probably now safe to remove those changes, but that's a potentially destabilizing change that should wait for more thorough testing. Fixes PR14054. llvm-svn: 165660
* [Doc parsing] This patch searches overridden objc/c++Fariborz Jahanian2012-10-105-21/+75
| | | | | | | | | | methods looking for documentation on a particular base class inherited by any method that overrides the base class. In case of redeclaration, as when objc method is defined in the implementation, it also looks up for documentation in class/class extension being redeclared. llvm-svn: 165643
* [analyzer] Don't run non-path-sensitive checks on system headers...Jordan Rose2012-10-101-24/+40
| | | | | | | | | | | | | | | ...but do run them on user headers. Previously, we were inconsistent here: non-path-sensitive checks on code /bodies/ were only run in the main source file, but checks on /declarations/ were run in /all/ headers. Neither of those is the behavior we want. Thanks to Sujit for pointing this out! <rdar://problem/12454226> llvm-svn: 165635
* [analyzer] Fix typo: s/HandleDeclsGallGraph/HandleDeclsCallGraph/gJordan Rose2012-10-101-3/+3
| | | | | | No functionality change. llvm-svn: 165634
* -Warc-repeated-use-of-weak: look through explicit casts on assigned values.Jordan Rose2012-10-101-1/+1
| | | | | | | Reading from a weak property, casting the result, and assigning to a strong pointer should still be considered safe. llvm-svn: 165629
* Move Sema::PropertyIfSetterOrGetter to ObjCMethodDecl::findPropertyDecl.Jordan Rose2012-10-104-106/+55
| | | | | | | | Then, switch users of PropertyIfSetterOrGetter and LookupPropertyDecl (the latter by name) over to findPropertyDecl. This actually makes -Wreceiver-is-weak a bit stronger than it was before. llvm-svn: 165628
* Change Sema::PropertyIfSetterOrGetter to make use of isPropertyAccessor.Jordan Rose2012-10-101-35/+34
| | | | | | | | | | | | | | | | | | | | | | | | Old algorithm: 1. See if the name looks like a getter or setter. 2. Use the name to look up a property in the current ObjCContainer and all its protocols. 3. If the current container is an interface, also look in all categories and superclasses (and superclass categories, and so on). New algorithm: 1. See if the method is marked as a property accessor. If so, look through all properties in the current container and find one that has a matching selector. 2. Find all overrides of the method using ObjCMethodDecl's getOverriddenMethods. This collects methods in superclasses and protocols (as well as superclass categories, which isn't really necessary), and checks if THEY are accessors. This part is not done recursively, since getOverriddenMethods is already recursive. This lets us handle getters and setters that do not match the property names. llvm-svn: 165627
* Rename ObjCMethodDecl::isSynthesized to isPropertyAccessor.Jordan Rose2012-10-1010-32/+31
| | | | | | | | | | | | | This more accurately reflects its use: this flag is set when a method matches the getter or setter name for a property in the same class, and does not actually specify whether or not the definition of the method will be synthesized (either implicitly or explicitly with @synthesize). This renames the setter and backing field as well, and changes the (soon-to-be-obsolete?) XML dump format to use 'property_accessor' instead of 'synthesized'. llvm-svn: 165626
* Fix stack overflow when trying to create an implicit movingArgyrios Kyrtzidis2012-10-101-1/+1
| | | | | | | | constructor with invalid code. rdar://12240916 llvm-svn: 165623
* Apply the same fundamental fix for PR14048 as was applied for PR11905.Chandler Carruth2012-10-101-2/+19
| | | | | | | | | | | | | | | | | | The issue arises when coercing to/from types of different sizes. We need to be certain that the allocation on either end has sufficient room for the coerced type. When it doesn't, we need to make room, copy across, and then proceed. PR11905 handled the case of storing function arguments back into allocas in the function prolog, this patch handles the case of setting up the function arguments in a call expression. This is actually significantly simpler than the fix for PR11905. It ends up being a trivial change to create a temporary alloca when the source is too small and memcpy across. This should preserve the compile-time fast-isel benefits of doing gep+load sequences and avoiding FCAs. Reviewed by Benjamin and Evgeniy (who fixed PR11905). llvm-svn: 165615
* Remove the final bits of Attributes being declared in the AttributeBill Wendling2012-10-106-58/+82
| | | | | | | namespace. Use the attribute's enum value instead. No functionality change intended. llvm-svn: 165611
* Fix PR 11709: Change the definition of va_list to meet AAPCS requirementLogan Chien2012-10-102-3/+68
| | | | | | | | | | | | | AAPCS ABI Section 7.1.4 [1] specifies that va_list should be defined as struct __va_list { void *__ap;}; And in C++, it is defined in namespace std. [1] http://infocenter.arm.com/help/topic /com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf Patch by Weiming Zhao. llvm-svn: 165609
* Have 'addFnAttr' take the attribute enum value. Then have it build the ↵Bill Wendling2012-10-106-21/+22
| | | | | | attribute object and add it appropriately. No functionality change. llvm-svn: 165596
* When indexing a module file, for the ppIncludedFile callback giveArgyrios Kyrtzidis2012-10-102-13/+21
| | | | | | | an invalid location if the location points to the synthetic buffer for the module input. llvm-svn: 165592
* [modules] Consistently construct a buffer as input to build the module.Argyrios Kyrtzidis2012-10-102-83/+43
| | | | | | This means the main file for modules will always be a virtual one. llvm-svn: 165591
* Tidy up formatting.Richard Smith2012-10-101-2/+1
| | | | llvm-svn: 165584
* -fcatch-undefined-behavior: catch a VLA bound which evalutes to a ↵Richard Smith2012-10-101-1/+18
| | | | | | non-positive value. llvm-svn: 165583
* -fcatch-undefined-behavior: store the type name directly at the end of a ↵Richard Smith2012-10-091-5/+5
| | | | | | type descriptor. 5% binary size reduction due to fewer relocations. llvm-svn: 165572
* Rework the (de-)serialization of macros, as stored inDouglas Gregor2012-10-0910-58/+266
| | | | | | | | | | | | | | | | MacroInfo*. Instead of simply dumping an offset into the current file, give each macro definition a proper ID with all of the standard modules-remapping facilities. Additionally, when a macro is modified in a subsequent AST file (e.g., #undef'ing a macro loaded from another module or from a precompiled header), provide a macro update record rather than rewriting the entire macro definition. This gives us greater consistency with the way we handle declarations, and ties together macro definitions much more cleanly. Note that we're still not actually deserializing macro history (we never were), but it's far easy to do properly now. llvm-svn: 165560
* People put pragmas in crazy places; add more handling. PR14046.Eli Friedman2012-10-091-0/+20
| | | | | | | I think our general framework for parser pragmas needs a bit more work, but I'm not planning on working on it at the moment. llvm-svn: 165558
* The clang driver has a fairly fancy support for executing gcc instead ofRafael Espindola2012-10-091-38/+0
| | | | | | | | | | | | | | clang itself. This dates back to clang's early days and while it looks like some of it is still used (for kext for example), other parts are probably dead. Remove the -ccc-clang-archs option and associated code. I don't think there is any remaining setup where clang doesn't support an architecture but it can expect an working gcc cross compiler to be available. A nice side effect is that tests no longer need to differentiate architectures that are included in production builds of clang and those that are not. llvm-svn: 165545
* Simplify the code using SmallVector::append(), as suggested by Benjamin Kramer.Argyrios Kyrtzidis2012-10-091-10/+3
| | | | llvm-svn: 165538
* [driver] Remove redundant cases due to overlapping commits between Ted ↵Chad Rosier2012-10-091-2/+0
| | | | | | | | (r165531, 165532) and I (r165534), but leave the test case in place. llvm-svn: 165537
* -fcatch-undefined-behavior: emit calls to the runtime library whenever one ↵Richard Smith2012-10-099-49/+283
| | | | | | of the checks fails. llvm-svn: 165536
* [driver] Remove the -W[no-][int-conversion|constant-conversion|enum-conversion]Chad Rosier2012-10-091-0/+2
| | | | | | | options when clang invokes cc1plus for i386 kexts. rdar://12459188 llvm-svn: 165534
* Don't forward -Wenum-conversion to cc1plus.Ted Kremenek2012-10-091-0/+1
| | | | llvm-svn: 165532
* Don't forward -Wint-conversion to cc1plus.Ted Kremenek2012-10-091-0/+1
| | | | llvm-svn: 165531
* Move the functionality that looks for ObjC overridden methods fromArgyrios Kyrtzidis2012-10-092-167/+181
| | | | | | | | ASTContext to the ObjCMethodDecl, and have the more generic ASTContext::getOverriddenMethods() use the ObjCMethodDecl::getOverriddenMethods() function. llvm-svn: 165518
* Make the order of visitation of the pending bodies in the AST readerDouglas Gregor2012-10-091-2/+2
| | | | | | deterministic. llvm-svn: 165515
* When we load a function or method body from an AST file, we checkDouglas Gregor2012-10-093-15/+42
| | | | | | | | | | whether that function/method already has a body (loaded from some other AST file), as introduced in r165137. Delay this check until after the redeclaration chains have been wired up. While I'm here, make the loading of method bodies lazy. llvm-svn: 165513
* If a macro has been #undef'd in a precompiled header, we still need toDouglas Gregor2012-10-093-17/+16
| | | | | | | | | | | | write out the macro history for that macro. Similarly, we need to cope with reading a macro definition that has been #undef'd. Take advantage of this new ability so that global code-completion results can refer to #undef'd macros, rather than losing them entirely. For multiply defined/#undef'd macros, we will still get the wrong result, but it's better than getting no result. llvm-svn: 165502
* Clearing a SmallPtrSet is still expensive, split it out from ↵Benjamin Kramer2012-10-091-1/+5
| | | | | | OverloadCandidateSet::clear and don't do it on destruction. llvm-svn: 165501
* We use the enums to query whether an Attributes object has that attribute. TheBill Wendling2012-10-091-1/+1
| | | | | | opaque layer is responsible for knowing where that specific attribute is stored. llvm-svn: 165489
* Move the logic that searches for overridden methods from libclang toArgyrios Kyrtzidis2012-10-091-0/+186
| | | | | | ASTContext so that it can be widely available. llvm-svn: 165473
* When storing the C++ overridden methods, store them once for theArgyrios Kyrtzidis2012-10-092-4/+6
| | | | | | canonical method; avoid storing them again for an out-of-line definition. llvm-svn: 165472
* Make sure we allow "#pragma options align=mac68k" in function-local ↵Eli Friedman2012-10-081-0/+5
| | | | | | contexts. <rdar://problem/12453134> llvm-svn: 165462
* In VarDecl::getSourceRange() make sure to check that the source locationArgyrios Kyrtzidis2012-10-081-2/+5
| | | | | | | | | | of the initializer is valid before using it. Fixes rdar://12455002&12449015 where local variables of objc objects in ARC mode were not annotated because of the ImplicitValueInitExpr initializer having invalid source range, resulting in the SourceRange of the VarDecl having invalid end location. llvm-svn: 165456
* Make Bitrig's clang understand -stdlib= correctly.Chandler Carruth2012-10-081-8/+32
| | | | | | | | | With this patch Bitrig can use a different c++ library without pain and within the normal commandline parameters. Original patch by David Hill, with lots of fixes and cleanup by me. llvm-svn: 165430
* Don't emit double parentheses in __clang_version__.Benjamin Kramer2012-10-081-2/+2
| | | | | | PR14040. llvm-svn: 165415
* Hopefully appease Windows buildbot with Japanese (?) error message.Daniel Jasper2012-10-081-0/+1
| | | | llvm-svn: 165414
* FileNameMatchTrie: Use StringRef instead of Twines where possible.Daniel Jasper2012-10-081-3/+2
| | | | llvm-svn: 165412
* Move TargetData to DataLayout.Micah Villmow2012-10-0824-127/+127
| | | | llvm-svn: 165395
* Support symlinks and relative paths in complilation databases.Daniel Jasper2012-10-083-3/+212
| | | | | Review: http://llvm-reviews.chandlerc.com/D30 llvm-svn: 165392
* Use a single note diagnostic for all the precedent/parentheses warnings.David Blaikie2012-10-081-8/+10
| | | | llvm-svn: 165384
* StringRef-ify Binary/UnaryOperator::getOpcodeStrDavid Blaikie2012-10-084-7/+7
| | | | llvm-svn: 165383
* Use getArch instead of getArchName + string compare.Rafael Espindola2012-10-073-22/+22
| | | | llvm-svn: 165370
* Use getArch instead of getArchName.Rafael Espindola2012-10-072-8/+2
| | | | | | | | | | | | The darwin change should be a nop since Triple::getArchTypeForDarwinArchName doesn't know about amd64. If things like amd64-mingw32 are to be rejected, we should print a error earlier on instead of silently using the wrong abi. Remove old comment that looks out of place, this is "in clang". llvm-svn: 165368
* Expose __builtin_bswap16.Benjamin Kramer2012-10-062-0/+2
| | | | | | | GCC has always supported this on PowerPC and 4.8 supports it on all platforms, so it's a good idea to expose it in clang too. LLVM supports this on all targets. llvm-svn: 165362
* ParentMap: Restore the ability to update an existing map.Jordan Rose2012-10-061-14/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | The Clang ASTs are a DAG, not a pure tree. However, ParentMap has to choose a single parent for each object. In the main (only?) cases in which the AST forms a DAG, it protects from multiple traversal by using OpaqueValueExprs. Previously, ParentMap would just unconditionally look through all OpaqueValueExprs when building its map. In order to make this behavior better for the analyzer's diagnostics, ParentMap was changed to not set a statement's parent if there already was one in the map. However, ParentMap is supposed to allow updating existing mappings by calling addStmt once again. This change makes the "transparency" of OpaqueValueExprs explicit, and disables it when it is not desired, rather than checking the current contents of the map. This new code seems like a big change, but it should actually have essentially the same performance as before. Only OpaqueValueExprs and their users (PseudoObjectExpr and BinaryConditionalOperator) will have any different behavior. There should be no user-visible functionality change, though a test has been added for the current behavior of BinaryConditionalOperator source locations and accompanying Xcode arrows (which are not so great...). llvm-svn: 165355
OpenPOWER on IntegriCloud