]> granicus.if.org Git - clang/log
clang
15 years agoOops, the testcase I was thinking of is supposed to error out. I
Mike Stump [Fri, 29 May 2009 19:14:13 +0000 (19:14 +0000)]
Oops, the testcase I was thinking of is supposed to error out.  I
tried other things that might trip, but they all worked.

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

15 years agoAdd a couple missing ARM defines.
Eli Friedman [Fri, 29 May 2009 19:00:15 +0000 (19:00 +0000)]
Add a couple missing ARM defines.

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

15 years agoReduce the amount of stack space we use in SmallVectors during
Douglas Gregor [Fri, 29 May 2009 18:27:38 +0000 (18:27 +0000)]
Reduce the amount of stack space we use in SmallVectors during
template instantiation. This helps reduce our stack footprint when
performing deep template instantiations.

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

15 years agoRevert r72575, which isn't really right, and fix up other code to
Eli Friedman [Fri, 29 May 2009 18:22:49 +0000 (18:22 +0000)]
Revert r72575, which isn't really right, and fix up other code to
handle the construct in question correctly.

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

15 years agoReject incomplete types in exception specs.
Sebastian Redl [Fri, 29 May 2009 18:02:33 +0000 (18:02 +0000)]
Reject incomplete types in exception specs.

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

15 years agoFixup codegen for composition of vla types using a normal array type.
Mike Stump [Fri, 29 May 2009 17:06:45 +0000 (17:06 +0000)]
Fixup codegen for composition of vla types using a normal array type.

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

15 years agoFix usage of placement new. Placement new is not actually declared implicitly.
Sebastian Redl [Fri, 29 May 2009 16:43:59 +0000 (16:43 +0000)]
Fix usage of placement new. Placement new is not actually declared implicitly.

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

15 years agoAvoid dumping during semantic analysis when checking array types when
Mike Stump [Fri, 29 May 2009 16:34:15 +0000 (16:34 +0000)]
Avoid dumping during semantic analysis when checking array types when
a vla is used.

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

15 years agoWe don't want to validate bad code,
Mike Stump [Fri, 29 May 2009 16:24:13 +0000 (16:24 +0000)]
We don't want to validate bad code,

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

15 years agoNote another case that doesn't work yet.
Mike Stump [Fri, 29 May 2009 16:12:36 +0000 (16:12 +0000)]
Note another case that doesn't work yet.

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

15 years agoFixup the rest of the trivial cases of the codegen of volatile. If
Mike Stump [Fri, 29 May 2009 15:46:01 +0000 (15:46 +0000)]
Fixup the rest of the trivial cases of the codegen of volatile.  If
any body can spot codegen bugs with volatile, or knows of any in the
bug database, let me know.

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

15 years agoDisallow exception specifications on multi-level indirections.
Sebastian Redl [Fri, 29 May 2009 15:01:05 +0000 (15:01 +0000)]
Disallow exception specifications on multi-level indirections.

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

15 years agoSome cleanups and commenting to our declaration-name handling
Douglas Gregor [Fri, 29 May 2009 14:49:33 +0000 (14:49 +0000)]
Some cleanups and commenting to our declaration-name handling

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

15 years agoFollow-on test case for template instantiation of interesting DeclGroups
Douglas Gregor [Fri, 29 May 2009 14:26:40 +0000 (14:26 +0000)]
Follow-on test case for template instantiation of interesting DeclGroups

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

15 years agoNow that we have declared/defined tag types within DeclGroups,
Douglas Gregor [Fri, 29 May 2009 14:25:00 +0000 (14:25 +0000)]
Now that we have declared/defined tag types within DeclGroups,
instantiation of tags local to member functions of class templates
(and, eventually, function templates) works when the tag is defined as
part of the decl-specifier-seq, e.g.,

  struct S { T x, y; } s1;

Also, make sure that we don't try to default-initialize a dependent
type.

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

15 years agoIf a declarator group declares a type, make sure to add that declaration
Eli Friedman [Fri, 29 May 2009 01:49:24 +0000 (01:49 +0000)]
If a declarator group declares a type, make sure to add that declaration
to the DeclGroup.

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

15 years agoWhen we parse a tag specifier, keep track of whether that tag
Douglas Gregor [Thu, 28 May 2009 23:31:59 +0000 (23:31 +0000)]
When we parse a tag specifier, keep track of whether that tag
specifier resulted in the creation of a new TagDecl node, which
happens either when the tag specifier was a definition or when the tag
specifier was the first declaration of that tag type. This information
has several uses, the first of which is implemented in this commit:

  1) In C++, one is not allowed to define tag types within a type
  specifier (e.g., static_cast<struct S { int x; } *>(0) is
  ill-formed) or within the result or parameter types of a
  function. We now diagnose this.

  2) We can extend DeclGroups to contain information about any tags
  that are declared/defined within the declaration specifiers of a
  variable, e.g.,

    struct Point { int x, y, z; } p;

  This will help improve AST printing and template instantiation,
  among other things.

  3) For C99, we can keep track of whether a tag type is defined
  within the type of a parameter, to properly cope with cases like,
  e.g.,

    int bar(struct T2 { int x; } y) {
      struct T2 z;
    }

  We can also do similar things wherever there is a type specifier,
  e.g., to keep track of where the definition of S occurs in this
  legal C99 code:

    (struct S { int x, y; } *)0

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

15 years agoPR4281: Fix bogus CodeGen assertion. The issue is that
Eli Friedman [Thu, 28 May 2009 23:04:00 +0000 (23:04 +0000)]
PR4281: Fix bogus CodeGen assertion.  The issue is that
getUnqualifiedType() doesn't strip off all qualifiers for non-canonical
types.

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

15 years agoARM is a legitimate Darwin architecture; don't assert.
Eli Friedman [Thu, 28 May 2009 20:57:06 +0000 (20:57 +0000)]
ARM is a legitimate Darwin architecture; don't assert.

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

15 years agoAdd the missing public: thanks, Fariborz
Douglas Gregor [Thu, 28 May 2009 16:41:44 +0000 (16:41 +0000)]
Add the missing public: thanks, Fariborz

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

15 years agoMove clang-cc's -v output to the start (vs. end) of compilation, and change
Daniel Dunbar [Thu, 28 May 2009 16:37:33 +0000 (16:37 +0000)]
Move clang-cc's -v output to the start (vs. end) of compilation, and change
clang -> clang-cc to be less confusing.

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

15 years agoIntroduced DeclContext::isDependentContext, which determines whether a
Douglas Gregor [Thu, 28 May 2009 16:34:51 +0000 (16:34 +0000)]
Introduced DeclContext::isDependentContext, which determines whether a
given DeclContext is dependent on type parameters. Use this to
properly determine whether a TagDecl is dependent; previously, we were
missing the case where the TagDecl is a local class of a member
function of a class template (phew!).

Also, make sure that, when we instantiate declarations within a member
function of a class template (or a function template, eventually),
that we add those declarations to the "instantiated locals" map so
that they can be found when instantiating declaration references.

Unfortunately, I was not able to write a useful test for this change,
although the assert() that fires when uncommenting the FIXME'd line in
test/SemaTemplate/instantiate-declref.cpp tells the "experienced user"
that we're now doing the right thing.

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

15 years agoupdate test for r72519
Chris Lattner [Thu, 28 May 2009 05:41:32 +0000 (05:41 +0000)]
update test for r72519

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

15 years agofix the "pasting formed 'a]', an invalid preprocessing token"
Chris Lattner [Thu, 28 May 2009 05:39:39 +0000 (05:39 +0000)]
fix the "pasting formed 'a]', an invalid preprocessing token"
diagnostic to include the full instantiation location for the
invalid paste.  For:

#define foo(a, b)  a ## b
#define bar(x) foo(x, ])
bar(a)
bar(zdy)

Instead of:

t.c:3:22: error: pasting formed 'a]', an invalid preprocessing token
#define foo(a, b)  a ## b
                     ^
t.c:3:22: error: pasting formed 'zdy]', an invalid preprocessing token

we now produce:

t.c:7:1: error: pasting formed 'a]', an invalid preprocessing token
bar(a)
^
t.c:4:16: note: instantiated from:
#define bar(x) foo(x, ])
               ^
t.c:3:22: note: instantiated from:
#define foo(a, b)  a ## b
                     ^
t.c:8:1: error: pasting formed 'zdy]', an invalid preprocessing token
bar(zdy)
^
t.c:4:16: note: instantiated from:
#define bar(x) foo(x, ])
               ^
t.c:3:22: note: instantiated from:
#define foo(a, b)  a ## b
                     ^

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

15 years agoNot setting all the fields is confusing...
Mike Stump [Thu, 28 May 2009 00:16:27 +0000 (00:16 +0000)]
Not setting all the fields is confusing...

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

15 years agoFix a use-of-undefined, IRgen expects the RValue for "void" to be a scalar RValue.
Daniel Dunbar [Wed, 27 May 2009 23:45:33 +0000 (23:45 +0000)]
Fix a use-of-undefined, IRgen expects the RValue for "void" to be a scalar RValue.

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

15 years agoAdd a target triple, because this test depends on details of the x86-64 ABI
Douglas Gregor [Wed, 27 May 2009 23:32:34 +0000 (23:32 +0000)]
Add a target triple, because this test depends on details of the x86-64 ABI

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

15 years agoReimplement much of the way that we track nested classes in the
Douglas Gregor [Wed, 27 May 2009 23:11:45 +0000 (23:11 +0000)]
Reimplement much of the way that we track nested classes in the
parser. Rather than placing all of the delayed member function
declarations and inline definitions into a single bucket corresponding
to the top-level class, we instead mirror the nesting structure of the
nested classes and place the delayed member functions into their
appropriate place. Then, when we actually parse the delayed member
function declarations, set up the scope stack the same way as it was
when we originally saw the declaration, so that we can find, e.g.,
template parameters that are in scope.

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

15 years agoA few tweaks to the "Differences between various standard modes"
Eli Friedman [Wed, 27 May 2009 23:02:57 +0000 (23:02 +0000)]
A few tweaks to the "Differences between various standard modes"
section.

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

15 years agorestrict is not a keyword in gnu89 mode. Change TokenKinds.def to
Eli Friedman [Wed, 27 May 2009 22:48:34 +0000 (22:48 +0000)]
restrict is not a keyword in gnu89 mode.  Change TokenKinds.def to
reflect that.

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

15 years agoDon't vary token concatenation based on the language options; this
Eli Friedman [Wed, 27 May 2009 22:33:06 +0000 (22:33 +0000)]
Don't vary token concatenation based on the language options; this
behavior is more likely to be confusing than useful.

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

15 years agoReintroduce the home for exception specs, and make Sema fill it. However, keep the...
Sebastian Redl [Wed, 27 May 2009 22:11:52 +0000 (22:11 +0000)]
Reintroduce the home for exception specs, and make Sema fill it. However, keep the spec out of the canonical type this time. Net effect is currently nothing, because the spec isn't checked anywhere.

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

15 years agoMake the bad paste diagnostic print the entire pasted token.
Eli Friedman [Wed, 27 May 2009 22:00:37 +0000 (22:00 +0000)]
Make the bad paste diagnostic print the entire pasted token.

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

15 years agoNo write-barrier for initializations.
Fariborz Jahanian [Wed, 27 May 2009 19:54:11 +0000 (19:54 +0000)]
No write-barrier for initializations.

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

15 years agoChange a confusing variable name.
Fariborz Jahanian [Wed, 27 May 2009 19:48:48 +0000 (19:48 +0000)]
Change a confusing variable name.

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

15 years agoAdd a big test case for I-C-Es in C++, and a fix to make it work. The fix might not...
Sebastian Redl [Wed, 27 May 2009 19:34:06 +0000 (19:34 +0000)]
Add a big test case for I-C-Es in C++, and a fix to make it work. The fix might not be the right way to do it.

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

15 years agoFix the type of a enum non-type template argument within the instantiation.
Sebastian Redl [Wed, 27 May 2009 19:21:29 +0000 (19:21 +0000)]
Fix the type of a enum non-type template argument within the instantiation.

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

15 years agoSimplify, and improve the performance of, template instantiation for
Douglas Gregor [Wed, 27 May 2009 17:54:46 +0000 (17:54 +0000)]
Simplify, and improve the performance of, template instantiation for
declaration references. The key realization is that dependent Decls,
which actually require instantiation, can only refer to the current
instantiation or members thereof. And, since the current context
during instantiation contains all of those members of the current
instantiation, we can simply find the real instantiate that matches up
with the "current instantiation" template.

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

15 years agoAdd some more tests for instantiation of declaration references. Also,
Douglas Gregor [Wed, 27 May 2009 17:30:49 +0000 (17:30 +0000)]
Add some more tests for instantiation of declaration references. Also,
improve some error recovery with explicit template instantiation.

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

15 years agoEnumeration declarations that were instantiated from an enumeration
Douglas Gregor [Wed, 27 May 2009 17:20:35 +0000 (17:20 +0000)]
Enumeration declarations that were instantiated from an enumeration
within a template now have a link back to the enumeration from which
they were instantiated. This means that we can now find the
instantiation of an anonymous enumeration.

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

15 years agoImprove name lookup for and template instantiation of declaration
Douglas Gregor [Wed, 27 May 2009 17:07:49 +0000 (17:07 +0000)]
Improve name lookup for and template instantiation of declaration
references. There are several smallish fixes here:

  - Make sure we look through template parameter scope when
    determining whether we're parsing a nested class (or nested class
    *template*). This makes sure that we delay parsing the bodies of
    inline member functions until after we're out of the outermost
    class (template) scope.
  - Since the bodies of member functions are always parsed
    "out-of-line", even when they were declared in-line, teach
    unqualified name lookup to look into the (semantic) parents.
  - Use the new InstantiateDeclRef to handle the instantiation of a
    reference to a declaration (in DeclRefExpr), which drastically
    simplifies template instantiation for DeclRefExprs.
  - When we're instantiating a ParmVarDecl, it must be in the current
    instantiation scope, so only look there.

Also, remove the #if 0's and FIXME's from the dynarray example, which
now compiles and executes thanks to Anders and Eli.

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

15 years agoIRgen support for calls to functions that return references to aggregate exressions.
Anders Carlsson [Wed, 27 May 2009 16:45:02 +0000 (16:45 +0000)]
IRgen support for calls to functions that return references to aggregate exressions.

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

15 years agoFix another test case.
Anders Carlsson [Wed, 27 May 2009 16:38:58 +0000 (16:38 +0000)]
Fix another test case.

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

15 years agoRelax an assert to an if check.
Anders Carlsson [Wed, 27 May 2009 16:28:34 +0000 (16:28 +0000)]
Relax an assert to an if check.

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

15 years agoInitialize ObjCSenderDispatch in LangOptions.
Fariborz Jahanian [Wed, 27 May 2009 16:27:50 +0000 (16:27 +0000)]
Initialize ObjCSenderDispatch in LangOptions.
Patch by Benjamin Kramer.

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

15 years agoConvert ObjC qualified type clients over to using iterators.
Steve Naroff [Wed, 27 May 2009 16:21:00 +0000 (16:21 +0000)]
Convert ObjC qualified type clients over to using iterators.

This allows me to remove some API that I don't want to carry over to ObjCObjectPointerType.

No functionality change.

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

15 years agoCreate CXXConstructExprs when constructing via copy initialization.
Anders Carlsson [Wed, 27 May 2009 16:10:08 +0000 (16:10 +0000)]
Create CXXConstructExprs when constructing via copy initialization.

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

15 years agoFix up constant expression handling to deal with the address
Eli Friedman [Wed, 27 May 2009 06:04:58 +0000 (06:04 +0000)]
Fix up constant expression handling to deal with the address
of a reference correctly.

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

15 years agoAdd IRGen support for local variables of reference type.
Eli Friedman [Wed, 27 May 2009 05:39:06 +0000 (05:39 +0000)]
Add IRGen support for local variables of reference type.

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

15 years agoInitial stab at a generalized operation for determining the
Douglas Gregor [Wed, 27 May 2009 05:35:12 +0000 (05:35 +0000)]
Initial stab at a generalized operation for determining the
instantiation of a declaration from the template version (or version
that lives in a template) and a given set of template arguments. This
needs much, much more testing, but it suffices for simple examples
like

  typedef T* iterator;
  iterator begin();

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

15 years agoDon't drop the computed implicit conversions when building a call to
Douglas Gregor [Wed, 27 May 2009 05:00:47 +0000 (05:00 +0000)]
Don't drop the computed implicit conversions when building a call to
overloaded operator[] or overloaded postfix unary operator (++,
--). Thanks to Eli for finding this bug!

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

15 years agoAdd IRGen support for return statements in functions with reference
Eli Friedman [Wed, 27 May 2009 04:56:12 +0000 (04:56 +0000)]
Add IRGen support for return statements in functions with reference
type.

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

15 years agoHandle operator call expressions where the callee is a member function.
Anders Carlsson [Wed, 27 May 2009 04:18:27 +0000 (04:18 +0000)]
Handle operator call expressions where the callee is a member function.

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

15 years agoFunctions that return references can be rvalues as well.
Anders Carlsson [Wed, 27 May 2009 03:37:57 +0000 (03:37 +0000)]
Functions that return references can be rvalues as well.

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

15 years agoAdd another test.
Anders Carlsson [Wed, 27 May 2009 01:46:48 +0000 (01:46 +0000)]
Add another test.

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

15 years agoAdd support for emitting calls to functions that return references (as lvalues only...
Anders Carlsson [Wed, 27 May 2009 01:45:47 +0000 (01:45 +0000)]
Add support for emitting calls to functions that return references (as lvalues only for now)

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

15 years agoFix typo. I also fixed the hard to read case differences, so that no
Mike Stump [Wed, 27 May 2009 01:42:21 +0000 (01:42 +0000)]
Fix typo.  I also fixed the hard to read case differences, so that no
one else is tempted to copy the style, incorrectly.

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

15 years agoRename an EmitCallExpr function to EmitCall to make it clear that it doesn't emit...
Anders Carlsson [Wed, 27 May 2009 01:22:39 +0000 (01:22 +0000)]
Rename an EmitCallExpr function to EmitCall to make it clear that it doesn't emit an expr.

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

15 years agoUpdate comment.
Mike Stump [Tue, 26 May 2009 23:35:31 +0000 (23:35 +0000)]
Update comment.

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

15 years agoAnd an additional testcase that also works.
Mike Stump [Tue, 26 May 2009 23:10:55 +0000 (23:10 +0000)]
And an additional testcase that also works.

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

15 years agoTemplate instantiation for "typeof" for both types and expressions.
Douglas Gregor [Tue, 26 May 2009 22:09:24 +0000 (22:09 +0000)]
Template instantiation for "typeof" for both types and expressions.

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

15 years agoFixup codegen for volatile structs in the trivial cases (a a=a and a=a=a).
Mike Stump [Tue, 26 May 2009 22:03:21 +0000 (22:03 +0000)]
Fixup codegen for volatile structs in the trivial cases (a a=a and a=a=a).

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

15 years agoA simple dynamic array class template, to be used as a test-bed for template instanti...
Douglas Gregor [Tue, 26 May 2009 21:27:04 +0000 (21:27 +0000)]
A simple dynamic array class template, to be used as a test-bed for template instantiation

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

15 years agoMake sure that CodeGen sees template instantiations.
Douglas Gregor [Tue, 26 May 2009 20:50:29 +0000 (20:50 +0000)]
Make sure that CodeGen sees template instantiations.

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

15 years agoUse .data() instead of &...[0].
Daniel Dunbar [Tue, 26 May 2009 19:40:20 +0000 (19:40 +0000)]
Use .data() instead of &...[0].
 - Just SmallVectors this time.

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

15 years agoEsnure that if we have a volatile structure as the destination, that
Mike Stump [Tue, 26 May 2009 18:57:45 +0000 (18:57 +0000)]
Esnure that if we have a volatile structure as the destination, that
we actually have a destination.

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

15 years agoWhen evaluating a VarDecl as a constant or determining whether it is
Douglas Gregor [Tue, 26 May 2009 18:54:04 +0000 (18:54 +0000)]
When evaluating a VarDecl as a constant or determining whether it is
an integral constant expression, maintain a cache of the value and the
is-an-ICE flag within the VarDecl itself. This eliminates
exponential-time behavior of the Fibonacci template metaprogram.

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

15 years agoRevert to using &...[0] for std::vector, apparently .data isn't generally
Daniel Dunbar [Tue, 26 May 2009 18:00:25 +0000 (18:00 +0000)]
Revert to using &...[0] for std::vector, apparently .data isn't generally
available (and it isn't necessary in this case).

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

15 years agoUse .data() vs &...[0]
Daniel Dunbar [Tue, 26 May 2009 17:13:50 +0000 (17:13 +0000)]
Use .data() vs &...[0]

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

15 years agoWhen trying to pass an argument on the stack, assume LLVM will do the right
Daniel Dunbar [Tue, 26 May 2009 16:37:37 +0000 (16:37 +0000)]
When trying to pass an argument on the stack, assume LLVM will do the right
thing for non-aggregate types.
 - Otherwise we unnecessarily pin values to the stack and currently end up
   triggering a backend bug in one case.

 - This loose cooperation with LLVM to implement the ABI is pretty ugly.

 - <rdar://problem/6918722> [irgen] clang miscompile of many pointer varargs on
   x86-64

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

15 years agoThe driver/diagnostic client don't need to be on the heap.
Daniel Dunbar [Tue, 26 May 2009 16:15:44 +0000 (16:15 +0000)]
The driver/diagnostic client don't need to be on the heap.

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

15 years agoAn Obj-C message send expression can never have a reference type.
Anders Carlsson [Tue, 26 May 2009 15:22:25 +0000 (15:22 +0000)]
An Obj-C message send expression can never have a reference type.

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

15 years agoSimplify printing of the statistics for types.
Douglas Gregor [Tue, 26 May 2009 14:40:08 +0000 (14:40 +0000)]
Simplify printing of the statistics for types.

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

15 years agoFix for PR4140: Add the start of a Linux toolchain (basically, just
Eli Friedman [Tue, 26 May 2009 07:52:18 +0000 (07:52 +0000)]
Fix for PR4140: Add the start of a Linux toolchain (basically, just
barely enough to get the given usage of -print-file-name working).

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

15 years agoAdd a new CallExpr::getCallReturnType and use it in Expr::isLvalueInternal. No intend...
Anders Carlsson [Tue, 26 May 2009 04:57:27 +0000 (04:57 +0000)]
Add a new CallExpr::getCallReturnType and use it in Expr::isLvalueInternal. No intended functionality change.

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

15 years agoA block that returns a reference is an lvalue.
Anders Carlsson [Tue, 26 May 2009 02:03:20 +0000 (02:03 +0000)]
A block that returns a reference is an lvalue.

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

15 years agoHandle the edge case of a weak function with incomplete type correctly.
Eli Friedman [Tue, 26 May 2009 01:22:57 +0000 (01:22 +0000)]
Handle the edge case of a weak function with incomplete type correctly.
Found by code inspection; I haven't seen this in real-world code.

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

15 years agoRemove a bunch of unused constructors
Anders Carlsson [Tue, 26 May 2009 01:04:47 +0000 (01:04 +0000)]
Remove a bunch of unused constructors

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

15 years agoRemove AstGuard.h from Xcode project.
Anders Carlsson [Tue, 26 May 2009 00:57:47 +0000 (00:57 +0000)]
Remove AstGuard.h from Xcode project.

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

15 years agoMinor build system changes to make ABITest work correctly on Linux.
Eli Friedman [Mon, 25 May 2009 22:07:09 +0000 (22:07 +0000)]
Minor build system changes to make ABITest work correctly on Linux.

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

15 years agoSome minor corrections: don't use offsetof on a bitfield, and cast
Eli Friedman [Mon, 25 May 2009 21:38:01 +0000 (21:38 +0000)]
Some minor corrections: don't use offsetof on a bitfield, and cast
printf operands to long to suppress warnings.

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

15 years agoExtend getPreferredTypeAlign to handle _Complex double and long long
Eli Friedman [Mon, 25 May 2009 21:27:19 +0000 (21:27 +0000)]
Extend getPreferredTypeAlign to handle _Complex double and long long
correctly.

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

15 years agoPR4122: Tweak the ambiguity handling to handle (S())() correctly. I've
Eli Friedman [Mon, 25 May 2009 19:41:42 +0000 (19:41 +0000)]
PR4122: Tweak the ambiguity handling to handle (S())() correctly.  I've
left out handling for stuff like (S())++ for the moment.

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

15 years agotweak non-null check to put the caret on the function, but underline the
Chris Lattner [Mon, 25 May 2009 18:23:36 +0000 (18:23 +0000)]
tweak non-null check to put the caret on the function, but underline the
argument.  This avoids the argument from being silenced when the argument is
the NULL macro, which is defined in a system header.  This also makes the output
a bit nicer, e.g.:

t.c:8:3: warning: null passed to a callee which requires a non-null argument
  func1(NULL, cp2, i1);
  ^     ~~~~

vs something like:

t.c:8:10: warning: argument is null where non-null is required
  func1(NULL, cp2, i1);
        ^

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

15 years agomerge two tests.
Chris Lattner [Mon, 25 May 2009 18:20:11 +0000 (18:20 +0000)]
merge two tests.

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

15 years agoreword a warning for clarity
Chris Lattner [Mon, 25 May 2009 18:18:56 +0000 (18:18 +0000)]
reword a warning for clarity

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

15 years agodefault -Wnonnull to on.
Chris Lattner [Mon, 25 May 2009 18:13:00 +0000 (18:13 +0000)]
default -Wnonnull to on.

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

15 years agomove some format group options around in the file. Move NonNull group into
Chris Lattner [Mon, 25 May 2009 18:10:41 +0000 (18:10 +0000)]
move some format group options around in the file.  Move NonNull group into
DiagnosticGroups.td, and add it as part of -Wformat (which gets it into -Wall).

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

15 years agoFix a couple of bugs:
Chris Lattner [Mon, 25 May 2009 17:16:10 +0000 (17:16 +0000)]
Fix a couple of bugs:
1. When we accept "#garbage" in asm-with-cpp mode, change the token kind
   of the # to unknown so that the preprocessor won't try to process it as
   a real #.  This fixes a crash on the attached example
2. Fix macro definition extents processing to handle #foo at the end of a
   macro to say the definition ends with the foo, not the #.

This is a follow-on fix to r72283, and rdar://6916026

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

15 years agoimprove comment, no functionality change.
Chris Lattner [Mon, 25 May 2009 16:23:08 +0000 (16:23 +0000)]
improve comment, no functionality change.

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

15 years agofix this test to fail when the patch isn't applied.
Chris Lattner [Mon, 25 May 2009 16:14:52 +0000 (16:14 +0000)]
fix this test to fail when the patch isn't applied.

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

15 years agoMake sure an invalid concatentaion doesn't insert whitespace before
Eli Friedman [Sun, 24 May 2009 19:25:46 +0000 (19:25 +0000)]
Make sure an invalid concatentaion doesn't insert whitespace before
the RHS.  Fixes assembler-with-cpp issue reported on cfe-dev.

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

15 years agoAnother tweak to the clang Getting Started page.
Daniel Dunbar [Sun, 24 May 2009 01:40:10 +0000 (01:40 +0000)]
Another tweak to the clang Getting Started page.

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

15 years agoMinor updates to the clang Getting Started page.
Daniel Dunbar [Sun, 24 May 2009 01:00:12 +0000 (01:00 +0000)]
Minor updates to the clang Getting Started page.

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

15 years agoPropagate volatile for implicit property refernces.
Mike Stump [Sat, 23 May 2009 23:52:31 +0000 (23:52 +0000)]
Propagate volatile for implicit property refernces.

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

15 years agoPropagate volatile around for property references.
Mike Stump [Sat, 23 May 2009 23:48:13 +0000 (23:48 +0000)]
Propagate volatile around for property references.

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

15 years agoTrack volatile aggregate copies better. I'm hoping someone else will decide
Mike Stump [Sat, 23 May 2009 22:29:41 +0000 (22:29 +0000)]
Track volatile aggregate copies better.  I'm hoping someone else will decide
how to get the backend to know that the operation is volatile.

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

15 years agoFix thinko, and implement aggregate volatile reads.
Mike Stump [Sat, 23 May 2009 22:01:27 +0000 (22:01 +0000)]
Fix thinko, and implement aggregate volatile reads.

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

15 years agoMore volatile fixes. Can't testcase these yet as ultimately volatile
Mike Stump [Sat, 23 May 2009 21:40:07 +0000 (21:40 +0000)]
More volatile fixes.  Can't testcase these yet as ultimately volatile
is still ignored.

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

15 years agoCollapse a few FIXMEs together and refactor to make fixing the code easier.
Mike Stump [Sat, 23 May 2009 20:28:01 +0000 (20:28 +0000)]
Collapse a few FIXMEs together and refactor to make fixing the code easier.

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