summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Binding a reference to an rvalue is a direct binding in C++0x but notDouglas Gregor2010-04-181-20/+17
| | | | | | in C++03. llvm-svn: 101707
* Fix the access checking of function and function template argument types,Chandler Carruth2010-04-181-2/+9
| | | | | | | return types, and default arguments. This fixes PR6855 along with several similar cases where we rejected valid code. llvm-svn: 101706
* When checking the copy constructor for the optional copy during aDouglas Gregor2010-04-181-3/+19
| | | | | | | | | reference binding to an rvalue of reference-compatible type, check parameters after the first for complete parameter types and build any required default function arguments. We're effectively simulating the type-checking for a call without building the call itself. llvm-svn: 101705
* In C++98/03, when binding a reference to an rvalue ofDouglas Gregor2010-04-183-16/+95
| | | | | | | | | | | | | | | | | reference-compatible type, the implementation is permitted to make a copy of the rvalue (or many such copies, even). However, even though we don't make that copy, we are required to check for the presence of a suitable copy constructor. With this change, we do. Note that in C++0x we are not allowed to make these copies, so we test both dialects separately. Also note the FIXME in one of the C++03 tests, where we are not instantiating default function arguments for the copy constructor we pick (but do not call). The fix is obvious; eliminating the infinite recursion it causes is not. Will address that next. llvm-svn: 101704
* Allow the 'ibaction' attribute to be attached to method declarations (and ↵Ted Kremenek2010-04-181-2/+12
| | | | | | not issue a warning). llvm-svn: 101699
* Do not consider explicit constructors when performing a copy to aDouglas Gregor2010-04-181-1/+2
| | | | | | | | | temporary object. This is blindingly obvious from reading C++ [over.match.ctor]p1, but somehow I'd missed it and it took DR152 to educate me. Adjust one test that was relying on this non-standard behavior. llvm-svn: 101688
* Simplify wide bit-field layout in CGRecordLayoutBuilder, and also fix a bug ↵Anders Carlsson2010-04-171-15/+10
| | | | | | where assigning to a bit-field member would overwrite other parts of the struct. llvm-svn: 101681
* Improve our handling of user-defined conversions as part of overloadDouglas Gregor2010-04-174-77/+138
| | | | | | | | | | | | | | | | | resolution. There are two sources of problems involving user-defined conversions that this change eliminates, along with providing simpler interfaces for checking implicit conversions: - It eliminates a case of infinite recursion found in Boost. - It eliminates the search for the constructor needed to copy a temporary generated by an implicit conversion from overload resolution. Overload resolution assumes that, if it gets a value of the parameter's class type (or a derived class thereof), there is a way to copy if... even if there isn't. We now model this properly. llvm-svn: 101680
* Fix an assert when assigning a boolean value to a bitfield of type _Bool.Anders Carlsson2010-04-171-1/+5
| | | | llvm-svn: 101678
* Unnamed bit-fields in a union should be laid out with a type that doesn't ↵Anders Carlsson2010-04-171-1/+17
| | | | | | affect alignment. llvm-svn: 101673
* Factor union field layout code out into a separate function. No ↵Anders Carlsson2010-04-171-18/+31
| | | | | | functionality change. llvm-svn: 101671
* If a wide bit-field is inside a union its offset should always be 0.Anders Carlsson2010-04-171-4/+7
| | | | llvm-svn: 101668
* Add support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are notChandler Carruth2010-04-175-3/+28
| | | | | | | | implemented precisely the same as GCC, but the distinction GCC makes isn't useful to represent. This allows parsing code which uses GCC-specific keywords ('asm', etc.) without parsing in a fully GNU mode. llvm-svn: 101667
* Vtable -> VTable renames across the board.Anders Carlsson2010-04-1718-106/+106
| | | | llvm-svn: 101666
* fix integrated assembler with i386 objc code.Chris Lattner2010-04-171-4/+4
| | | | llvm-svn: 101660
* Fix a bug where we would sometimes incorrectly mark an vtable function as ↵Anders Carlsson2010-04-171-6/+3
| | | | | | unused. llvm-svn: 101643
* Add printName to DeclarationName which prints the human-readable name on aBenjamin Kramer2010-04-172-30/+35
| | | | | | raw_ostream. Use it in getAsString and NamedDecl's raw_ostream operator. llvm-svn: 101633
* Add raw_ostream operators to NamedDecl for convenience. Switch over all ↵Benjamin Kramer2010-04-1726-128/+123
| | | | | | | | users of getNameAsString on a stream. The next step is to print the name directly into the stream, avoiding a temporary std::string copy. llvm-svn: 101632
* revert r101568, which miscompiles this testcase, distilled from ldecod:Chris Lattner2010-04-171-5/+6
| | | | | | | | | | void exit_picture() { char yuv_types[4][6]= {"4:0:0","4:2:0","4:2:2","4:4:4"}; foo(yuv_types); } llvm-svn: 101623
* Driver: Add missing claim() for -mllvm options.Daniel Dunbar2010-04-171-0/+2
| | | | llvm-svn: 101618
* Consolidate most of the integer constant expression builtin requirementEric Christopher2010-04-172-70/+52
| | | | | | | | checking into a single function and use that throughout. Remove some now unnecessary diagnostics and update tests with now more accurate diagnostics. llvm-svn: 101610
* emit warn_char_constant_too_large at most once per literal, fixing PR6852Chris Lattner2010-04-161-1/+4
| | | | llvm-svn: 101580
* make our existing "switch on bool" warning work for C. SinceChris Lattner2010-04-162-1/+60
| | | | | | | the result of comparisons are 'int' in C, it doesn't work to test just the result type of the expression. llvm-svn: 101576
* If a non-noreturn virtual member function is guaranteed not to return,Douglas Gregor2010-04-161-5/+16
| | | | | | | do *not* suggest that the function could be attribute 'noreturn'; overridden functions may end up returning. llvm-svn: 101572
* Switch Sema::FindCompositePointerType() over to InitializationSequence. Douglas Gregor2010-04-163-42/+72
| | | | | | | This is the last of the uses of TryImplicitConversion outside of overload resolution and InitializationSequence itself. llvm-svn: 101569
* fix PR6766: codegen of var initialized with wide charNuno Lopes2010-04-161-6/+5
| | | | llvm-svn: 101568
* Move Sema::PerformImplicitConversion over to where ↵Douglas Gregor2010-04-162-24/+24
| | | | | | Sema::TryImplicitConversion is, for my own sanity. No functionality change llvm-svn: 101554
* Make Sema::BuildCXXCastArgument static, since it now only has one caller. No ↵Douglas Gregor2010-04-162-44/+40
| | | | | | functionality change llvm-svn: 101550
* Collapse the three separate initialization paths inDouglas Gregor2010-04-169-234/+51
| | | | | | | | | | | | | | | | | | TryStaticImplicitCast (for references, class types, and everything else, respectively) into a single invocation of InitializationSequence. One of the paths (for class types) was the only client of Sema::TryInitializationByConstructor, which I have eliminated. This also simplified the interface for much of the cast-checking logic, eliminating yet more code. I've kept the representation of C++ functional casts with <> 1 arguments the same, despite the fact that I hate it. That fix will come soon. To satisfy my paranoia, I've bootstrapped + tested Clang with these changes. llvm-svn: 101549
* fix a bogus assertion exposed by a recent change: packing theChris Lattner2010-04-161-1/+1
| | | | | | | | | | | | | | | | | struct may cause it to shrink more than one byte. Before my recent changes we compiled the new test into: %0 = type { [6 x i8] } @x = global %0 { [6 x i8] undef }, align 2 ; <%0*> [#uses=0] which is obviously bogus. Now we compile it into: %0 = type <{ i32, i8, i8 }> @x = global %0 zeroinitializer, align 2 ; <%0*> [#uses=0] Where the last byte only is tail padding. llvm-svn: 101536
* emit padding as undef values, take 2Nuno Lopes2010-04-161-3/+3
| | | | | | merge also a few tests I had here for this feature, and FileCheck'ize one file llvm-svn: 101535
* Switch the checking of implicit casts for static_cast, C-style, andDouglas Gregor2010-04-162-22/+23
| | | | | | | | | | functional casts over to InitializationSequence, eliminating a caller of Sema::TryImplicitConversion. We also get access and ambiguity checking "for free". More cleanups to come in this routine. llvm-svn: 101526
* Add a write(raw_ostream&) method to RewriteBuffer. This uses an inefficientNick Lewycky2010-04-162-3/+7
| | | | | | | implementation today but is the right place if we want to make it faster some day. llvm-svn: 101521
* Kill ForceRValue once and for allDouglas Gregor2010-04-165-17/+2
| | | | llvm-svn: 101502
* Static analyzer: Don't crash when casting a symbolic region address to a ↵Ted Kremenek2010-04-161-8/+14
| | | | | | float. Fixes PR 6854. llvm-svn: 101499
* Eliminate the ForceRValue parameter from TryCopyInitialization.Douglas Gregor2010-04-161-9/+2
| | | | llvm-svn: 101498
* Move Sema::TryCopyInitialization into a static function inDouglas Gregor2010-04-162-29/+24
| | | | | | SemaOverload.cpp; no functionality change. llvm-svn: 101497
* Eliminate ForceRValue parameters from reference binding. Did I mentionDouglas Gregor2010-04-162-14/+9
| | | | | | that we aren't using ForceRValue any more? llvm-svn: 101496
* Silence warning.Benjamin Kramer2010-04-161-1/+1
| | | | llvm-svn: 101495
* Eliminate the ForceRValue parameter to Sema::AddOverloadCandidateDouglas Gregor2010-04-163-10/+6
| | | | llvm-svn: 101494
* Eliminate the ForceRValue parameter from most of Sema's Add*CandidateDouglas Gregor2010-04-162-25/+17
| | | | | | functions. llvm-svn: 101492
* Eliminate the ForceRValue parameter from Sema::IsUserDefinedConversion. It's ↵Douglas Gregor2010-04-162-8/+5
| | | | | | not the way we're going to handle this. llvm-svn: 101483
* Eliminate the default value for the UserCast parameter of ↵Douglas Gregor2010-04-162-2/+2
| | | | | | Sema::IsUserDefinedConversion. No functionality change llvm-svn: 101482
* Eliminate the Elidable parameter to PerformImplicitConversion; weDouglas Gregor2010-04-163-27/+10
| | | | | | don't need it. llvm-svn: 101481
* Remove this hard-coded buffer size. In some basic experiments preprocessingDan Gohman2010-04-161-2/+0
| | | | | | | | | | | large files, this doesn't seem significantly better than just letting raw_ostream pick a buffer size. This code predates raw-ostream's automatic buffer sizing; in fact, it was introduced as part of the code which would eventually become raw_ostream. llvm-svn: 101473
* Make CGRecordLayoutBuilder deal with wide bit-fields. Will land tests ↵Anders Carlsson2010-04-161-1/+20
| | | | | | shortly (Daniel, please review). llvm-svn: 101472
* Remove printfs.Anders Carlsson2010-04-161-6/+0
| | | | llvm-svn: 101470
* More work on wide bit-fields, WIP.Anders Carlsson2010-04-162-0/+66
| | | | llvm-svn: 101467
* Start working on handling wide bitfields in C++Anders Carlsson2010-04-161-4/+16
| | | | llvm-svn: 101464
* Rename the ASTContext member 'Context'.Anders Carlsson2010-04-162-35/+35
| | | | llvm-svn: 101462
OpenPOWER on IntegriCloud