summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Handle a "#pragma options align" inside a class.Argyrios Kyrtzidis2012-10-121-0/+5
| | | | llvm-svn: 165810
* clang/test/Index/index-module.m: Tweak expressions to fit Win32 paths.NAKAMURA Takumi2012-10-121-30/+28
| | | | llvm-svn: 165794
* Track which particular submodule #undef's a macro, so that the actualDouglas Gregor2012-10-126-6/+19
| | | | | | #undef only occurs if that submodule is imported. llvm-svn: 165773
* search for overridden methods with comment when overriding methodFariborz Jahanian2012-10-111-1/+1
| | | | | | | has none of its own. Factor in Doug's comments. // rdar://12378793 llvm-svn: 165771
* Provide a fixit when taking the address of an unqualified member function.David Blaikie2012-10-112-0/+13
| | | | | | | | | | | | | This only applies if the type has a name. (we could potentially do something crazy with decltype in C++11 to qualify members of unnamed types but that seems excessive) It might be nice to also suggest a fixit for "&this->i", "&foo->i", and "&foo.i" but those expressions produce 'bound' member functions that have a different AST representation & make error recovery a little trickier. Left as future work. llvm-svn: 165763
* clang/test/Index/index-module.m: Move XFAIL. It was line-number-sensitive.NAKAMURA Takumi2012-10-111-1/+2
| | | | llvm-svn: 165762
* clang/test/Index/index-module.m: Mark it as XFAIL:win32 for now.NAKAMURA Takumi2012-10-111-0/+1
| | | | llvm-svn: 165761
* clang/test/Index/index-pch-with-module.m: Tweak expressions for win32 pathsep.NAKAMURA Takumi2012-10-111-3/+3
| | | | llvm-svn: 165760
* [ms-inline asm] Remove a bunch of parsing code from the front-end, which will beChad Rosier2012-10-111-26/+2
| | | | | | reimplemented in the AsmParser where it belongs. llvm-svn: 165752
* [ms-inline asm] Lookup the IdentifierInfo using the Idents table and remove theChad Rosier2012-10-111-9/+0
| | | | | | | | | now unused static helper function. The test case needs to be remove temporarily until I can better filter memory operands that aren't actual variable reference. llvm-svn: 165751
* Diagnose the expansion of ambiguous macro definitions. This can happenDouglas Gregor2012-10-114-7/+25
| | | | | | | only with modules, when two disjoint modules #define the same identifier to different token sequences. llvm-svn: 165746
* Remove OSAtomicChecker.Ted Kremenek2012-10-112-4/+4
| | | | llvm-svn: 165744
* [libclang] Make sure the index_data.main_filename field is initializedArgyrios Kyrtzidis2012-10-111-0/+52
| | | | | | | in c-index-test. index_enteredMainFile is not invoked when indexing a module file. llvm-svn: 165735
* [libclang] Remove this test while I investigate why it is crashing on ↵Argyrios Kyrtzidis2012-10-111-52/+0
| | | | | | release+asserts. llvm-svn: 165734
* [libclang] Add tests for indexing modules and PCHs using modules.Argyrios Kyrtzidis2012-10-112-0/+83
| | | | llvm-svn: 165732
* -Warc-repeated-use-of-weak: fix a use-of-uninitialized and add a test case.Jordan Rose2012-10-111-0/+12
| | | | | | Fix-up for r165718, should get the buildbots back online. llvm-svn: 165723
* Properly factor Native Client defines to support NaCl as an OSDerek Schuff2012-10-115-0/+186
| | | | | | with x86/ARM architecture llvm-svn: 165722
* Handle gnu_inline in c++ in a gcc compatible way. Original patch by TobiasRafael Espindola2012-10-111-0/+9
| | | | | | Grosser. llvm-svn: 165720
* -Warc-repeated-use-of-weak: Don't warn on a single read followed by writes.Jordan Rose2012-10-111-6/+65
| | | | | | | | | | 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-111-0/+23
| | | | | | | | | | | | | | | | | | | 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
* clang/test/CodeGenCXX/microsoft-uuidof.cpp: Fix for -Asserts.NAKAMURA Takumi2012-10-111-6/+6
| | | | llvm-svn: 165712
* Add codegen support for __uuidof().Nico Weber2012-10-112-0/+85
| | | | llvm-svn: 165710
* X86: add F16C support in ClangManman Ren2012-10-111-0/+26
| | | | | | | | | Support the following intrinsics: _mm_cvtph_ps, _mm256_cvtph_ps, _mm_cvtps_ph, _mm256_cvtps_ph rdar://12407875 llvm-svn: 165685
* Deserialize macro history when we deserialize an identifier that hasDouglas Gregor2012-10-114-0/+113
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Make sure we perform the variadic method check correctly for calls to a ↵Eli Friedman2012-10-112-0/+26
| | | | | | member operator(). PR14057. llvm-svn: 165678
* Reapply "[analyzer] Treat fields of unions as having symbolic offsets."Jordan Rose2012-10-101-0/+50
| | | | | | | | 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-102-2/+6
| | | | | | | | | 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-11/+21
| | | | | | | | | 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-50/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [analyzer] Treat fields of unions as having symbolic offsets.Jordan Rose2012-10-101-0/+50
| | | | | | | | | | | | | | | | | 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
* Make -Wshift-op-parentheses a subgroup of -WparenthesesDavid Blaikie2012-10-101-0/+8
| | | | llvm-svn: 165653
* [Doc parsing] This patch searches overridden objc/c++Fariborz Jahanian2012-10-101-0/+111
| | | | | | | | | | 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-102-0/+34
| | | | | | | | | | | | | | | ...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
* -Warc-repeated-use-of-weak: look through explicit casts on assigned values.Jordan Rose2012-10-101-0/+11
| | | | | | | 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-102-2/+34
| | | | | | | | 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-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix stack overflow when trying to create an implicit movingArgyrios Kyrtzidis2012-10-101-0/+38
| | | | | | | | 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-0/+13
| | | | | | | | | | | | | | | | | | 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
* Fix PR 11709: Change the definition of va_list to meet AAPCS requirementLogan Chien2012-10-102-1/+63
| | | | | | | | | | | | | 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
* -fcatch-undefined-behavior: catch a VLA bound which evalutes to a ↵Richard Smith2012-10-101-0/+11
| | | | | | non-positive value. llvm-svn: 165583
* Fix test broken by r165572.Richard Smith2012-10-101-4/+2
| | | | llvm-svn: 165581
* Rework the (de-)serialization of macros, as stored inDouglas Gregor2012-10-097-0/+26
| | | | | | | | | | | | | | | | 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/+9
| | | | | | | 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-0920-57/+50
| | | | | | | | | | | | | | 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
* -fcatch-undefined-behavior: emit calls to the runtime library whenever one ↵Richard Smith2012-10-093-13/+92
| | | | | | of the checks fails. llvm-svn: 165536
* [driver] Remove the -W[no-][int-conversion|constant-conversion|enum-conversion]Chad Rosier2012-10-091-0/+4
| | | | | | | options when clang invokes cc1plus for i386 kexts. rdar://12459188 llvm-svn: 165534
* When we load a function or method body from an AST file, we checkDouglas Gregor2012-10-093-2/+4
| | | | | | | | | | 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-091-2/+3
| | | | | | | | | | | | 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
* When storing the C++ overridden methods, store them once for theArgyrios Kyrtzidis2012-10-091-0/+3
| | | | | | 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/+12
| | | | | | contexts. <rdar://problem/12453134> llvm-svn: 165462
OpenPOWER on IntegriCloud