summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Improve the bit-field too wide error message.Anders Carlsson2010-04-151-2/+2
| | | | llvm-svn: 101384
* Diagnose attempts to throw an abstract class type.Douglas Gregor2010-04-151-0/+5
| | | | llvm-svn: 101381
* Fix PR 6844, a regression caused by the introduction of llvm_unreachable for ↵Ted Kremenek2010-04-151-25/+61
| | | | | | | | | | the default case in GRExprEngine::Visit (in r101129). Instead, enumerate all Stmt cases and have no 'default' case in the switch statement. When we encounter a Stmt we don't handle, we should explicitly add it to the switch statement. llvm-svn: 101378
* Split adding the primary virtual base offsets out into a separate pass. This ↵Anders Carlsson2010-04-152-35/+71
| | | | | | fixes a bug where we would lay out virtual bases in the wrong order. llvm-svn: 101373
* Fix a few cases where enum constant handling was usingDouglas Gregor2010-04-151-3/+3
| | | | | | | | | | ASTContext::getTypeSize() rather than ASTContext::getIntWidth() for the width of an integral type. The former includes padding for bools (to the target's size) while the latter does not, so we woud end up zero-extending bools to the target width when we shouldn't. Fixes a crash-on-valid in the included test. llvm-svn: 101372
* clang -cc1: Add a -fno-bitfield-type-align option, for my own testing purposes.Daniel Dunbar2010-04-152-2/+12
| | | | llvm-svn: 101370
* Tweak spelling (Bitfield -> BitField)Daniel Dunbar2010-04-152-2/+2
| | | | llvm-svn: 101369
* Teach -fixit to modify all of its inputs instead of just the main file, unlessNick Lewycky2010-04-152-31/+76
| | | | | | -fixit-at specified a particular fixit to fix, or the -o flag was used. llvm-svn: 101359
* Tidy up comment.Daniel Dunbar2010-04-151-4/+3
| | | | llvm-svn: 101357
* Add TargetInfo::useBitfieldTypeAlignment().Daniel Dunbar2010-04-152-7/+6
| | | | | | | | | | | | | | | - Used to determine whether the alignment of the type in a bit-field is respected when laying out structures. The default is true, targets can override this as needed. - This is designed to correspond to the PCC_BITFIELD_TYPE_MATTERS macro in gcc. The AST/Sema implementation only affects one line, unless I have forgotten something. I'd appreciate further review. - IRgen still needs to be updated to fully support this (which is effectively PR5591). llvm-svn: 101356
* Driver/Frontend: Add support for -mllvm, which forwards options to the LLVM ↵Daniel Dunbar2010-04-152-1/+16
| | | | | | | | option parser. - Note that this is a behavior change, previously -mllvm at the driver level forwarded to clang -cc1. The driver does a little magic to make sure that '-mllvm -disable-llvm-optzns' works correctly, but other users will need to be updated to use -Xclang. llvm-svn: 101354
* IRgen: Change CGBitFieldInfo to take the AccessInfo as constructor ↵Daniel Dunbar2010-04-153-20/+38
| | | | | | | | arguments, it is now an immutable object. Also, add some checking of various invariants that should hold on the CGBitFieldInfo access. llvm-svn: 101345
* IRgen: Eliminate now unused fields from CGBitFieldInfo.Daniel Dunbar2010-04-153-22/+15
| | | | llvm-svn: 101344
* IRgen: (Reapply 101222, with fixes) Move EmitStoreThroughBitfieldLValue to ↵Daniel Dunbar2010-04-151-88/+84
| | | | | | | | | | | | | | | | use new CGBitfieldInfo::AccessInfo decomposition, instead of computing the access policy itself. - Sadly, this doesn't seem to give any .ll size win so far. It is possible to make this routine significantly smarter & avoid various shifting, masking, and zext/sext, but I'm not really convinced it is worth it. It is tricky, and this is really instcombine's job. - No intended functionality change; the test case is just to increase coverage & serves as a demo file, it worked before this commit. The new fixes from r101222 are: 1. The shift to the target position needs to occur after the value is extended to the correct size. This broke Clang bootstrap, among other things no doubt. 2. Swap the order of arguments to OR, to get a tad more constant folding. llvm-svn: 101339
* Rewrite handling of 64-bit palignr intrinsics to be vector shuffles.Eric Christopher2010-04-152-3/+33
| | | | | | | | | Stop multiplying constant by 8 accordingly in the header and change intrinsic definition for what types we expect. Add to existing palignr test to check that we're emitting the correct things. llvm-svn: 101332
* Warn about non-aggregate classes with no user-declared constructorsDouglas Gregor2010-04-151-0/+24
| | | | | | | that have reference or const scalar members, since those members can never be initializer or modified. Fixes <rdar://problem/7804350>. llvm-svn: 101316
* Always diagnose and complain about problems inDouglas Gregor2010-04-143-69/+89
| | | | | | | | | | ResolveAddressOfOverloadedFunction when asked to complain. Previously, we had some weird handshake where ResolveAddressOfOverloadedFunction expected its caller to handle some of the diagnostics but not others, and yet there was no way for the caller to know which case we were in. Eliminate this madness, fixing <rdar://problem/7765884>. llvm-svn: 101312
* Fix 80-cols violtaionsAlexis Hunt2010-04-141-4/+7
| | | | llvm-svn: 101311
* Once we've emitted a fatal diagnostic, keep counting errors but with aDouglas Gregor2010-04-142-2/+10
| | | | | | | | | | | | | | separate count of "suppressed" errors. This way, semantic analysis bits that depend on the error count to determine whether problems occured (e.g., some template argument deduction failures, jump-scope checking) will not get confused. The actual problem here is that a missing #include (which is a fatal error) could cause the jump-scope checker to run on invalid code, which it is not prepared to do. Trivial fix for both <rdar://problem/7775941> and <rdar://problem/7775709>. llvm-svn: 101297
* Fix a -pedantic spurious warning involving @dynamic.Fariborz Jahanian2010-04-141-1/+5
| | | | llvm-svn: 101284
* improve altivec c++ support by adding casts, patch byChris Lattner2010-04-141-198/+49
| | | | | | Anton Yartsev! llvm-svn: 101281
* Thread a Scope pointer into BuildRecoveryCallExpr to help typoDouglas Gregor2010-04-143-6/+6
| | | | | | | correction find names when a call failed. Fixes <rdar://problem/7853795>. llvm-svn: 101278
* Teach typo correction about various language keywords. We can'tDouglas Gregor2010-04-1410-105/+409
| | | | | | | | | | | | | generally recover from typos in keywords (since we would effectively have to mangle the token stream). However, there are still benefits to typo-correcting with keywords: - We don't make stupid suggestions when the user typed something that is similar to a keyword. - We can suggest the keyword in a diagnostic (did you mean "static_cast"?), even if we can't recover and therefore don't have a fix-it. llvm-svn: 101274
* Return the corrected DeclarationName from Sema::CorrectTypo ratherDouglas Gregor2010-04-142-19/+23
| | | | | | | | than just a bool indicating that correction occurred. No actual functionality change (it's still always used like a bool), but this refactoring will be used to support typo correction to keywords. llvm-svn: 101259
* IRgen/NeXT: Simplify to use AST record layout for getting offsets instead of theDaniel Dunbar2010-04-141-13/+4
| | | | | | IRgen record layout, which this code doesn't need to depend on. llvm-svn: 101257
* When diagnosing suspicious precedence or assignments, move the fix-itDouglas Gregor2010-04-141-20/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | that adds parentheses from the main diagnostic down to a new note. This way, when the fix-it represents a choice between two options, each of the options is associted with a note. There is no default option in such cases. For example: /Users/dgregor/t.c:2:9: warning: & has lower precedence than ==; == will be evaluated first [-Wparentheses] if (x & y == 0) { ^~~~~~~~ /Users/dgregor/t.c:2:9: note: place parentheses around the & expression to evaluate it first if (x & y == 0) { ^ ( ) /Users/dgregor/t.c:2:9: note: place parentheses around the == expression to silence this warning if (x & y == 0) { ^ ( ) llvm-svn: 101249
* Move GRStmtNodeBuilder::MakeNode() out of line. No functionality change.Zhongxing Xu2010-04-141-0/+27
| | | | llvm-svn: 101239
* Add support for CXXBoolLiteralExpr.Zhongxing Xu2010-04-142-1/+9
| | | | llvm-svn: 101238
* Use direct assignment instead of user defined conversion.Zhongxing Xu2010-04-141-3/+3
| | | | llvm-svn: 101236
* Speculatively revert "IRgen: Move EmitStoreThroughBitfieldLValue to use new ↵Daniel Dunbar2010-04-141-82/+88
| | | | | | CGBitfieldInfo::AccessInfo decomposition, instead of computing the access policy itself.", I think it might be breaking bootstrap. llvm-svn: 101235
* Improve line marker directive locations, patch by Jordy RoseChris Lattner2010-04-142-3/+4
| | | | llvm-svn: 101226
* IRgen: Move EmitStoreThroughBitfieldLValue to use new ↵Daniel Dunbar2010-04-141-88/+82
| | | | | | | | | | CGBitfieldInfo::AccessInfo decomposition, instead of computing the access policy itself. - Sadly, this doesn't seem to give any .ll size win so far. It is possible to make this routine significantly smarter & avoid various shifting, masking, and zext/sext, but I'm not really convinced it is worth it. It is tricky, and this is really instcombine's job. - No intended functionality change; the test case is just to increase coverage & serves as a demo file, it worked before this commit. llvm-svn: 101222
* IRgen: Tweak CGBitFieldInfo doxyments & add an accessor.Daniel Dunbar2010-04-141-0/+10
| | | | llvm-svn: 101221
* make the token paste avoidance logic turn "..." into ".. ." instead of ". . ."Chris Lattner2010-04-143-6/+13
| | | | | | when avoiding paste. Patch by David Peixotto! llvm-svn: 101218
* implement altivec.h and a bunch of support code, patch by Anton Yartsev!Chris Lattner2010-04-144-0/+1681
| | | | llvm-svn: 101215
* remove some obsolete super-handling code that I forgot to zap.Chris Lattner2010-04-141-30/+0
| | | | llvm-svn: 101212
* Implement typo correction for Objective-C message sends when theDouglas Gregor2010-04-142-0/+61
| | | | | | | | | | | | | | | | | | | | | receiver is a mis-typed class name. Previously, we would give a non-specific typo-correction diagnostic from the expression-parsing code, but there was no fix-it because it was too late to recover. Now, we give a nice diagnostic honk.m:6:4: error: unknown receiver 'Hnk'; did you mean 'Honk'? [Hnk method]; ^~~ Honk honk.m:1:1: note: 'Honk' declared here @interface Honk ^ which includes a fix-it. We still need to recover better from mis-typing "super". llvm-svn: 101211
* Introduce a parsing action to distinguish between class, instance, andDouglas Gregor2010-04-142-10/+25
| | | | | | | | super message sends in Objective-C. No actual functionality change here, but it provides a hook so that Sema can typo-correct the receiver in some cases. llvm-svn: 101207
* Mark a function declaration invalid if any of its parameter declarationsJohn McCall2010-04-141-0/+3
| | | | | | | are invalid. Prevents a crash-on-invalid during template instantiation. I... really don't understand how this wasn't already present. llvm-svn: 101203
* Parse friend template ids as types instead of ending up inJohn McCall2010-04-141-4/+8
| | | | | | | ActOnClassTemplateSpecialization and being very confused. Fixes PR6514 (for non-templated-scope friends). llvm-svn: 101198
* Add encoding of reference types like gcc does for objc methods andFariborz Jahanian2010-04-131-3/+8
| | | | | | blocks. Fixes PR6468. llvm-svn: 101196
* Use ASTVector instead of std::vector for the Exprs in InitListExpr. PerformanceTed Kremenek2010-04-135-28/+34
| | | | | | | measurements of '-fsyntax-only' on combine.c (403.gcc) shows no real performance change, but now the vector isn't leaked. llvm-svn: 101195
* IRgen: Move EmitLoadOfBitfieldLValue to use new CGBitfieldInfo::AccessInfo ↵Daniel Dunbar2010-04-131-51/+61
| | | | | | | | | | | | decomposition, instead of computing the access policy itself. - This lets the method focus slightly more on emitting clean IR to honor the policy which has been selected. On 403.gcc's combine.c, x86_64, -O0, this reduces the number of lines in the .ll file (~= # of instructions) by 2.5%. - No intended functionality change -- at -O3 this should produce equivalent if not identical output. On 403.gcc's combine.c, x86_64, -O3, this isn't quite true and some of the changes are regressions, but I'm not going to worry about that until we move to a new access policy. - There is still some room for improvement in the generated IR, in particular we can usually fold the sign-extension of the bit-field into one of the component access. See the FIXME. llvm-svn: 101192
* Fix an embarrasing memory error. I was apparently very tired when I wrote thisJohn McCall2010-04-131-1/+1
| | | | | | | | code the first time. Fixes PR6827. llvm-svn: 101184
* IRgen: Enhance CGBitFieldInfo with enough information to fully describe the ↵Daniel Dunbar2010-04-133-6/+159
| | | | | | | | | | "policy" with which a bit-field should be accessed. - For now, these policies are computed to match the current IRgen strategy, although the new information isn't being used yet (except in -fdump-record-layouts). - Design comments appreciated. llvm-svn: 101178
* Remove unnecessary cast.Daniel Dunbar2010-04-131-1/+1
| | | | llvm-svn: 101176
* Support befriending members of class template specializations.John McCall2010-04-133-8/+38
| | | | llvm-svn: 101173
* Twik to radar 7839485. Do not attach weak_import attribute to classFariborz Jahanian2010-04-131-3/+3
| | | | | | for non-fragile abi on darwin. llvm-svn: 101168
* Turn off warning about weak_import attributeFariborz Jahanian2010-04-131-3/+1
| | | | | | on objc classes for Darwin. Radar 7839485. llvm-svn: 101164
* Removes a FIXME.Fariborz Jahanian2010-04-131-4/+2
| | | | llvm-svn: 101161
OpenPOWER on IntegriCloud