summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Diagnose loads of 'half' l-values in OpenCL.John McCall2013-02-121-15/+13
| | | | | | Patch by Joey Gouly! llvm-svn: 174928
* Backing out r174919 while I investigate a self-host bug on Takumi's builder.Lang Hames2013-02-123-3/+10
| | | | llvm-svn: 174925
* In ARC, emit non-peepholed +1s within the full-expression insteadJohn McCall2013-02-121-0/+39
| | | | | | of immediately afterwards. llvm-svn: 174922
* Split a couple of tests out into their own file.John McCall2013-02-122-93/+95
| | | | llvm-svn: 174921
* When generating IR for default copy-constructors, copy-assignment operators,Lang Hames2013-02-113-10/+3
| | | | | | | | | | | | | | | | | | | | move-constructors and move-assignment operators, use memcpy to copy adjacent POD members. Previously, classes with one or more Non-POD members would fall back on element-wise copies for all members, including POD members. This often generated a lot of IR. Without padding metadata, it wasn't often possible for the LLVM optimizers to turn the element-wise copies into a memcpy. This code hasn't yet received any serious tuning. I didn't see any serious regressions on a self-hosted clang build, or any of the nightly tests, but I think it's important to get this out in the wild to get more testing. Insights, feedback and comments welcome. Many thanks to David Blaikie, Richard Smith, and especially John McCall for their help and feedback on this work. llvm-svn: 174919
* objective-C modern translator: Fixes a mistranslationFariborz Jahanian2013-02-111-0/+26
| | | | | | | of @throw statement by finding location of the ';' correctly. // rdar://13186010 llvm-svn: 174898
* [Modules] Cope better with top-level declarations loaded after being ↵Douglas Gregor2013-02-115-0/+29
| | | | | | | | | | | | | | | | | | | | declared in the current translation unit <rdar://problem/13189985>. These two related tweaks to keep the information associated with a given identifier correct when the identifier has been given some top-level information (say, a top-level declaration) and more information is then loaded from a module. The first ensures that an identifier that was "interesting" before being loaded from an AST is considered to be different from its on-disk counterpart. Otherwise, we lose such changes when writing the current translation unit as a module. Second, teach the code that injects AST-loaded names into the identifier chain for name lookup to keep the most recent declaration, so that we don't end up confusing our declaration chains by having a different declaration in there. llvm-svn: 174895
* Update test to not fail with attribute groups.Bill Wendling2013-02-111-2/+2
| | | | llvm-svn: 174866
* Use -mno-implicit-float by default for kernel/kext code. <rdar://13177960>Bob Wilson2013-02-101-0/+6
| | | | | | | | | | | Apple's kernel engineers have been expecting this behavior even though we've never implemented it before, as far as I can tell. In recent months, clang has gotten better at using vector instructions to optimize memcpy-like operations, and that has exposed problems when vector/floating-point instructions are used in kexts that don't support that. This behavior also matches what Apple's GCC did for PowerPC targets. llvm-svn: 174838
* Recognize -mno-implicit-float option for x86 as well as ARM. <rdar://13180731>Bob Wilson2013-02-101-1/+4
| | | | | | | | | For x86 targets, we've been using the -msoft-float option to control passing the no-implicit-float option to cc1. Since the -mno-implicit-float option is now accepted by the driver, this just makes it work for x86 the same as it does for ARM targets. llvm-svn: 174836
OpenPOWER on IntegriCloud