]> granicus.if.org Git - clang/log
clang
14 years agoThe second check point in the old test case was invalid.
Zhongxing Xu [Wed, 21 Apr 2010 02:22:25 +0000 (02:22 +0000)]
The second check point in the old test case was invalid.

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

14 years agoUse const_cast instead of a C cast. Safer, plus it suppresses a gcc warning.
John McCall [Wed, 21 Apr 2010 02:20:33 +0000 (02:20 +0000)]
Use const_cast instead of a C cast.  Safer, plus it suppresses a gcc warning.

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

14 years agoUse the right predecessor.
Zhongxing Xu [Wed, 21 Apr 2010 02:20:10 +0000 (02:20 +0000)]
Use the right predecessor.

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

14 years agoAdd initial support for C++ delete expr.
Zhongxing Xu [Wed, 21 Apr 2010 02:17:31 +0000 (02:17 +0000)]
Add initial support for C++ delete expr.

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

14 years agoOverhaul the AST representation of Objective-C message send
Douglas Gregor [Wed, 21 Apr 2010 00:45:42 +0000 (00:45 +0000)]
Overhaul the AST representation of Objective-C message send
expressions, to improve source-location information, clarify the
actual receiver of the message, and pave the way for proper C++
support. The ObjCMessageExpr node represents four different kinds of
message sends in a single AST node:

  1) Send to a object instance described by an expression (e.g., [x method:5])
  2) Send to a class described by the class name (e.g., [NSString method:5])
  3) Send to a superclass class (e.g, [super method:5] in class method)
  4) Send to a superclass instance (e.g., [super method:5] in instance method)

Previously these four cases where tangled together. Now, they have
more distinct representations. Specific changes:

  1) Unchanged; the object instance is represented by an Expr*.

  2) Previously stored the ObjCInterfaceDecl* referring to the class
  receiving the message. Now stores a TypeSourceInfo* so that we know
  how the class was spelled. This both maintains typedef information
  and opens the door for more complicated C++ types (e.g., dependent
  types). There was an alternative, unused representation of these
  sends by naming the class via an IdentifierInfo *. In practice, we
  either had an ObjCInterfaceDecl *, from which we would get the
  IdentifierInfo *, or we fell into the case below...

  3) Previously represented by a class message whose IdentifierInfo *
  referred to "super". Sema and CodeGen would use isStr("super") to
  determine if they had a send to super. Now represented as a
  "class super" send, where we have both the location of the "super"
  keyword and the ObjCInterfaceDecl* of the superclass we're
  targetting (statically).

  4) Previously represented by an instance message whose receiver is a
  an ObjCSuperExpr, which Sema and CodeGen would check for via
  isa<ObjCSuperExpr>(). Now represented as an "instance super" send,
  where we have both the location of the "super" keyword and the
  ObjCInterfaceDecl* of the superclass we're targetting
  (statically). Note that ObjCSuperExpr only has one remaining use in
  the AST, which is for "super.prop" references.

The new representation of ObjCMessageExpr is 2 pointers smaller than
the old one, since it combines more storage. It also eliminates a leak
when we loaded message-send expressions from a precompiled header. The
representation also feels much cleaner to me; comments welcome!

This patch attempts to maintain the same semantics we previously had
with Objective-C message sends. In several places, there are massive
changes that boil down to simply replacing a nested-if structure such
as:

  if (message has a receiver expression) {
    // instance message
    if (isa<ObjCSuperExpr>(...)) {
     // send to super
    } else {
     // send to an object
   }
  } else {
    // class message
    if (name->isStr("super")) {
      // class send to super
    } else {
      // send to class
    }
  }

with a switch

  switch (E->getReceiverKind()) {
  case ObjCMessageExpr::SuperInstance: ...
  case ObjCMessageExpr::Instance: ...
  case ObjCMessageExpr::SuperClass: ...
  case ObjCMessageExpr::Class:...
  }

There are quite a few places (particularly in the checkers) where
send-to-super is effectively ignored. I've placed FIXMEs in most of
them, and attempted to address send-to-super in a reasonable way. This
could use some review.

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

14 years agoRemove an unused parameter from isImplicitlyDefined.
Anders Carlsson [Tue, 20 Apr 2010 23:32:58 +0000 (23:32 +0000)]
Remove an unused parameter from isImplicitlyDefined.

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

14 years agoFix comment to reflect recent code change.
John Thompson [Tue, 20 Apr 2010 23:21:17 +0000 (23:21 +0000)]
Fix comment to reflect recent code change.

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

14 years agoFix USRs for 'extern' variables declaration in functions/method bodies.
Ted Kremenek [Tue, 20 Apr 2010 23:15:40 +0000 (23:15 +0000)]
Fix USRs for 'extern' variables declaration in functions/method bodies.
Fix USRs for @synthesize.
Add more USR tests.

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

14 years agoSpecify linkage for Objective-C declarations.
Ted Kremenek [Tue, 20 Apr 2010 23:15:35 +0000 (23:15 +0000)]
Specify linkage for Objective-C declarations.

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

14 years agoFactor some common code out into a separate function.
Anders Carlsson [Tue, 20 Apr 2010 23:11:20 +0000 (23:11 +0000)]
Factor some common code out into a separate function.

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

14 years agoFixes a code gen. bug by removing an assert.
Fariborz Jahanian [Tue, 20 Apr 2010 22:02:31 +0000 (22:02 +0000)]
Fixes a code gen. bug by removing an assert.
It is ok to have c++-ness inside extern "C"
block. Fixes pr6644.

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

14 years agofix the ?: fixit that ted added to recover properly.
Chris Lattner [Tue, 20 Apr 2010 21:33:39 +0000 (21:33 +0000)]
fix the ?: fixit that ted added to recover properly.

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

14 years agoFix crash on invalid code where a @throw statement is not followed by a ';'
Ted Kremenek [Tue, 20 Apr 2010 21:21:51 +0000 (21:21 +0000)]
Fix crash on invalid code where a @throw statement is not followed by a ';'

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

14 years agochange FullSourceLoc to have a *const* SourceManager&, eliminating
Chris Lattner [Tue, 20 Apr 2010 20:49:23 +0000 (20:49 +0000)]
change FullSourceLoc to have a *const* SourceManager&, eliminating
a const_cast.

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

14 years agopush some source location information down through the compiler,
Chris Lattner [Tue, 20 Apr 2010 20:35:58 +0000 (20:35 +0000)]
push some source location information down through the compiler,
into ContentCache::getBuffer.  This allows it to produce
diagnostics on the broken #include line instead of without a
location.

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

14 years agoPatch to support transparent_union types on
Fariborz Jahanian [Tue, 20 Apr 2010 20:28:15 +0000 (20:28 +0000)]
Patch to support transparent_union types on
objective-c methods. Fixes radar 7875968.

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

14 years agoenhance sourcemgr to detect various UTF BOM's and emit a fatal error
Chris Lattner [Tue, 20 Apr 2010 18:14:03 +0000 (18:14 +0000)]
enhance sourcemgr to detect various UTF BOM's and emit a fatal error
about it instead of producing tons of garbage from the lexer.

It would be even better for sourcemgr to dynamically transcode (e.g.
from UTF16 -> UTF8).

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

14 years agoBack out r101911 and see if it makes the bots happy.
Anders Carlsson [Tue, 20 Apr 2010 18:05:10 +0000 (18:05 +0000)]
Back out r101911 and see if it makes the bots happy.

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

14 years agoRemove dead code.
Benjamin Kramer [Tue, 20 Apr 2010 18:01:57 +0000 (18:01 +0000)]
Remove dead code.

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

14 years agoIRgen: Always use i8 arrays to access union bit-fields. This is ugly, but
Daniel Dunbar [Tue, 20 Apr 2010 17:52:30 +0000 (17:52 +0000)]
IRgen: Always use i8 arrays to access union bit-fields. This is ugly, but
matches how we currently handle structs, and this correctly handles
-fno-bitfield-type-align.

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

14 years agoremove some extraneous qualifiers.
Chris Lattner [Tue, 20 Apr 2010 17:13:14 +0000 (17:13 +0000)]
remove some extraneous qualifiers.

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

14 years agoFix a bug which triggered the assertion I added yesterday. Basically, when we initial...
Anders Carlsson [Tue, 20 Apr 2010 16:22:16 +0000 (16:22 +0000)]
Fix a bug which triggered the assertion I added yesterday. Basically, when we initialize the vtable pointer for a virtual base, and there was another path from the most derived class to another base with the same class type, we would use the wrong base.

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

14 years agoMove code to apply a non-virtual and virtual offset out into a separate function.
Anders Carlsson [Tue, 20 Apr 2010 16:03:35 +0000 (16:03 +0000)]
Move code to apply a non-virtual and virtual offset out into a separate function.

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

14 years agoKeep proper source location information for the type in an Objective-C
Douglas Gregor [Tue, 20 Apr 2010 15:39:42 +0000 (15:39 +0000)]
Keep proper source location information for the type in an Objective-C
@encode expression.

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

14 years agoTip of the day: save before commit.
Benjamin Kramer [Tue, 20 Apr 2010 11:55:38 +0000 (11:55 +0000)]
Tip of the day: save before commit.

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

14 years agoFix -Wcast-qual warnings.
Benjamin Kramer [Tue, 20 Apr 2010 11:50:39 +0000 (11:50 +0000)]
Fix -Wcast-qual warnings.

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

14 years agoIntroduce a limit on the depth of the template instantiation backtrace
Douglas Gregor [Tue, 20 Apr 2010 07:18:24 +0000 (07:18 +0000)]
Introduce a limit on the depth of the template instantiation backtrace
we will print with each error that occurs during template
instantiation. When the backtrace is longer than that, we will print
N/2 of the innermost backtrace entries and N/2 of the outermost
backtrace entries, then skip the middle entries with a note such as:

  note: suppressed 2 template instantiation contexts; use
  -ftemplate-backtrace-limit=N to change the number of template
  instantiation entries shown

This should eliminate some excessively long backtraces that aren't
providing any value.

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

14 years agoAdd test cases.
Zhongxing Xu [Tue, 20 Apr 2010 05:48:57 +0000 (05:48 +0000)]
Add test cases.

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

14 years agodon't slap noalias attribute on stret result arguments.
Chris Lattner [Tue, 20 Apr 2010 05:44:43 +0000 (05:44 +0000)]
don't slap noalias attribute on stret result arguments.
This mirror's Dan's patch for llvm-gcc in r97989, and
fixes the miscompilation in PR6525.  There is some contention
over whether this is the right thing to do, but it is the
conservative answer and demonstrably fixes a miscompilation.

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

14 years agoReplace code with a method call. No functionality change.
Zhongxing Xu [Tue, 20 Apr 2010 05:40:40 +0000 (05:40 +0000)]
Replace code with a method call. No functionality change.

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

14 years agoPass the nearest virtual base decl to InitializeVTablePointers. No functionality...
Anders Carlsson [Tue, 20 Apr 2010 05:22:15 +0000 (05:22 +0000)]
Pass the nearest virtual base decl to InitializeVTablePointers. No functionality change right now.

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

14 years agoreapply john's patch, he broke mainline again by changing the test.
Chris Lattner [Tue, 20 Apr 2010 05:19:10 +0000 (05:19 +0000)]
reapply john's patch, he broke mainline again by changing the test.

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

14 years agoAssert that the path from the derived to the base class in CodeGenFunction::GetAddres...
Anders Carlsson [Tue, 20 Apr 2010 05:07:22 +0000 (05:07 +0000)]
Assert that the path from the derived to the base class in CodeGenFunction::GetAddressOfBaseClass is not ambiguous.

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

14 years agoAltivec vector literal initializer count mismatch error removed.
John Thompson [Tue, 20 Apr 2010 05:01:46 +0000 (05:01 +0000)]
Altivec vector literal initializer count mismatch error removed.

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

14 years agoUse GetState() to get the possible cleaned state.
Zhongxing Xu [Tue, 20 Apr 2010 04:53:09 +0000 (04:53 +0000)]
Use GetState() to get the possible cleaned state.

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

14 years agogrr, lit only hates me, not the rest of the world.
Chris Lattner [Tue, 20 Apr 2010 04:33:06 +0000 (04:33 +0000)]
grr, lit only hates me, not the rest of the world.

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

14 years agorevert r101863, whcih is causing Sema/altivec-init.c to fail on a ton
Chris Lattner [Tue, 20 Apr 2010 04:31:55 +0000 (04:31 +0000)]
revert r101863, whcih is causing Sema/altivec-init.c to fail on a ton
of buildbots with:

error: 'error' diagnostics expected but not seen:
  Line 9: too few elements in vector initialization (expected 8 elements, have 2)
1 warning and 1 error generated.

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

14 years agoAltivec vector literal initializer count mismatch error removed.
John Thompson [Tue, 20 Apr 2010 03:58:33 +0000 (03:58 +0000)]
Altivec vector literal initializer count mismatch error removed.

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

14 years agoImprove handling of CXXNewExpr.
Zhongxing Xu [Tue, 20 Apr 2010 03:37:34 +0000 (03:37 +0000)]
Improve handling of CXXNewExpr.

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

14 years agoRestore r101841 without modification. Also mark 'operator delete' as used for
John McCall [Tue, 20 Apr 2010 02:18:25 +0000 (02:18 +0000)]
Restore r101841 without modification.  Also mark 'operator delete' as used for
actual delete expressions, not just new expressions.

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

14 years agoRevert r101841 and follow-up.
John McCall [Tue, 20 Apr 2010 01:42:53 +0000 (01:42 +0000)]
Revert r101841 and follow-up.

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

14 years agoadd __builtin_[r]index. Perhaps all LIBBUILTIN's should get
Chris Lattner [Tue, 20 Apr 2010 01:31:15 +0000 (01:31 +0000)]
add __builtin_[r]index.  Perhaps all LIBBUILTIN's should get
these or something?

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

14 years agoUse __SIZE_TYPE__ as suggested by dgregor.
John McCall [Tue, 20 Apr 2010 01:26:56 +0000 (01:26 +0000)]
Use __SIZE_TYPE__ as suggested by dgregor.

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

14 years agoDon't bother looking for (or diagnosing problems with) the 'operator delete'
John McCall [Tue, 20 Apr 2010 00:22:43 +0000 (00:22 +0000)]
Don't bother looking for (or diagnosing problems with) the 'operator delete'
associated with a new expression if -fno-exceptions is set.

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

14 years agoDo not diagnose unused-parameter errors in template instantiations. We
Douglas Gregor [Mon, 19 Apr 2010 23:56:20 +0000 (23:56 +0000)]
Do not diagnose unused-parameter errors in template instantiations. We
will already have done so when the template is declared.

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

14 years agoKeep track of the actual storage specifier written on a variable or
Douglas Gregor [Mon, 19 Apr 2010 22:54:31 +0000 (22:54 +0000)]
Keep track of the actual storage specifier written on a variable or
function declaration, since it may end up being changed (e.g.,
"extern" can become "static" if a prior declaration was static). Patch
by Enea Zaffanella and Paolo Bolzoni.

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

14 years agoOnly suppress the "extern variable has an initializer" warning when the extern entity...
Douglas Gregor [Mon, 19 Apr 2010 22:34:40 +0000 (22:34 +0000)]
Only suppress the "extern variable has an initializer" warning when the extern entity being initialized is const.

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

14 years agoDisable the "'extern' variable has an initializer" warning in C++,
Douglas Gregor [Mon, 19 Apr 2010 21:31:25 +0000 (21:31 +0000)]
Disable the "'extern' variable has an initializer" warning in C++,
since it makes sense there to have const extern variables. Fixes
PR6495.

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

14 years agoAST: Dump ASTRecordLayout objects when they are created with -fdump-record-layouts.
Daniel Dunbar [Mon, 19 Apr 2010 20:44:53 +0000 (20:44 +0000)]
AST: Dump ASTRecordLayout objects when they are created with -fdump-record-layouts.

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

14 years agoIRgen: Kill unused function and move the type match assert to after record dumping.
Daniel Dunbar [Mon, 19 Apr 2010 20:44:47 +0000 (20:44 +0000)]
IRgen: Kill unused function and move the type match assert to after record dumping.

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

14 years agoadd a PPCallback handler for a skipped #include, patch by
Chris Lattner [Mon, 19 Apr 2010 20:44:31 +0000 (20:44 +0000)]
add a PPCallback handler for a skipped #include, patch by
Zhanyong Wan!

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

14 years agoWhen normal name lookup to disambiguiate an Objective-C message send
Douglas Gregor [Mon, 19 Apr 2010 20:09:36 +0000 (20:09 +0000)]
When normal name lookup to disambiguiate an Objective-C message send
fails to find anything,  perform ivar lookup and, if we find one,
consider this an instance message.

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

14 years agoMore tests for Objective-C-related name lookup weirdness. Yes, it's
Douglas Gregor [Mon, 19 Apr 2010 19:10:40 +0000 (19:10 +0000)]
More tests for Objective-C-related name lookup weirdness. Yes, it's
weird; yes, it's what GCC does. Almost.

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

14 years agoAdd a testcase for PR6501 (too many/too few arguments to a function call).
Eric Christopher [Mon, 19 Apr 2010 18:39:43 +0000 (18:39 +0000)]
Add a testcase for PR6501 (too many/too few arguments to a function call).

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

14 years agoCheck for darwin befoer cheking for version.
Fariborz Jahanian [Mon, 19 Apr 2010 18:38:31 +0000 (18:38 +0000)]
Check for darwin befoer cheking for version.
(related to radar 7866951).

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

14 years agoMake this test darwin10 specific.
Fariborz Jahanian [Mon, 19 Apr 2010 18:27:05 +0000 (18:27 +0000)]
Make this test darwin10 specific.

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

14 years agoTemporarily XFAIL this test on windows.
Eric Christopher [Mon, 19 Apr 2010 18:26:40 +0000 (18:26 +0000)]
Temporarily XFAIL this test on windows.

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

14 years agoRemove the argument number from the constant integer diagnostic.
Eric Christopher [Mon, 19 Apr 2010 18:23:02 +0000 (18:23 +0000)]
Remove the argument number from the constant integer diagnostic.
Update all of the testcases accordingly.

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

14 years agoSome renaming of methods, fixes typo
Fariborz Jahanian [Mon, 19 Apr 2010 18:15:02 +0000 (18:15 +0000)]
Some renaming of methods, fixes typo
(related to PR6769).

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

14 years agoWhen searching for code-completion and typo-correction candidates,
Douglas Gregor [Mon, 19 Apr 2010 18:02:19 +0000 (18:02 +0000)]
When searching for code-completion and typo-correction candidates,
look from an Objective-C class or category to its implementation, to
pick up synthesized ivars. Fixes a problem reported by David
Chisnall.

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

14 years agoForce clang to produce legacy api for messaging
Fariborz Jahanian [Mon, 19 Apr 2010 17:53:30 +0000 (17:53 +0000)]
Force clang to produce legacy api for messaging
in for pre-snowleoprd (NeXt runtime). Fixes
radar 7866951

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

14 years agoAdd comment explaning the use of c99 inline in c++.
Rafael Espindola [Mon, 19 Apr 2010 16:58:20 +0000 (16:58 +0000)]
Add comment explaning the use of c99 inline in c++.

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

14 years agoFix -Wcast-qual warnings.
Dan Gohman [Mon, 19 Apr 2010 16:39:44 +0000 (16:39 +0000)]
Fix -Wcast-qual warnings.

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

14 years agoMove all C++ expression evaluation logic into its own file.
Zhongxing Xu [Mon, 19 Apr 2010 12:51:02 +0000 (12:51 +0000)]
Move all C++ expression evaluation logic into its own file.

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

14 years agoAnalyzer: add support for CXXNewExpr.
Zhongxing Xu [Mon, 19 Apr 2010 11:47:28 +0000 (11:47 +0000)]
Analyzer: add support for CXXNewExpr.

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

14 years agoDon't just emit ivar metadata - emit CORRECT ivar metadata. (GNU runtime)
David Chisnall [Mon, 19 Apr 2010 01:37:25 +0000 (01:37 +0000)]
Don't just emit ivar metadata - emit CORRECT ivar metadata. (GNU runtime)

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

14 years agoFix emitting ivar metadata for synthesized ivars and some 64-bit fixes. (GNU runtime)
David Chisnall [Mon, 19 Apr 2010 00:45:34 +0000 (00:45 +0000)]
Fix emitting ivar metadata for synthesized ivars and some 64-bit fixes. (GNU runtime)

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

14 years agoIf a method is virtual and the class key function is in another file, emit the method...
Rafael Espindola [Mon, 19 Apr 2010 00:44:22 +0000 (00:44 +0000)]
If a method is virtual and the class key function is in another file, emit the method as available_externally.
Fixes PR6747

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

14 years agoLocal static variables must be available module-wise
Fariborz Jahanian [Sun, 18 Apr 2010 21:01:23 +0000 (21:01 +0000)]
Local static variables must be available module-wise
as they are accessible in static methods in a class
local to the same function. Fixes PR6769.

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

14 years agorecommit r101568 to fix PR6766
Nuno Lopes [Sun, 18 Apr 2010 19:06:43 +0000 (19:06 +0000)]
recommit r101568 to fix PR6766
as a side-effect, remove two FIXMEs now fixed

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

14 years agoMake sure that we don't visit redeclarations of nested classes while
Douglas Gregor [Sun, 18 Apr 2010 18:11:38 +0000 (18:11 +0000)]
Make sure that we don't visit redeclarations of nested classes while
instantiating class members as part of an explicit
instantiation. Addresses a compilation problem in
Boost.Serialization.

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

14 years agoC++ [namespace.memdef]p3 only applies when the friend is not named via
Douglas Gregor [Sun, 18 Apr 2010 17:37:40 +0000 (17:37 +0000)]
C++ [namespace.memdef]p3 only applies when the friend is not named via
a qualified name. We weren't checking for an empty
nested-name-specifier when dealing with friend class templates
(although we were checking in the other places where we deal with this
paragraph). Fixes a Boost.Serialization showstopper.

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

14 years agotests: Don't force triple in x86-builtin-palignr test, this test should be
Daniel Dunbar [Sun, 18 Apr 2010 15:30:18 +0000 (15:30 +0000)]
tests: Don't force triple in x86-builtin-palignr test, this test should be
portable.

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

14 years agoBail out early to avoid comparing the internals of two conversion sequences of
Benjamin Kramer [Sun, 18 Apr 2010 12:05:54 +0000 (12:05 +0000)]
Bail out early to avoid comparing the internals of two conversion sequences of
different kinds (aka garbage). This happens if we're comparing a standard
conversion sequence to an ambiguous one which have the same KindRank.

Found by valgrind.

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

14 years agoWhen performing reference initialization for the purposes of overload
Douglas Gregor [Sun, 18 Apr 2010 09:22:00 +0000 (09:22 +0000)]
When performing reference initialization for the purposes of overload
resolution ([over.ics.ref]), we take some shortcuts required by the
standard that effectively permit binding of a const volatile reference
to an rvalue. We have to treat lightly here to avoid infinite
recursion.

Fixes PR6177.

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

14 years agoBinding a reference to an rvalue is a direct binding in C++0x but not
Douglas Gregor [Sun, 18 Apr 2010 08:46:23 +0000 (08:46 +0000)]
Binding a reference to an rvalue is a direct binding in C++0x but not
in C++03.

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

14 years agoFix the access checking of function and function template argument types,
Chandler Carruth [Sun, 18 Apr 2010 08:23:21 +0000 (08:23 +0000)]
Fix the access checking of function and function template argument types,
return types, and default arguments. This fixes PR6855 along with several
similar cases where we rejected valid code.

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

14 years agoWhen checking the copy constructor for the optional copy during a
Douglas Gregor [Sun, 18 Apr 2010 07:57:34 +0000 (07:57 +0000)]
When checking the copy constructor for the optional copy during a
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.

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

14 years agoIn C++98/03, when binding a reference to an rvalue of
Douglas Gregor [Sun, 18 Apr 2010 07:40:54 +0000 (07:40 +0000)]
In C++98/03, when binding a reference to an rvalue of
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.

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

14 years agoAdd testcase that I forgot for r101667 for gnu-keywords.
Chandler Carruth [Sun, 18 Apr 2010 06:12:13 +0000 (06:12 +0000)]
Add testcase that I forgot for r101667 for gnu-keywords.

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

14 years agoAllow the 'ibaction' attribute to be attached to method declarations (and not issue...
Ted Kremenek [Sun, 18 Apr 2010 04:59:38 +0000 (04:59 +0000)]
Allow the 'ibaction' attribute to be attached to method declarations (and not issue a warning).

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

14 years agoDo not consider explicit constructors when performing a copy to a
Douglas Gregor [Sun, 18 Apr 2010 02:16:12 +0000 (02:16 +0000)]
Do not consider explicit constructors when performing a copy to a
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.

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

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