]> granicus.if.org Git - clang/log
clang
14 years agoSimplify wide bit-field layout in CGRecordLayoutBuilder, and also fix a bug where...
Anders Carlsson [Sat, 17 Apr 2010 22:54:57 +0000 (22:54 +0000)]
Simplify wide bit-field layout in CGRecordLayoutBuilder, and also fix a bug where assigning to a bit-field member would overwrite other parts of the struct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101681 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove our handling of user-defined conversions as part of overload
Douglas Gregor [Sat, 17 Apr 2010 22:01:05 +0000 (22:01 +0000)]
Improve our handling of user-defined conversions as part of overload
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101680 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix an assert when assigning a boolean value to a bitfield of type _Bool.
Anders Carlsson [Sat, 17 Apr 2010 21:52:22 +0000 (21:52 +0000)]
Fix an assert when assigning a boolean value to a bitfield of type _Bool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101678 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUnnamed bit-fields in a union should be laid out with a type that doesn't affect...
Anders Carlsson [Sat, 17 Apr 2010 21:04:52 +0000 (21:04 +0000)]
Unnamed bit-fields in a union should be laid out with a type that doesn't affect alignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101673 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFactor union field layout code out into a separate function. No functionality change.
Anders Carlsson [Sat, 17 Apr 2010 20:49:27 +0000 (20:49 +0000)]
Factor union field layout code out into a separate function. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101671 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIf a wide bit-field is inside a union its offset should always be 0.
Anders Carlsson [Sat, 17 Apr 2010 20:21:41 +0000 (20:21 +0000)]
If a wide bit-field is inside a union its offset should always be 0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101668 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are not
Chandler Carruth [Sat, 17 Apr 2010 20:17:31 +0000 (20:17 +0000)]
Add support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are not
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101667 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoVtable -> VTable renames across the board.
Anders Carlsson [Sat, 17 Apr 2010 20:15:18 +0000 (20:15 +0000)]
Vtable -> VTable renames across the board.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101666 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPrevent accidental in-source builds with CMake, and detect when there are
Chandler Carruth [Sat, 17 Apr 2010 20:12:02 +0000 (20:12 +0000)]
Prevent accidental in-source builds with CMake, and detect when there are
generated files from a previous in-source builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101665 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix integrated assembler with i386 objc code.
Chris Lattner [Sat, 17 Apr 2010 18:26:20 +0000 (18:26 +0000)]
fix integrated assembler with i386 objc code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101660 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a bug where we would sometimes incorrectly mark an vtable function as unused.
Anders Carlsson [Sat, 17 Apr 2010 17:24:33 +0000 (17:24 +0000)]
Fix a bug where we would sometimes incorrectly mark an vtable function as unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101643 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd printName to DeclarationName which prints the human-readable name on a
Benjamin Kramer [Sat, 17 Apr 2010 09:56:45 +0000 (09:56 +0000)]
Add printName to DeclarationName which prints the human-readable name on a
raw_ostream. Use it in getAsString and NamedDecl's raw_ostream operator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101633 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd raw_ostream operators to NamedDecl for convenience. Switch over all users of...
Benjamin Kramer [Sat, 17 Apr 2010 09:33:03 +0000 (09:33 +0000)]
Add raw_ostream operators to NamedDecl for convenience. Switch over all users of getNameAsString on a stream.

The next step is to print the name directly into the stream, avoiding a temporary std::string copy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101632 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorevert r101568, which miscompiles this testcase, distilled from ldecod:
Chris Lattner [Sat, 17 Apr 2010 06:53:44 +0000 (06:53 +0000)]
revert r101568, which miscompiles this testcase, distilled from ldecod:

void exit_picture()
{
  char yuv_types[4][6]= {"4:0:0","4:2:0","4:2:2","4:4:4"};
  foo(yuv_types);
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101623 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Add missing claim() for -mllvm options.
Daniel Dunbar [Sat, 17 Apr 2010 06:10:00 +0000 (06:10 +0000)]
Driver: Add missing claim() for -mllvm options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101618 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoNew test to verify that we see constant integers here.
Eric Christopher [Sat, 17 Apr 2010 02:36:08 +0000 (02:36 +0000)]
New test to verify that we see constant integers here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101611 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoConsolidate most of the integer constant expression builtin requirement
Eric Christopher [Sat, 17 Apr 2010 02:26:23 +0000 (02:26 +0000)]
Consolidate most of the integer constant expression builtin requirement
checking into a single function and use that throughout. Remove some
now unnecessary diagnostics and update tests with now more accurate
diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101610 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWrap 'data' key in quotes.
Ted Kremenek [Sat, 17 Apr 2010 00:37:35 +0000 (00:37 +0000)]
Wrap 'data' key in quotes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101594 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake script actually work.
Ted Kremenek [Sat, 17 Apr 2010 00:33:24 +0000 (00:33 +0000)]
Make script actually work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101591 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoLog code completion data in json format.
Ted Kremenek [Sat, 17 Apr 2010 00:21:44 +0000 (00:21 +0000)]
Log code completion data in json format.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101587 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSend code completion data in json format.
Ted Kremenek [Sat, 17 Apr 2010 00:21:42 +0000 (00:21 +0000)]
Send code completion data in json format.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101586 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove unneeded assertion and don't return a null CXString.
Ted Kremenek [Sat, 17 Apr 2010 00:21:38 +0000 (00:21 +0000)]
Remove unneeded assertion and don't return a null CXString.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101585 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoemit warn_char_constant_too_large at most once per literal, fixing PR6852
Chris Lattner [Fri, 16 Apr 2010 23:44:05 +0000 (23:44 +0000)]
emit warn_char_constant_too_large at most once per literal, fixing PR6852

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101580 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomake our existing "switch on bool" warning work for C. Since
Chris Lattner [Fri, 16 Apr 2010 23:34:13 +0000 (23:34 +0000)]
make our existing "switch on bool" warning work for C.  Since
the result of comparisons are 'int' in C, it doesn't work to
test just the result type of the expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101576 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIf a non-noreturn virtual member function is guaranteed not to return,
Douglas Gregor [Fri, 16 Apr 2010 23:28:44 +0000 (23:28 +0000)]
If a non-noreturn virtual member function is guaranteed not to return,
do *not* suggest that the function could be attribute 'noreturn';
overridden functions may end up returning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101572 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch Sema::FindCompositePointerType() over to InitializationSequence.
Douglas Gregor [Fri, 16 Apr 2010 23:20:25 +0000 (23:20 +0000)]
Switch Sema::FindCompositePointerType() over to InitializationSequence.

This is the last of the uses of TryImplicitConversion outside of
overload resolution and InitializationSequence itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101569 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix PR6766: codegen of var initialized with wide char
Nuno Lopes [Fri, 16 Apr 2010 23:19:41 +0000 (23:19 +0000)]
fix PR6766: codegen of var initialized with wide char

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101568 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove Sema::PerformImplicitConversion over to where Sema::TryImplicitConversion is...
Douglas Gregor [Fri, 16 Apr 2010 22:27:05 +0000 (22:27 +0000)]
Move Sema::PerformImplicitConversion over to where Sema::TryImplicitConversion is, for my own sanity. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101554 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake Sema::BuildCXXCastArgument static, since it now only has one caller. No function...
Douglas Gregor [Fri, 16 Apr 2010 22:17:36 +0000 (22:17 +0000)]
Make Sema::BuildCXXCastArgument static, since it now only has one caller. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101550 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCollapse the three separate initialization paths in
Douglas Gregor [Fri, 16 Apr 2010 22:09:46 +0000 (22:09 +0000)]
Collapse the three separate initialization paths in
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101549 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRework USR generation for symbols with no linkage. Many of the USRs are now shortened,
Ted Kremenek [Fri, 16 Apr 2010 21:31:52 +0000 (21:31 +0000)]
Rework USR generation for symbols with no linkage.  Many of the USRs are now shortened,
and we now include the file name that declares the symbol with no linkage in the USR.
USRs for such symbols are generated only in restructed cases, e.g., anonymous enum declarations,
typedefs, etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101542 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoignore Output folder
Nuno Lopes [Fri, 16 Apr 2010 21:28:45 +0000 (21:28 +0000)]
ignore Output folder

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101541 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoignore Output folder
Nuno Lopes [Fri, 16 Apr 2010 21:28:30 +0000 (21:28 +0000)]
ignore Output folder

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101540 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd another test for the undef patch just for to have peace of mind :)
Nuno Lopes [Fri, 16 Apr 2010 21:19:39 +0000 (21:19 +0000)]
add another test for the undef patch just for to have peace of mind :)
this follows from C99 6.7.8p10: if it is a union, the first named member is initialized

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101539 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix a bogus assertion exposed by a recent change: packing the
Chris Lattner [Fri, 16 Apr 2010 21:02:32 +0000 (21:02 +0000)]
fix a bogus assertion exposed by a recent change: packing the
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101536 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoemit padding as undef values, take 2
Nuno Lopes [Fri, 16 Apr 2010 20:56:35 +0000 (20:56 +0000)]
emit padding as undef values, take 2
merge also a few tests I had here for this feature, and FileCheck'ize one file

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101535 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch the checking of implicit casts for static_cast, C-style, and
Douglas Gregor [Fri, 16 Apr 2010 19:30:02 +0000 (19:30 +0000)]
Switch the checking of implicit casts for static_cast, C-style, and
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101526 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a write(raw_ostream&) method to RewriteBuffer. This uses an inefficient
Nick Lewycky [Fri, 16 Apr 2010 18:49:45 +0000 (18:49 +0000)]
Add a write(raw_ostream&) method to RewriteBuffer. This uses an inefficient
implementation today but is the right place if we want to make it faster some
day.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101521 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoallow mapping fatal errors to errors.
Chris Lattner [Fri, 16 Apr 2010 18:39:52 +0000 (18:39 +0000)]
allow mapping fatal errors to errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101516 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoKill ForceRValue once and for all
Douglas Gregor [Fri, 16 Apr 2010 18:00:29 +0000 (18:00 +0000)]
Kill ForceRValue once and for all

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101502 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStatic analyzer: Don't crash when casting a symbolic region address to a float. ...
Ted Kremenek [Fri, 16 Apr 2010 17:54:33 +0000 (17:54 +0000)]
Static analyzer: Don't crash when casting a symbolic region address to a float.  Fixes PR 6854.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101499 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate the ForceRValue parameter from TryCopyInitialization.
Douglas Gregor [Fri, 16 Apr 2010 17:53:55 +0000 (17:53 +0000)]
Eliminate the ForceRValue parameter from TryCopyInitialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101498 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove Sema::TryCopyInitialization into a static function in
Douglas Gregor [Fri, 16 Apr 2010 17:51:22 +0000 (17:51 +0000)]
Move Sema::TryCopyInitialization into a static function in
SemaOverload.cpp; no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101497 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate ForceRValue parameters from reference binding. Did I mention
Douglas Gregor [Fri, 16 Apr 2010 17:45:54 +0000 (17:45 +0000)]
Eliminate ForceRValue parameters from reference binding. Did I mention
that we aren't using ForceRValue any more?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101496 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSilence warning.
Benjamin Kramer [Fri, 16 Apr 2010 17:43:15 +0000 (17:43 +0000)]
Silence warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101495 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate the ForceRValue parameter to Sema::AddOverloadCandidate
Douglas Gregor [Fri, 16 Apr 2010 17:41:49 +0000 (17:41 +0000)]
Eliminate the ForceRValue parameter to Sema::AddOverloadCandidate

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101494 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate the ForceRValue parameter from most of Sema's Add*Candidate
Douglas Gregor [Fri, 16 Apr 2010 17:33:27 +0000 (17:33 +0000)]
Eliminate the ForceRValue parameter from most of Sema's Add*Candidate
functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101492 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate the ForceRValue parameter from Sema::IsUserDefinedConversion. It's not...
Douglas Gregor [Fri, 16 Apr 2010 17:25:05 +0000 (17:25 +0000)]
Eliminate the ForceRValue parameter from Sema::IsUserDefinedConversion. It's not the way we're going to handle this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101483 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate the default value for the UserCast parameter of Sema::IsUserDefinedConversi...
Douglas Gregor [Fri, 16 Apr 2010 17:21:50 +0000 (17:21 +0000)]
Eliminate the default value for the UserCast parameter of Sema::IsUserDefinedConversion. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101482 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate the Elidable parameter to PerformImplicitConversion; we
Douglas Gregor [Fri, 16 Apr 2010 17:16:43 +0000 (17:16 +0000)]
Eliminate the Elidable parameter to PerformImplicitConversion; we
don't need it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101481 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove this hard-coded buffer size. In some basic experiments preprocessing
Dan Gohman [Fri, 16 Apr 2010 16:28:05 +0000 (16:28 +0000)]
Remove this hard-coded buffer size. In some basic experiments preprocessing
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101473 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake CGRecordLayoutBuilder deal with wide bit-fields. Will land tests shortly (Daniel...
Anders Carlsson [Fri, 16 Apr 2010 16:23:02 +0000 (16:23 +0000)]
Make CGRecordLayoutBuilder deal with wide bit-fields. Will land tests shortly (Daniel, please review).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101472 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove printfs.
Anders Carlsson [Fri, 16 Apr 2010 15:59:41 +0000 (15:59 +0000)]
Remove printfs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101470 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore work on wide bit-fields, WIP.
Anders Carlsson [Fri, 16 Apr 2010 15:57:11 +0000 (15:57 +0000)]
More work on wide bit-fields, WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101467 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd Debug+Coverage to svn:ignore.
Dan Gohman [Fri, 16 Apr 2010 15:44:09 +0000 (15:44 +0000)]
Add Debug+Coverage to svn:ignore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101466 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStart working on handling wide bitfields in C++
Anders Carlsson [Fri, 16 Apr 2010 15:16:32 +0000 (15:16 +0000)]
Start working on handling wide bitfields in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101464 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename the ASTContext member 'Context'.
Anders Carlsson [Fri, 16 Apr 2010 15:07:51 +0000 (15:07 +0000)]
Rename the ASTContext member 'Context'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101462 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoOnly predefine the macro _GNU_SOURCE in C++ mode when we're on a
Douglas Gregor [Fri, 16 Apr 2010 06:31:05 +0000 (06:31 +0000)]
Only predefine the macro _GNU_SOURCE in C++ mode when we're on a
platform that typically uses glibc. Fixes a Boost.Thread compilation
failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101450 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agotidy up
Chris Lattner [Fri, 16 Apr 2010 06:12:51 +0000 (06:12 +0000)]
tidy up

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101447 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoExpand the argument diagnostics for too many arguments and give
Eric Christopher [Fri, 16 Apr 2010 04:56:46 +0000 (04:56 +0000)]
Expand the argument diagnostics for too many arguments and give
both number seen and number expected.

Finishes fixing PR6501.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101442 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoExpand argument diagnostic for too few arguments to give the number
Eric Christopher [Fri, 16 Apr 2010 04:48:22 +0000 (04:48 +0000)]
Expand argument diagnostic for too few arguments to give the number
of arguments both seen and expected.

Fixes PR6501.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101441 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoConvert libCIndex to use the new native EXPORTED_SYMBOL_FILE mechanism.
Dan Gohman [Fri, 16 Apr 2010 04:45:02 +0000 (04:45 +0000)]
Convert libCIndex to use the new native EXPORTED_SYMBOL_FILE mechanism.

libCIndex also has a CMakeLists.txt file which has its own code for using
the exports file. To preserve existing functionality, create a separate
darwin-specific exports file for use by this CMakeLists.txt code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101440 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a bug in caret-line-pruning logic that only happens when we have a
Douglas Gregor [Fri, 16 Apr 2010 00:23:51 +0000 (00:23 +0000)]
Fix a bug in caret-line-pruning logic that only happens when we have a
source line wider than the terminal where the associated fix-it line
is longer than the caret line. Previously, we would crash in this
case, which was rather unfortunate. Fixes <rdar://problem/7856226>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101426 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAudit uses of Sema::LookupSingleName for those lookups that are
Douglas Gregor [Thu, 15 Apr 2010 23:40:53 +0000 (23:40 +0000)]
Audit uses of Sema::LookupSingleName for those lookups that are
intended for redeclarations, fixing those that need it. Fixes PR6831.

This uncovered an issue where the C++ type-specifier-seq parsing logic
would try to perform name lookup on an identifier after it already had
a type-specifier, which could also lead to spurious ambiguity errors
(as in PR6831, but with a different test case).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101419 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFeed proper source-location information into Sema::LookupSingleResult,
Douglas Gregor [Thu, 15 Apr 2010 22:33:43 +0000 (22:33 +0000)]
Feed proper source-location information into Sema::LookupSingleResult,
in case it ends up doing something that might trigger diagnostics
(template instantiation, ambiguity reporting, access
reporting). Noticed while working on PR6831.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101412 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBetter support USRs for anonymous enums, structs, by including the location where
Ted Kremenek [Thu, 15 Apr 2010 21:51:13 +0000 (21:51 +0000)]
Better support USRs for anonymous enums, structs, by including the location where
the tag was declared.  WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101403 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSpecify temporary file for -emit-llvm output in test case so that we don't deposit...
Ted Kremenek [Thu, 15 Apr 2010 21:11:33 +0000 (21:11 +0000)]
Specify temporary file for -emit-llvm output in test case so that we don't deposit the file
in the original source directory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101402 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDo not generate USRs for declarations with 'no linkage' except for enums, structs...
Ted Kremenek [Thu, 15 Apr 2010 21:04:25 +0000 (21:04 +0000)]
Do not generate USRs for declarations with 'no linkage' except for enums, structs, typedefs.
Those still need work to disambiguate them across translation units.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101401 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove the bit-field too wide error message.
Anders Carlsson [Thu, 15 Apr 2010 18:47:32 +0000 (18:47 +0000)]
Improve the bit-field too wide error message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101384 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDiagnose attempts to throw an abstract class type.
Douglas Gregor [Thu, 15 Apr 2010 18:05:39 +0000 (18:05 +0000)]
Diagnose attempts to throw an abstract class type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101381 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR 6844, a regression caused by the introduction of llvm_unreachable for the...
Ted Kremenek [Thu, 15 Apr 2010 17:33:31 +0000 (17:33 +0000)]
Fix PR 6844, a regression caused by the introduction of llvm_unreachable for 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101378 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSplit adding the primary virtual base offsets out into a separate pass. This fixes...
Anders Carlsson [Thu, 15 Apr 2010 16:12:58 +0000 (16:12 +0000)]
Split adding the primary virtual base offsets out into a separate pass. This fixes a bug where we would lay out virtual bases in the wrong order.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101373 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a few cases where enum constant handling was using
Douglas Gregor [Thu, 15 Apr 2010 15:53:31 +0000 (15:53 +0000)]
Fix a few cases where enum constant handling was using
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101372 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoclang -cc1: Add a -fno-bitfield-type-align option, for my own testing purposes.
Daniel Dunbar [Thu, 15 Apr 2010 15:06:22 +0000 (15:06 +0000)]
clang -cc1: Add a -fno-bitfield-type-align option, for my own testing purposes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101370 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTweak spelling (Bitfield -> BitField)
Daniel Dunbar [Thu, 15 Apr 2010 15:06:18 +0000 (15:06 +0000)]
Tweak spelling (Bitfield -> BitField)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101369 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach -fixit to modify all of its inputs instead of just the main file, unless
Nick Lewycky [Thu, 15 Apr 2010 06:46:58 +0000 (06:46 +0000)]
Teach -fixit to modify all of its inputs instead of just the main file, unless
-fixit-at specified a particular fixit to fix, or the -o flag was used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101359 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoInclude sender address in completion log.
Ted Kremenek [Thu, 15 Apr 2010 06:32:15 +0000 (06:32 +0000)]
Include sender address in completion log.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101358 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTidy up comment.
Daniel Dunbar [Thu, 15 Apr 2010 06:18:42 +0000 (06:18 +0000)]
Tidy up comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101357 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd TargetInfo::useBitfieldTypeAlignment().
Daniel Dunbar [Thu, 15 Apr 2010 06:18:39 +0000 (06:18 +0000)]
Add TargetInfo::useBitfieldTypeAlignment().
 - 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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101356 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver/Frontend: Add support for -mllvm, which forwards options to the LLVM option...
Daniel Dunbar [Thu, 15 Apr 2010 06:09:03 +0000 (06:09 +0000)]
Driver/Frontend: Add support for -mllvm, which forwards options to the LLVM 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101354 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIRgen: Change CGBitFieldInfo to take the AccessInfo as constructor arguments, it...
Daniel Dunbar [Thu, 15 Apr 2010 05:09:32 +0000 (05:09 +0000)]
IRgen: Change CGBitFieldInfo to take the AccessInfo as constructor arguments, it is now an immutable object.

Also, add some checking of various invariants that should hold on the CGBitFieldInfo access.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101345 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIRgen: Eliminate now unused fields from CGBitFieldInfo.
Daniel Dunbar [Thu, 15 Apr 2010 05:09:28 +0000 (05:09 +0000)]
IRgen: Eliminate now unused fields from CGBitFieldInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101344 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIRgen: (Reapply 101222, with fixes) Move EmitStoreThroughBitfieldLValue to use new...
Daniel Dunbar [Thu, 15 Apr 2010 03:47:33 +0000 (03:47 +0000)]
IRgen: (Reapply 101222, with fixes) Move EmitStoreThroughBitfieldLValue to 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101339 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRewrite handling of 64-bit palignr intrinsics to be vector shuffles.
Eric Christopher [Thu, 15 Apr 2010 01:43:08 +0000 (01:43 +0000)]
Rewrite handling of 64-bit palignr intrinsics to be vector shuffles.
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101332 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach ASTVector::append() about the case where 'NumInputs' is 0. This hopefully...
Ted Kremenek [Thu, 15 Apr 2010 01:14:12 +0000 (01:14 +0000)]
Teach ASTVector::append() about the case where 'NumInputs' is 0.  This hopefully fixes
a crash in InitListExpr's ctor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101328 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd simple python server for recording code completion timings.
Ted Kremenek [Thu, 15 Apr 2010 01:02:31 +0000 (01:02 +0000)]
Add simple python server for recording code completion timings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101327 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd optional timing logging for code completion results. This causes a UDP packet
Ted Kremenek [Thu, 15 Apr 2010 01:02:28 +0000 (01:02 +0000)]
Add optional timing logging for code completion results.  This causes a UDP packet
containing the time taken for the code completion to be sent to a designated server
(which is specified using a compile-time -D flag).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101326 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWarn about non-aggregate classes with no user-declared constructors
Douglas Gregor [Thu, 15 Apr 2010 00:00:53 +0000 (00:00 +0000)]
Warn about non-aggregate classes with no user-declared constructors
that have reference or const scalar members, since those members can
never be initializer or modified. Fixes <rdar://problem/7804350>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101316 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAlways diagnose and complain about problems in
Douglas Gregor [Wed, 14 Apr 2010 23:11:21 +0000 (23:11 +0000)]
Always diagnose and complain about problems in
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>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101312 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix 80-cols violtaions
Sean Hunt [Wed, 14 Apr 2010 23:07:37 +0000 (23:07 +0000)]
Fix 80-cols violtaions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101311 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoOnce we've emitted a fatal diagnostic, keep counting errors but with a
Douglas Gregor [Wed, 14 Apr 2010 22:19:45 +0000 (22:19 +0000)]
Once we've emitted a fatal diagnostic, keep counting errors but with a
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>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101297 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake CXLanguage_Invalid the first enum value (with '0' as its value) in CXLanguageKind.
Ted Kremenek [Wed, 14 Apr 2010 20:58:32 +0000 (20:58 +0000)]
Make CXLanguage_Invalid the first enum value (with '0' as its value) in CXLanguageKind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101287 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a -pedantic spurious warning involving @dynamic.
Fariborz Jahanian [Wed, 14 Apr 2010 20:52:42 +0000 (20:52 +0000)]
Fix a -pedantic spurious warning involving @dynamic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101284 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoimprove altivec c++ support by adding casts, patch by
Chris Lattner [Wed, 14 Apr 2010 20:35:39 +0000 (20:35 +0000)]
improve altivec c++ support by adding casts, patch by
Anton Yartsev!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101281 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoThread a Scope pointer into BuildRecoveryCallExpr to help typo
Douglas Gregor [Wed, 14 Apr 2010 20:27:54 +0000 (20:27 +0000)]
Thread a Scope pointer into BuildRecoveryCallExpr to help typo
correction find names when a call failed. Fixes
<rdar://problem/7853795>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101278 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach typo correction about various language keywords. We can't
Douglas Gregor [Wed, 14 Apr 2010 20:04:41 +0000 (20:04 +0000)]
Teach typo correction about various language keywords. We can't
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101274 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReturn the corrected DeclarationName from Sema::CorrectTypo rather
Douglas Gregor [Wed, 14 Apr 2010 17:09:22 +0000 (17:09 +0000)]
Return the corrected DeclarationName from Sema::CorrectTypo rather
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101259 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIRgen/NeXT: Simplify to use AST record layout for getting offsets instead of the
Daniel Dunbar [Wed, 14 Apr 2010 17:02:21 +0000 (17:02 +0000)]
IRgen/NeXT: Simplify to use AST record layout for getting offsets instead of the
IRgen record layout, which this code doesn't need to depend on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101257 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen diagnosing suspicious precedence or assignments, move the fix-it
Douglas Gregor [Wed, 14 Apr 2010 16:09:52 +0000 (16:09 +0000)]
When diagnosing suspicious precedence or assignments, move the fix-it
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) {
        ^
          (     )

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101249 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove GRStmtNodeBuilder::MakeNode() out of line. No functionality change.
Zhongxing Xu [Wed, 14 Apr 2010 06:35:09 +0000 (06:35 +0000)]
Move GRStmtNodeBuilder::MakeNode() out of line. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101239 91177308-0d34-0410-b5e6-96231b3b80d8