summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Properly factor Native Client defines to support NaCl as an OSDerek Schuff2012-10-112-11/+52
| | | | | | with x86/ARM architecture llvm-svn: 165722
* Handle gnu_inline in c++ in a gcc compatible way. Original patch by TobiasRafael Espindola2012-10-111-1/+1
| | | | | | Grosser. llvm-svn: 165720
* -Warc-repeated-use-of-weak: Don't warn on a single read followed by writes.Jordan Rose2012-10-111-4/+36
| | | | | | | | | | This is a "safe" pattern, or at least one that cannot be helped by using a strong local variable. However, if the single read is within a loop, it should /always/ be treated as potentially dangerous. <rdar://problem/12437490> llvm-svn: 165719
* -Warc-repeated-use-of-weak: Check messages to property accessors as well.Jordan Rose2012-10-112-3/+47
| | | | | | | | | | | | | | | | | | | Previously, [foo weakProp] was not being treated the same as foo.weakProp. Now, for every explicit message send, we check if it's a property access, and if so, if the property is weak. Then for every assignment of a message, we have to do the same thing again. This is a potentially expensive increase because determining whether a method is a property accessor requires searching through the methods it overrides. However, without it -Warc-repeated-use-of-weak will miss cases from people who prefer not to use dot syntax. If this turns out to be too expensive, we can try caching the result somewhere, or even lose precision by not checking superclass methods. The warning is off-by-default, though. <rdar://problem/12407765> llvm-svn: 165718
* [libclang] Improve AST serialization done by ASTUnit::Save().Argyrios Kyrtzidis2012-10-112-29/+65
| | | | | | | | | The ASTUnit needs to initialize an ASTWriter at the beginning of parsing to fully handle serialization of a translation unit that imports modules. Do this by introducing an option to enable it, which corresponds to CXTranslationUnit_ForSerialization on the C API side. llvm-svn: 165717
* ObjCMethodDecl::findPropertyDecl: bail out early if not an instance method.Jordan Rose2012-10-111-1/+1
| | | | | | | | | Currently, Objective-C does not support class properties, even though it allows calling class methods with dot syntax. No intended functionality change; purely optimization. llvm-svn: 165716
* Make X86_64ABIInfo clean for ABIs with 32 bit pointers, such as X32Derek Schuff2012-10-112-14/+23
| | | | | | and Native Client llvm-svn: 165715
* Add codegen support for __uuidof().Nico Weber2012-10-117-24/+125
| | | | llvm-svn: 165710
* clang/lib/Headers/CMakeLists.txt: Add f16cintrin.h.NAKAMURA Takumi2012-10-111-0/+1
| | | | llvm-svn: 165688
* X86: add F16C support in ClangManman Ren2012-10-113-1/+79
| | | | | | | | | Support the following intrinsics: _mm_cvtph_ps, _mm256_cvtph_ps, _mm_cvtps_ph, _mm256_cvtps_ph rdar://12407875 llvm-svn: 165685
* Remove the ASTDeserializationListener's MacroVisible() callback, whichDouglas Gregor2012-10-112-18/+0
| | | | | | | is no longer necessary, as well as the little bit of infrastructure in the AST writer that used it. llvm-svn: 165684
* Remove an unused bit from the serialized IdentifierInfoDouglas Gregor2012-10-113-5/+1
| | | | llvm-svn: 165683
* Deserialize macro history when we deserialize an identifier that hasDouglas Gregor2012-10-114-90/+173
| | | | | | | | | | | | | | | | | | | | | | | | macro history. When deserializing macro history, we arrange history such that the macros that have definitions (that haven't been #undef'd) and are visible come at the beginning of the list, which is what the preprocessor and other clients of Preprocessor::getMacroInfo() expect. If additional macro definitions become visible later, they'll be moved toward the front of the list. Note that it's possible to have ambiguities, but we don't diagnose them yet. There is a partially-implemented design decision here that, if a particular identifier has been defined or #undef'd within the translation unit, that definition (or #undef) hides any macro definitions that come from imported modules. There's still a little work to do to ensure that the right #undef'ing happens. Additionally, we'll need to scope the update records for #undefs, so they only kick in when the submodule containing that update record becomes visible. llvm-svn: 165682
* Minor cleanup for r165678; no functional change.Eli Friedman2012-10-111-1/+1
| | | | llvm-svn: 165679
* Make sure we perform the variadic method check correctly for calls to a ↵Eli Friedman2012-10-111-2/+14
| | | | | | member operator(). PR14057. llvm-svn: 165678
* Reapply "[analyzer] Treat fields of unions as having symbolic offsets."Jordan Rose2012-10-101-1/+5
| | | | | | | | This time, actually uncomment the code that's supposed to fix the problem. This reverts r165671 / 8ceb837585ed973dc36fba8dfc57ef60fc8f2735. llvm-svn: 165676
* Fix a crash-on-invalid when parsing a reference to an invalid auto declarationDavid Blaikie2012-10-101-0/+1
| | | | | | | | | auto x((unknown)); int& y = x; would crash because we were not flagging 'x' as an invalid declaration here. llvm-svn: 165675
* objective-C IRgen: When sending a method to 'super'Fariborz Jahanian2012-10-101-9/+2
| | | | | | | | | in a category class method, don't read 'isa' pointer. Instead, save the desired OBJC_METACLASS_$_ClassName in __DATA,__objc_superrefs and read that without reading any isa pointers. // rdar://12459358 llvm-svn: 165674
* Temporarily Revert "[analyzer] Treat fields of unions as having symbolic ↵Eric Christopher2012-10-101-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | offsets." Author: Jordan Rose <jordan_rose@apple.com> Date: Wed Oct 10 21:31:21 2012 +0000 [analyzer] Treat fields of unions as having symbolic offsets. 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165660 91177308-0d34-0410-b5e6-96231b3b80d8 This reverts commit cf9030e480f77ab349672f00ad302e216c26c92c. llvm-svn: 165671
* Revert "[Options] make Option a value type."Eric Christopher2012-10-105-50/+53
| | | | | | | | | | | | | Author: Michael J. Spencer <bigcheesegs@gmail.com> Date: Wed Oct 10 21:48:26 2012 +0000 [Options] make Option a value type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165663 91177308-0d34-0410-b5e6-96231b3b80d8 This reverts commit 0464fd5e4ce2193e786e5adcab6b828f9366dae3. llvm-svn: 165667
* [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
OpenPOWER on IntegriCloud