]> granicus.if.org Git - clang/log
clang
14 years agoDriver: Fix a possible use after free.
Daniel Dunbar [Sun, 18 Jul 2010 21:16:15 +0000 (21:16 +0000)]
Driver: Fix a possible use after free.

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

14 years agoFix a goof in my previous patch -- not all of the builtins return a value, some
Chandler Carruth [Sun, 18 Jul 2010 20:54:12 +0000 (20:54 +0000)]
Fix a goof in my previous patch -- not all of the builtins return a value, some
fixed return types.

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

14 years agoFix mangling for static member variables of classes inside an extern "C"
Eli Friedman [Sun, 18 Jul 2010 20:49:59 +0000 (20:49 +0000)]
Fix mangling for static member variables of classes inside an extern "C"
linkage specification.  Not sure if this is the ideal fix, but I'm reasonably
sure it's correct vs. gcc.

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

14 years agodaniel doesn't hate me, he hates macpython 2.5, which
Chris Lattner [Sun, 18 Jul 2010 18:42:35 +0000 (18:42 +0000)]
daniel doesn't hate me, he hates macpython 2.5, which
is a very reasonable position on life!

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

14 years agoWhen instantiating function definitions set parameter names to those used in template
Peter Collingbourne [Sun, 18 Jul 2010 16:45:46 +0000 (16:45 +0000)]
When instantiating function definitions set parameter names to those used in template

The rationale is that we are copying the entire definition including
parameter names which may differ between the declaration and the
definition.

This is particularly important if any parameters are unnamed in the
declaration, as a DeclRef to an unnamed ParmVarDecl would cause the
pretty printer to produce invalid output.

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

14 years agoRevert -Wdiscard-qual typo
Douglas Gregor [Sun, 18 Jul 2010 11:27:38 +0000 (11:27 +0000)]
Revert -Wdiscard-qual typo

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

14 years agoImprove the representation of the atomic builtins in a few ways. First, we make
Chandler Carruth [Sun, 18 Jul 2010 07:23:17 +0000 (07:23 +0000)]
Improve the representation of the atomic builtins in a few ways. First, we make
their call expressions synthetically have the "deduced" types based on their
first argument. We only insert conversions in the AST for arguments whose
values require conversion to match the value type expected. This keeps PR7600
closed by maintaining the return type, but avoids assertions due to unexpected
implicit casts making the type unsigned (test case added from Daniel).

The magic is moved into the codegen for the atomic builtin which inserts the
casts as needed at the IR level to raise the type to an integer suitable for
the LLVM intrinsic. This shouldn't cause any real change in functionality, but
now we can make the builtin be more truly polymorphic.

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

14 years agoBUILD_ARCHIVE is the default for libraries, no need to set it.
Chris Lattner [Sun, 18 Jul 2010 00:14:47 +0000 (00:14 +0000)]
BUILD_ARCHIVE is the default for libraries, no need to set it.

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

14 years agoFix crash initializing a bit-field with a non-constant in a place where we
Eli Friedman [Sat, 17 Jul 2010 23:55:01 +0000 (23:55 +0000)]
Fix crash initializing a bit-field with a non-constant in a place where we
try to evaluate the initializer as a constant.

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

14 years agoCheck for casts to an incomplete type in C. Improves diagnostics for cast to
Eli Friedman [Sat, 17 Jul 2010 20:43:49 +0000 (20:43 +0000)]
Check for casts to an incomplete type in C.  Improves diagnostics for cast to
incomplete union (PR5692) and incomplete enum, and fixes obscure
accepts-invalid on cast to incomplete struct.

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

14 years agoAdded PCH/ASTImporter code for ObjCIvarDecl's field.
Fariborz Jahanian [Sat, 17 Jul 2010 18:35:47 +0000 (18:35 +0000)]
Added PCH/ASTImporter code for ObjCIvarDecl's field.

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

14 years agoAdd another terrible VC++ compatibility hack: allow users to
Chris Lattner [Sat, 17 Jul 2010 16:24:30 +0000 (16:24 +0000)]
Add another terrible VC++ compatibility hack: allow users to
allow invalid token pastes (when in -fms-extensions mode)
with -Wno-invalid-token-paste

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

14 years agorename test
Chris Lattner [Sat, 17 Jul 2010 16:18:46 +0000 (16:18 +0000)]
rename test

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

14 years agorename test
Chris Lattner [Sat, 17 Jul 2010 16:17:41 +0000 (16:17 +0000)]
rename test

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

14 years agoRevert r108617, it broke the build.
Benjamin Kramer [Sat, 17 Jul 2010 13:51:58 +0000 (13:51 +0000)]
Revert r108617, it broke the build.

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

14 years agoFix cmake build.
Zhongxing Xu [Sat, 17 Jul 2010 11:59:16 +0000 (11:59 +0000)]
Fix cmake build.

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

14 years agoPrepare the analyzer for the callee in another translation unit:
Zhongxing Xu [Sat, 17 Jul 2010 11:12:42 +0000 (11:12 +0000)]
Prepare the analyzer for the callee in another translation unit:
  Let AnalysisContext contain a TranslationUnit.
  Let CallEnter refer to an AnalysisContext instead of a FunctionDecl.

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

14 years agoclang -cc1as: Switch to using AsmParser constructor function.
Daniel Dunbar [Sat, 17 Jul 2010 02:26:21 +0000 (02:26 +0000)]
clang -cc1as: Switch to using AsmParser constructor function.

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

14 years agoFix '<rdar://problem/8202272> __imag passed non-complex should not crash' by removing...
Ted Kremenek [Sat, 17 Jul 2010 01:28:55 +0000 (01:28 +0000)]
Fix '<rdar://problem/8202272> __imag passed non-complex should not crash' by removing a bogus assertion.

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

14 years agoAnother test case for on demand synthesis of ivars.
Fariborz Jahanian [Sat, 17 Jul 2010 01:16:59 +0000 (01:16 +0000)]
Another test case for on demand synthesis of ivars.

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

14 years agoPatch to synthesize property ivars on demand as
Fariborz Jahanian [Sat, 17 Jul 2010 00:59:30 +0000 (00:59 +0000)]
Patch to synthesize property ivars on demand as
part of the new property synthesis by default.
wip.

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

14 years agoThe GNU-runtime ObjC personality function doesn't let us rethrow with URR for
John McCall [Sat, 17 Jul 2010 00:43:08 +0000 (00:43 +0000)]
The GNU-runtime ObjC personality function doesn't let us rethrow with URR for
multiple reasons.  Rethrow with _objc_exception_throw instead.  Fixes PR7656.

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

14 years agoFix APFloat assertion failure in IdempotentOperationChecker resulting in having
Ted Kremenek [Sat, 17 Jul 2010 00:40:32 +0000 (00:40 +0000)]
Fix APFloat assertion failure in IdempotentOperationChecker resulting in having
an APFloat with different "float semantics" than the compared float literal.

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

14 years agoTeach the PCH reader to load the dependency when encountering a chain metadata record...
Sebastian Redl [Sat, 17 Jul 2010 00:12:06 +0000 (00:12 +0000)]
Teach the PCH reader to load the dependency when encountering a chain metadata record. WIP

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

14 years agoWhen checking whether to bind an expression to a temporary, don't bind Obj-C message...
Anders Carlsson [Fri, 16 Jul 2010 21:18:37 +0000 (21:18 +0000)]
When checking whether to bind an expression to a temporary, don't bind Obj-C message send expressions who call methods that return references.

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

14 years agoFix typeid the same way I fixed sizeof. Sad I had missed it before.
Craig Silverstein [Fri, 16 Jul 2010 21:15:34 +0000 (21:15 +0000)]
Fix typeid the same way I fixed sizeof.  Sad I had missed it before.

Reviewed by chandlerc

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

14 years agoRemove unicode quotes characters that somehow made it into a recent commit of mine.
Ted Kremenek [Fri, 16 Jul 2010 20:49:01 +0000 (20:49 +0000)]
Remove unicode quotes characters that somehow made it into a recent commit of mine.

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

14 years agoSeparate out the initial loading of a PCH so that loading chained PCHs can reuse it.
Sebastian Redl [Fri, 16 Jul 2010 20:41:52 +0000 (20:41 +0000)]
Separate out the initial loading of a PCH so that loading chained PCHs can reuse it.

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

14 years agoImproved false positive rate for the idempotent operations checker and moved it into...
Tom Care [Fri, 16 Jul 2010 20:41:41 +0000 (20:41 +0000)]
Improved false positive rate for the idempotent operations checker and moved it into the default path-sensitive analysis options.
- Added checks for static local variables, self assigned parameters, and truncating/extending self assignments
- Removed command line option (now default with --analyze)
- Updated test cases to pass with idempotent operation warnings

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

14 years agoGive the 'self/array-comparison is always true/false' warning a new flag,
Nick Lewycky [Fri, 16 Jul 2010 18:42:10 +0000 (18:42 +0000)]
Give the 'self/array-comparison is always true/false' warning a new flag,
"-Wtautological-compare".

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

14 years agoHook up warning for an incomplete scanlist in scanf format strings.
Ted Kremenek [Fri, 16 Jul 2010 18:28:03 +0000 (18:28 +0000)]
Hook up warning for an incomplete scanlist in scanf format strings.

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

14 years agoTweak zero-field width in scanf format string diagnostic.
Ted Kremenek [Fri, 16 Jul 2010 18:27:56 +0000 (18:27 +0000)]
Tweak zero-field width in scanf format string diagnostic.

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

14 years agoFirst baby steps towards PCHReader being able to keep track of multiple PCH files...
Sebastian Redl [Fri, 16 Jul 2010 17:50:48 +0000 (17:50 +0000)]
First baby steps towards PCHReader being able to keep track of multiple PCH files. WIP

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

14 years agoMake this destructor virtual to placate GCC's warnings.
Chandler Carruth [Fri, 16 Jul 2010 17:27:32 +0000 (17:27 +0000)]
Make this destructor virtual to placate GCC's warnings.

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

14 years agoFix up some of the visiting for array types -- we weren't good about
Craig Silverstein [Fri, 16 Jul 2010 17:06:12 +0000 (17:06 +0000)]
Fix up some of the visiting for array types -- we weren't good about
getting array indices before -- and for some of the builtin operators:
sizeof, offsetof, unaryops like __is_enum.

Also fix the function visitor to visit exception types in function
parameters.

Reviewed by wan and chandlerc.

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

14 years agoInitialize a couple of fields inherited for our private use.
John McCall [Fri, 16 Jul 2010 17:02:45 +0000 (17:02 +0000)]
Initialize a couple of fields inherited for our private use.

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

14 years agoWhen performing template name lookup for a dependent member access
Douglas Gregor [Fri, 16 Jul 2010 16:54:17 +0000 (16:54 +0000)]
When performing template name lookup for a dependent member access
expression such as the "foo" in "this->blah.foo<1, 2>", and we can't
look into the type of "this->blah" (e.g., because it is dependent),
look into the local scope of a template of the same name. Fixes
<rdar://problem/8198511>.

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

14 years agoAdd a little more data to chained PCHs. WIP
Sebastian Redl [Fri, 16 Jul 2010 16:36:56 +0000 (16:36 +0000)]
Add a little more data to chained PCHs. WIP

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

14 years agoRevert Microsoft-specific override of the "typedef requires a name"
Douglas Gregor [Fri, 16 Jul 2010 15:40:40 +0000 (15:40 +0000)]
Revert Microsoft-specific override of the "typedef requires a name"
diagnostic. Instead, put it and the "declaration does not declare
anything" warning into -Wmissing-declarations.

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

14 years agoSuppress the "typedef requires a name" warning in Microsoft-extensions mode
Douglas Gregor [Fri, 16 Jul 2010 15:18:19 +0000 (15:18 +0000)]
Suppress the "typedef requires a name" warning in Microsoft-extensions mode

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

14 years agoTreat template parameters as part of the declaration-specifiers for the
John McCall [Fri, 16 Jul 2010 08:13:16 +0000 (08:13 +0000)]
Treat template parameters as part of the declaration-specifiers for the
purpose of access control.  Fixes PR7644.

I can't actually find anything directly justifying this, but it seems obvious.

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

14 years agoMake this grossness default to the error it should always be.
Chandler Carruth [Fri, 16 Jul 2010 05:46:45 +0000 (05:46 +0000)]
Make this grossness default to the error it should always be.

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

14 years agoSema: Fix a bug with #pragma options align=reset, reset against an empty stack
Daniel Dunbar [Fri, 16 Jul 2010 04:54:16 +0000 (04:54 +0000)]
Sema: Fix a bug with #pragma options align=reset, reset against an empty stack
is well defined, it resets to the default alignment.

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

14 years agoButcher a perfectly reasonable diagnostic to pacify old versions of SWIG.
Chandler Carruth [Fri, 16 Jul 2010 04:32:28 +0000 (04:32 +0000)]
Butcher a perfectly reasonable diagnostic to pacify old versions of SWIG.

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

14 years agoAdd initial test cases for scanf format string checking.
Ted Kremenek [Fri, 16 Jul 2010 02:11:34 +0000 (02:11 +0000)]
Add initial test cases for scanf format string checking.

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

14 years agoAdd the main scanf-parsing logic that I meant to include in my previous commit.
Ted Kremenek [Fri, 16 Jul 2010 02:11:31 +0000 (02:11 +0000)]
Add the main scanf-parsing logic that I meant to include in my previous commit.

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

14 years agoAdd missing header file.
Ted Kremenek [Fri, 16 Jul 2010 02:11:26 +0000 (02:11 +0000)]
Add missing header file.

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

14 years agoAdd most of the boilerplate support for scanf format string checking. This includes
Ted Kremenek [Fri, 16 Jul 2010 02:11:22 +0000 (02:11 +0000)]
Add most of the boilerplate support for scanf format string checking.  This includes
handling the parsing of scanf format strings and hooking the checking into Sema.
Most of this checking logic piggybacks on what was already there for checking printf format
strings, but the checking logic has been refactored to support both.

What is left to be done is to support argument type checking in format strings and of course
fix the usual tail of bugs that will follow.

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

14 years agoAdd builtin definition for scanf, including extending the builtin encoding to
Ted Kremenek [Fri, 16 Jul 2010 02:11:15 +0000 (02:11 +0000)]
Add builtin definition for scanf, including extending the builtin encoding to
represent builtins that have the "scanf" attribution (via the format attribute) just
like we do with printf functions.  Follow-up work is needed to add similar support
for fscanf et al.

This is to support format-string checking for scanf functions.

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

14 years agoFix for PR3800: make sure not to evaluate the expression for a read-write
Eli Friedman [Fri, 16 Jul 2010 00:55:21 +0000 (00:55 +0000)]
Fix for PR3800: make sure not to evaluate the expression for a read-write
asm operand twice.

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

14 years agoBuiltins/ARM: __clear_cache doesn't seem to have a consistent prototype, declare
Daniel Dunbar [Fri, 16 Jul 2010 00:31:23 +0000 (00:31 +0000)]
Builtins/ARM: __clear_cache doesn't seem to have a consistent prototype, declare
the builtin as void __clear_cache(...) to workaround this, which appears to
match what GCC does.

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

14 years agoIRgen: Support user defined attributes on block runtime functions.
Daniel Dunbar [Fri, 16 Jul 2010 00:00:19 +0000 (00:00 +0000)]
IRgen: Support user defined attributes on block runtime functions.
 - This issue here is that /usr/include/Blocks.h wants to define some of the
   block runtime globals as weak, depending on the target. This doesn't work in
   Clang because we aren't using the AST decl for these globals.

 - The fix is a pretty gross hack which just watches all the decls for the
   specific blocks globals we need to know about; if we see one we use it,
   otherwise we use the hand coded type.

   In time, I would like to clean this up by changing IRgen to ask Sema/AST for
   the decl, which would then be lazily loaded from the builtin table if
   necessary. This could be used in a whole host of places in IRgen and would
   get rid of a lot of grotty hand coding of LLVM IR; however, we need some
   extra Sema support for this as well as support for builtin global variables.

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

14 years agoIRgen: Move blocks runtime interfaces to CodeGenModule.
Daniel Dunbar [Fri, 16 Jul 2010 00:00:15 +0000 (00:00 +0000)]
IRgen: Move blocks runtime interfaces to CodeGenModule.

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

14 years agoSuppress !+Asserts warning.
Daniel Dunbar [Fri, 16 Jul 2010 00:00:11 +0000 (00:00 +0000)]
Suppress !+Asserts warning.

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

14 years agoWhen deferring the emission of declarations with initializers in C++, remember
John McCall [Thu, 15 Jul 2010 23:40:35 +0000 (23:40 +0000)]
When deferring the emission of declarations with initializers in C++, remember
the order they appeared in the translation unit.  If they get emitted, put them
in their proper order.  Fixes rdar://problem/7458115

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

14 years agoSet "optimization is ON" and supply other optional parameters. This helps codegenerat...
Devang Patel [Thu, 15 Jul 2010 23:09:46 +0000 (23:09 +0000)]
Set "optimization is ON" and supply other optional parameters. This helps codegenerator preserve info in case the symbol is deleted.

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

14 years agoImprove test case. Thanks Eli
Douglas Gregor [Thu, 15 Jul 2010 23:04:05 +0000 (23:04 +0000)]
Improve test case. Thanks Eli

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

14 years agoDon't suppress the emission of available_externally functions marked
Douglas Gregor [Thu, 15 Jul 2010 22:58:18 +0000 (22:58 +0000)]
Don't suppress the emission of available_externally functions marked
with always_inline attribute. Thanks to Howard for the tip.

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

14 years agoMark implementation generated methods as artificial.
Devang Patel [Thu, 15 Jul 2010 22:57:00 +0000 (22:57 +0000)]
Mark implementation generated methods as artificial.
Tested by namespace.exp and virtfunc.exp from gdb testsuite.

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

14 years agoAfter some discussion, the ABI list settled on a much more sensible mangling
John McCall [Thu, 15 Jul 2010 21:53:03 +0000 (21:53 +0000)]
After some discussion, the ABI list settled on a much more sensible mangling
for string literals.

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

14 years agoWhen we're performing tentative parsing to determine whether the
Douglas Gregor [Thu, 15 Jul 2010 21:05:01 +0000 (21:05 +0000)]
When we're performing tentative parsing to determine whether the
parser is looking at a declaration or an expression, use a '=' to
conclude that we are parsing a declaration.

This is wrong. However, our previous approach of finding a comma after
the '=' is also wrong, because the ',' could be part of a
template-argument-list. So, for now we're going to use the same wrong
heuristic as GCC and Visual C++, because less real-world code is
likely to be broken this way. I've opened PR7655 to keep track of our
wrongness; note also the XFAIL'd test.

Fixes <rdar://problem/8193163>.

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

14 years agobuild/Darwin: Add missing Info.plist template.
Daniel Dunbar [Thu, 15 Jul 2010 20:26:56 +0000 (20:26 +0000)]
build/Darwin: Add missing Info.plist template.

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

14 years agobuild/Darwin: Enable version information for clang executable.
Daniel Dunbar [Thu, 15 Jul 2010 19:33:44 +0000 (19:33 +0000)]
build/Darwin: Enable version information for clang executable.

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

14 years agoReinstate the scalar-cast-to-const-reference improvements, this time
Douglas Gregor [Thu, 15 Jul 2010 18:58:16 +0000 (18:58 +0000)]
Reinstate the scalar-cast-to-const-reference improvements, this time
with the proper spelling of "non-class prvalue". Silly me, I think
class rvalues were xvalues rather than prvalues!

Hah hah hah.

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

14 years agoMake the "unused result" warning a warning about run-time behavior, so
Douglas Gregor [Thu, 15 Jul 2010 18:47:04 +0000 (18:47 +0000)]
Make the "unused result" warning a warning about run-time behavior, so
that we don't warn when there isn't going to be any computation anyway.

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

14 years agoRevert r108431 and r108433 (the cast-to-const-reference fixes), which
Douglas Gregor [Thu, 15 Jul 2010 18:41:54 +0000 (18:41 +0000)]
Revert r108431 and r108433 (the cast-to-const-reference fixes), which
broke nightlytest.

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

14 years agoAdd test case for PR5290; this bug was fixed with the non-class rvalue
Douglas Gregor [Thu, 15 Jul 2010 18:35:15 +0000 (18:35 +0000)]
Add test case for PR5290; this bug was fixed with the non-class rvalue
de-cv-qualification fixes.

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

14 years agoRevert 108220 and subsequent patch.
Devang Patel [Thu, 15 Jul 2010 18:16:09 +0000 (18:16 +0000)]
Revert 108220 and subsequent patch.
This is not required (I am not 100% sure why) but method.exp from gdb testsuite flagged regression due to this patch.

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

14 years agoSpell isPRValue() properly.
Douglas Gregor [Thu, 15 Jul 2010 18:12:28 +0000 (18:12 +0000)]
Spell isPRValue() properly.

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

14 years agoTeach CodeGenFunction::EmitCastLValue() to handle casts to an lvalue
Douglas Gregor [Thu, 15 Jul 2010 18:04:13 +0000 (18:04 +0000)]
Teach CodeGenFunction::EmitCastLValue() to handle casts to an lvalue
that involve binding a reference to a pure rvalue temporary (e.g., not
a class temporary), by creating a new temporary and copying the result
there. Fixes PR6024.

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

14 years agoCK_BitCast is not an lvalue bitcast any longer
Douglas Gregor [Thu, 15 Jul 2010 16:39:55 +0000 (16:39 +0000)]
CK_BitCast is not an lvalue bitcast any longer

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

14 years agoDriver/Darwin: Resolve deployment target defaulting to be more predictable;
Daniel Dunbar [Thu, 15 Jul 2010 16:18:06 +0000 (16:18 +0000)]
Driver/Darwin: Resolve deployment target defaulting to be more predictable;
assume we are targetting OS X unless an explicit option is given.

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

14 years agoDriver/Darwin: Allow -m{ios,macosx}-version-min= to be passed with -Xarch.
Daniel Dunbar [Thu, 15 Jul 2010 15:26:14 +0000 (15:26 +0000)]
Driver/Darwin: Allow -m{ios,macosx}-version-min= to be passed with -Xarch.
 - This should be safe, because the driver itself shouldn't need to make
   decisions that depend on the deployment target.

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

14 years agoCodeGen: Tweak ABI handling for Minix, patch by Kees van Reeuwijk!
Daniel Dunbar [Thu, 15 Jul 2010 15:02:28 +0000 (15:02 +0000)]
CodeGen: Tweak ABI handling for Minix, patch by Kees van Reeuwijk!

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

14 years agosee comment.
Chris Lattner [Thu, 15 Jul 2010 05:22:46 +0000 (05:22 +0000)]
see comment.

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

14 years agoDriver: Support 'clang -x ir ...'.
Daniel Dunbar [Thu, 15 Jul 2010 00:49:21 +0000 (00:49 +0000)]
Driver: Support 'clang -x ir ...'.

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

14 years agorestrict the && -> & warning to cover a case daniel noted.
Chris Lattner [Thu, 15 Jul 2010 00:26:43 +0000 (00:26 +0000)]
restrict the && -> & warning to cover a case daniel noted.
Don't warn about "logically bool" expressions on the RHS,
even if they fold to a constant.

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

14 years agoAdd a callback interface that allows interested parties to get notified whenever...
Sebastian Redl [Wed, 14 Jul 2010 23:45:08 +0000 (23:45 +0000)]
Add a callback interface that allows interested parties to get notified whenever PCHReader deserializes a type or decl (and possibly other things in the future). Have PCHWriter implement these callbacks as noops and register to receive them if we're chaining PCHs. This will allow PCHWriter to track the IDs of these things, which it needs to write the dependent files. WIP

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

14 years agoCodeGen/ObjC/NeXT: Fix Obj-C message send to match llvm-gcc when choosing
Daniel Dunbar [Wed, 14 Jul 2010 23:39:36 +0000 (23:39 +0000)]
CodeGen/ObjC/NeXT: Fix Obj-C message send to match llvm-gcc when choosing
whether to use objc_msgSend_fpret; the choice is target dependent, not Obj-C ABI
dependent.
 - <rdar://problem/8139758> arm objc _objc_msgSend_fpret bug

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

14 years agoThere is another implementation of PCHReaderListener around. Update it to the new...
Sebastian Redl [Wed, 14 Jul 2010 23:29:55 +0000 (23:29 +0000)]
There is another implementation of PCHReaderListener around. Update it to the new interface.

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

14 years agoWhen determining whether an overload set with explicit template
Douglas Gregor [Wed, 14 Jul 2010 23:20:53 +0000 (23:20 +0000)]
When determining whether an overload set with explicit template
arguments only resolves to a single specialization, make sure to look
through using declarations. Fixes PR7641.

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

14 years agoPass StringRefs by value.
Benjamin Kramer [Wed, 14 Jul 2010 23:19:41 +0000 (23:19 +0000)]
Pass StringRefs by value.

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

14 years agoWhen there are extra or missing template parameter lists in a template
Douglas Gregor [Wed, 14 Jul 2010 23:14:12 +0000 (23:14 +0000)]
When there are extra or missing template parameter lists in a template
definition, we're likely going to end up breaking the invariants of
the template system, e.g., that the depths of template parameter lists
match up with the nesting template of the template. So, make sure we
mark such ill-formed declarations as invalid or don't even build them
at all.

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

14 years agoAdd lvalue-bitcast support for complex numbers.
Douglas Gregor [Wed, 14 Jul 2010 21:35:45 +0000 (21:35 +0000)]
Add lvalue-bitcast support for complex numbers.

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

14 years agoIncrease the max PCH level for declarations to 7. Add a FromPCH flag to types.
Sebastian Redl [Wed, 14 Jul 2010 20:26:45 +0000 (20:26 +0000)]
Increase the max PCH level for declarations to 7. Add a FromPCH flag to types.

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

14 years agoDriver: When re'execing clang, use path to the main executable instead of
Daniel Dunbar [Wed, 14 Jul 2010 18:46:27 +0000 (18:46 +0000)]
Driver: When re'execing clang, use path to the main executable instead of
looking up Clang in the normal search paths (which may end up finding the wrong
clang).

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

14 years agoDriver: Remove some unused arguments.
Daniel Dunbar [Wed, 14 Jul 2010 18:46:23 +0000 (18:46 +0000)]
Driver: Remove some unused arguments.

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

14 years agoDon't error when doing default property synthesis
Fariborz Jahanian [Wed, 14 Jul 2010 18:11:52 +0000 (18:11 +0000)]
Don't error when doing default property synthesis
and some are already synthesized by user declaration.

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

14 years agoMake PCHReader cope with PCH files containing more than one predefines buffer.
Sebastian Redl [Wed, 14 Jul 2010 17:49:11 +0000 (17:49 +0000)]
Make PCHReader cope with PCH files containing more than one predefines buffer.

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

14 years agoOnly filter out names reserved for the implementation (e.g., __blah or
Douglas Gregor [Wed, 14 Jul 2010 17:44:04 +0000 (17:44 +0000)]
Only filter out names reserved for the implementation (e.g., __blah or
_Foo) from code-completion results when they come from a system
header.

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

14 years agoConsider obective-c pointer arguments as valid sentinel args
Fariborz Jahanian [Wed, 14 Jul 2010 16:37:51 +0000 (16:37 +0000)]
Consider obective-c pointer arguments as valid sentinel args
as well. Fixes radar 7975788.

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

14 years agoFix the mangling of template template arguments, which do not always
John McCall [Wed, 14 Jul 2010 06:43:17 +0000 (06:43 +0000)]
Fix the mangling of template template arguments, which do not always
follow <name>;  instead they follow <type>, which has <name> as a subset.

Fixes PR7446.

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

14 years agoWire up '-Wignored-qualifiers' to the warning on 'const' in 'const int f()'.
Chandler Carruth [Wed, 14 Jul 2010 06:36:18 +0000 (06:36 +0000)]
Wire up '-Wignored-qualifiers' to the warning on 'const' in 'const int f()'.
This flag and warning match GCC semantics. Also, move it to -Wextra as this is
a largely cosmetic issue and doesn't seem to mask problems. Subsequent fixes to
the tests which no longer by default emit the warning. Added explicit test
cases for both C and C++ behavior with the warning turned on.

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

14 years agoAdd test case that was causing an infinite loop when reading PCH files. The test...
Douglas Gregor [Wed, 14 Jul 2010 04:45:33 +0000 (04:45 +0000)]
Add test case that was causing an infinite loop when reading PCH files. The test works with ToT Clang already

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

14 years agoRemove a few mangling FIXMEs:
John McCall [Wed, 14 Jul 2010 04:38:21 +0000 (04:38 +0000)]
Remove a few mangling FIXMEs:
 - TSTs whose template is a template template parameter already work
 - we don't provide an imaginary type, so we can't mangle one
 - we don't need a generic FIXME for vendor type qualifiers

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

14 years agoImplement the standard mangling for array-subscript expressions, and implement
John McCall [Wed, 14 Jul 2010 04:20:34 +0000 (04:20 +0000)]
Implement the standard mangling for array-subscript expressions, and implement
the current proposals from David Vandervoorde for new, delete, throw, typeid,
imaginary literals, string literals, and null literals.

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

14 years agoFix typo in test program
Douglas Gregor [Wed, 14 Jul 2010 00:09:17 +0000 (00:09 +0000)]
Fix typo in test program

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

14 years agoDriver/Darwin: Pass -pie/-no_pie to the linker when -fpie/-fno-pie and friends
Daniel Dunbar [Tue, 13 Jul 2010 23:31:40 +0000 (23:31 +0000)]
Driver/Darwin: Pass -pie/-no_pie to the linker when -fpie/-fno-pie and friends
are explicitly given.

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

14 years agoAdd missing testcases for lvalue bitcasts
Douglas Gregor [Tue, 13 Jul 2010 23:27:15 +0000 (23:27 +0000)]
Add missing testcases for lvalue bitcasts

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

14 years agoWork around an obnoxious GCC warning by changing semantics in a hopefully-
John McCall [Tue, 13 Jul 2010 23:19:49 +0000 (23:19 +0000)]
Work around an obnoxious GCC warning by changing semantics in a hopefully-
harmless way.

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