summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Don't warn on conversion from NULL to nullptr_tDavid Blaikie2013-02-161-2/+8
| | | | llvm-svn: 175331
* Emit vtables for an extern template class as available_externally, not asRichard Smith2013-02-161-0/+26
| | | | | | | linkonce_odr. Emit construction vtables as internal in this case, since the ABI does not guarantee that they will be availble externally. llvm-svn: 175330
* [PCH] Deserializing the DeclContext of a template parameter is not safeArgyrios Kyrtzidis2013-02-162-0/+32
| | | | | | | | | | | until recursive loading is finished. Otherwise we may end up with a template trying to deserialize a template parameter that is in the process of getting loaded. rdar://13135282 llvm-svn: 175329
* Rework the visibility computation algorithm in preparationJohn McCall2013-02-161-15/+29
| | | | | | | | | | | | | | | | for distinguishing type vs. value visibility. The changes to the visibility of explicit specializations are intentional. The change to the "ugly" test case is a consequence of a sensible implementation, and I am happy to argue that this is better behavior. Other changes may or may not be intended; it is quite difficult to divine intent from some of the code I altered. I've left behind a comment which I hope explains the philosophy behind visibility computation. llvm-svn: 175326
* Add test case for r175312.Chad Rosier2013-02-151-0/+6
| | | | llvm-svn: 175313
* Add the 'target-cpu' and 'target-features' attributes to functions.Bill Wendling2013-02-1518-85/+85
| | | | | | | The back-end will use these values to reconfigure code generation for different features. llvm-svn: 175308
* libclang: add clang_getTypeSpelling(CXType CT)Dmitri Gribenko2013-02-156-44/+110
| | | | | | | | | Adds a function clang_getTypeSpelling(CXType CT) that returns a CXString containing the underlying type. Patch by Ben Gertzfield. llvm-svn: 175299
* objective-C: Fixes a compiler crash when encodingFariborz Jahanian2013-02-151-0/+18
| | | | | | | an ivar of type pointer to a typedef'ed object. // rdar://13190095 llvm-svn: 175298
* Fixed diagnostic nondeterministic order bug (pr14901).Enea Zaffanella2013-02-151-0/+13
| | | | llvm-svn: 175289
* Fix crash-on-invalid where a ParenListExpr shows up as a message receiverArgyrios Kyrtzidis2013-02-151-0/+8
| | | | | | | | while trying to do error recovery. rdar://13207886 llvm-svn: 175282
* When a statement is dropped from the AST because it was invalid, make sureArgyrios Kyrtzidis2013-02-151-0/+12
| | | | | | | we don't do the scope checks otherwise we are going to hit assertion checks since a label may not have been actually added. llvm-svn: 175281
* Sema: Unnest early exit and remove an unnecessary bad cast.Benjamin Kramer2013-02-151-0/+3
| | | | | | | cast<ObjCObjectPointerType> doesn't look through sugar, getAs does. Fixes PR15257. llvm-svn: 175272
* Abstract out emitting the vdtor calls and do it properly when using -cxx-abi ↵Timur Iskhodzhanov2013-02-152-11/+25
| | | | | | microsoft; also fix vdtor calls for the ARM ABI llvm-svn: 175271
* Update testcases due to Attribute sorting improvements.Bill Wendling2013-02-1514-72/+72
| | | | llvm-svn: 175253
* [analyzer] Don't assert when mixing reinterpret_cast and derived-to-base casts.Jordan Rose2013-02-151-0/+28
| | | | | | | | | | | | | | | This just adds a very simple check that if a DerivedToBase CastExpr is operating on a value with known C++ object type, and that type is not the base type specified in the AST, then the cast is invalid and we should return UnknownVal. In the future, perhaps we can have a checker that specifies that this is illegal, but we still shouldn't assert even if the user turns that checker off. PR14872 llvm-svn: 175239
* Re-apply "[analyzer] Model trivial copy/move ctors with an aggregate bind."Jordan Rose2013-02-152-3/+103
| | | | | | | | | | | | | | ...after a host of optimizations related to the use of LazyCompoundVals (our implementation of aggregate binds). Originally applied in r173951. Reverted in r174069 because it was causing hangs. Re-applied in r174212. Reverted in r174265 because it was /still/ causing hangs. If this needs to be reverted again it will be punted to far in the future. llvm-svn: 175234
* Make this test determinstic for my last patch.Fariborz Jahanian2013-02-141-18/+18
| | | | | | // rdar://13192366 llvm-svn: 175217
* objective-C: When implementing custom accessor method forFariborz Jahanian2013-02-141-1/+23
| | | | | | | | a property, the -Wdirect-ivar-access should not warn when accessing the property's synthesized instance variable. // rdar://13142820 llvm-svn: 175195
* [analyzer] Try constant-evaluation for all variables, not just globals.Jordan Rose2013-02-141-0/+27
| | | | | | | | | | | | | | | | | | | | | In C++, constants captured by lambdas (and blocks) are not actually stored in the closure object, since they can be expanded at compile time. In this case, they will have no binding when we go to look them up. Previously, RegionStore thought they were uninitialized stack variables; now, it checks to see if they are a constant we know how to evaluate, using the same logic as r175026. This particular code path is only for scalar variables. Constant arrays and structs are still unfortunately unhandled; we'll need a stronger solution for those. This may have a small performance impact, but only for truly-undefined local variables, captures in a non-inlined block, and non-constant globals. Even then, in the non-constant case we're only doing a quick type check. <rdar://problem/13105553> llvm-svn: 175194
* [arcmt] Make sure the function has an associated parameter for the argumentArgyrios Kyrtzidis2013-02-141-0/+9
| | | | | | | | before checking for its attributes. rdar://13192395 llvm-svn: 175184
* Mangle extern "C" functions whose names are not simple identifiers.Rafael Espindola2013-02-141-0/+7
| | | | llvm-svn: 175166
* Partially revert r175117 so that we don't break assumptions about howRafael Espindola2013-02-142-9/+7
| | | | | | | static functions in extern "C" contexts are mangled. Should fix the bootstrap. llvm-svn: 175132
* merge hasCLanguageLinkage and isExternC. Keep the shorter name.Rafael Espindola2013-02-141-0/+19
| | | | | | | | | | I added hasCLanguageLinkage while fixing some language linkage bugs some time ago so that I wouldn't have to check all users of isExternC. It turned out to be a much longer detour than expected, but this patch finally merges the two again. The isExternC function now implements just the standard notion of having C language linkage. llvm-svn: 175119
* Add a getLanguageLinkage method to VarDecls and FunctionDecls. Use it to fixRafael Espindola2013-02-143-4/+62
| | | | | | | | | | | | | | | some cases where functions with no language linkage were being treated as having C language linkage. In particular, don't warn in extern "C" { static NonPod foo(); } Since getLanguageLinkage checks the language linkage, the linkage computation cannot use the language linkage. Break the loop by checking just the context in the linkage computation. llvm-svn: 175117
* When marking derived classes' virtual methods ODR-used in order to triggerNick Lewycky2013-02-141-0/+17
| | | | | | | instantiation in order to permit devirtualization later in codegen, skip over pure functions since those can't be devirtualization targets. llvm-svn: 175116
* objective-C: Make order of ivars which are synthesizedFariborz Jahanian2013-02-131-0/+58
| | | | | | | | in the course of property synthesis deterministic (ordered by their type size), instead of having hashtable order (as it is currently). // rdar://13192366 llvm-svn: 175100
* [ms-inline asm] Add test case for r175083.Chad Rosier2013-02-131-0/+12
| | | | llvm-svn: 175084
* ubsan: Add checking for invalid downcasts. Per [expr.static.cast]p2 and p11,Richard Smith2013-02-131-0/+46
| | | | | | | base-to-derived casts have undefined behavior if the object is not actually an instance of the derived type. llvm-svn: 175078
* [libclang] Fix annotation of a range where the begin or end locationArgyrios Kyrtzidis2013-02-131-0/+64
| | | | | | | | | is inside a macro argument. Previously we would give up and not annotate anything in the range. rdar://11891550 llvm-svn: 175062
* ... and now fix the +Asserts buildTimur Iskhodzhanov2013-02-131-2/+2
| | | | llvm-svn: 175054
* Fix the microsoft-abi-structors test expectations to match both Release and ↵Timur Iskhodzhanov2013-02-131-8/+14
| | | | | | Release+Asserts builds llvm-svn: 175053
* Emit virtual/deleting destructors properly with -cxx-abi microsoft, PR15058Timur Iskhodzhanov2013-02-132-11/+62
| | | | llvm-svn: 175045
* Change this comment to helpfully explain why it's there.Nick Lewycky2013-02-131-1/+2
| | | | llvm-svn: 175027
* [analyzer] Use Clang's evaluation for global constants and default arguments.Jordan Rose2013-02-132-12/+50
| | | | | | | | | | | Previously, we were handling only simple integer constants for globals and the smattering of implicitly-valued expressions handled by Environment for default arguments. Now, we can use any integer constant expression that Clang can evaluate, in addition to everything we handled before. PR15094 / <rdar://problem/12830437> llvm-svn: 175026
* [ms-inline-asm] Test cases to ensure the AsmRewrite list is sorted (r175021).Chad Rosier2013-02-131-0/+12
| | | | | | Part of rdar://13202662 llvm-svn: 175022
* Order the methods in the global method pool based on when they become ↵Douglas Gregor2013-02-123-6/+22
| | | | | | visible, not when they become deserialized <rdar://problem/13203033>. llvm-svn: 175018
* [ms-inline-asm] Add test cases for the align/emit directives.Chad Rosier2013-02-121-0/+16
| | | | | | Part of rdar://13200215 llvm-svn: 175009
* Add a test for r174980, that we used to acceptDmitri Gribenko2013-02-121-2/+10
| | | | llvm-svn: 175005
* [ms-inline asm] Update test case now that we are correctly parsing __emit ↵Chad Rosier2013-02-121-2/+2
| | | | | | directives. llvm-svn: 175000
* Typo.Chad Rosier2013-02-121-1/+1
| | | | llvm-svn: 174995
* [ms-inline asm] Add a few test cases for the parsing of hexidecimal integers.Chad Rosier2013-02-121-0/+34
| | | | llvm-svn: 174989
* Accept over-qualified constructor in MSVC emulation modeDmitri Gribenko2013-02-122-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSVC accepts this: class A { A::A(); }; Clang accepts regular member functions with extra qualification as an MS extension, but not constructors. This changes the parser to defer rejecting qualified constructors so that the same Sema logic can apply to constructors as regular member functions. This also improves the error message when MS extensions are disabled (in my opinion). Before it was: /Users/jason/Desktop/test.cpp:2:8: error: expected member name or ';' after declaration specifiers A::A(); ~~~~ ^ 1 error generated. After: /Users/jason/Desktop/test.cpp:2:6: error: extra qualification on member 'A' A::A(); ~~~^ 1 error generated. Patch by Jason Haslam. llvm-svn: 174980
* Rename -constructors test to just -structors as in fact it tests dtors too. ↵Timur Iskhodzhanov2013-02-121-1/+1
| | | | | | Also, fix a minor typo in the test. llvm-svn: 174966
* Attempt to fix this test on i686 targets.Nick Lewycky2013-02-121-1/+1
| | | | llvm-svn: 174953
* The meat of this patch is in BuildCXXMemberCalLExpr where we make it useNick Lewycky2013-02-123-1/+53
| | | | | | | | | | | | MarkMemberReferenced instead of marking functions referenced directly. An audit of callers to MarkFunctionReferenced and DiagnoseUseOfDecl also caused a few other changes: * don't mark functions odr-used when considering them for an initialization sequence. Do mark them referenced though. * the function nominated by the cleanup attribute should be diagnosed. * operator new/delete should be diagnosed when building a 'new' expression. llvm-svn: 174951
* Properly assemble PHIs after a null-checked invoke of objc_msgSend.John McCall2013-02-122-18/+68
| | | | | | rdar://12046763 llvm-svn: 174946
* Fix a bug reduced from a crash when trying to use modules with libc++. We checkRichard Smith2013-02-123-0/+23
| | | | | | | | the linkage of functions and variables while merging declarations from modules, and we don't necessarily have enough of the rest of the AST loaded at that point to allow us to compute linkage, so serialize it instead. llvm-svn: 174943
* Call __cxa_begin_catch with the current exception beforeJohn McCall2013-02-124-8/+17
| | | | | | calling std::terminate(). rdar://11904428 llvm-svn: 174940
* Remove an assert which triggers when a decl context in a module hits the 'hasRichard Smith2013-02-123-0/+21
| | | | | | | | | lexical storage but not visible storage' case in C++. It's unclear whether we even need the special-case handling for C++, since it seems to be working around our not serializing a lookup table for the TU in C. But in any case, the assertion is incorrect. llvm-svn: 174931
* Perform placeholder conversions on the controller of a _GenericJohn McCall2013-02-121-0/+17
| | | | | | expression. llvm-svn: 174930
OpenPOWER on IntegriCloud