]> granicus.if.org Git - clang/log
clang
14 years agoRemove the linux c includes part of my last patch.
Eric Christopher [Wed, 3 Mar 2010 23:27:49 +0000 (23:27 +0000)]
Remove the linux c includes part of my last patch.

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

14 years agoRevert r97674; it's causing failures
Douglas Gregor [Wed, 3 Mar 2010 23:26:56 +0000 (23:26 +0000)]
Revert r97674; it's causing failures

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

14 years agoImplement disambiguation of base class members via a
Douglas Gregor [Wed, 3 Mar 2010 22:53:40 +0000 (22:53 +0000)]
Implement disambiguation of base class members via a
nested-name-specifier. For example, this allows member access in
diamond-shaped hierarchies like:

  struct Base {
    void Foo();
    int Member;
  };

  struct D1 : public Base {};
  struct D2 : public Base {};

  struct Derived : public D1, public D2 { }

  void Test(Derived d) {
    d.Member = 17; // error: ambiguous cast from Derived to Base
    d.D1::Member = 17; // error: okay, modify D1's Base's Member
  }

Fixes PR5820 and <rdar://problem/7535045>. Also, eliminate some
redundancy between Sema::PerformObjectMemberConversion() and
Sema::PerformObjectArgumentInitialization() -- the latter now calls
the former.

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

14 years agoFix code gen bug generating code for
Fariborz Jahanian [Wed, 3 Mar 2010 22:09:47 +0000 (22:09 +0000)]
Fix code gen bug generating code for
((id)cat)->isa. Fixes radar 7709015.

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

14 years agomerge asm-2.c into asm.c, remove asm-inout.c because it is
Chris Lattner [Wed, 3 Mar 2010 21:56:57 +0000 (21:56 +0000)]
merge asm-2.c into asm.c, remove asm-inout.c because it is
XFAIL and already tracked in bugzilla.

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

14 years agofix PR6475, we were doing side-effecting stuff in an assert.
Chris Lattner [Wed, 3 Mar 2010 21:52:23 +0000 (21:52 +0000)]
fix PR6475, we were doing side-effecting stuff in an assert.

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

14 years agoAdd in more c++ header paths for later gccs under gentoo linux.
Eric Christopher [Wed, 3 Mar 2010 21:41:50 +0000 (21:41 +0000)]
Add in more c++ header paths for later gccs under gentoo linux.
Add in c header path for various linuxes as well.

Partial patch from Christian AdÃ¥ker!

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

14 years agoImplements mangling of local class names to
Fariborz Jahanian [Wed, 3 Mar 2010 19:41:08 +0000 (19:41 +0000)]
Implements mangling of local class names to
fix a code gen crash. This is WIP as not
all ABI cases are covered (there is a FIXME to
this effect). Fixes radar 7696748.

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

14 years agoadd framework for ARM builtins, Patch by Edmund Grimley Evans!
Chris Lattner [Wed, 3 Mar 2010 19:03:45 +0000 (19:03 +0000)]
add framework for ARM builtins, Patch by Edmund Grimley Evans!

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

14 years agoSimplify code a bit and remove unneeded semicolons.
Benjamin Kramer [Wed, 3 Mar 2010 16:28:47 +0000 (16:28 +0000)]
Simplify code a bit and remove unneeded semicolons.

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

14 years agoSketch out an implementation for __builtin_dwarf_cfa. I have no idea
John McCall [Wed, 3 Mar 2010 10:30:05 +0000 (10:30 +0000)]
Sketch out an implementation for __builtin_dwarf_cfa.  I have no idea
why the front-end is calculating the argument to llvm.eh.dwarf.cfa().

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

14 years agoAdd '-test-print-linkage-source' option to c-index-test
Ted Kremenek [Wed, 3 Mar 2010 06:37:58 +0000 (06:37 +0000)]
Add '-test-print-linkage-source' option to c-index-test
to test clang_getCursorLinkage()

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

14 years agoExport clang_getCursorLinkage().
Ted Kremenek [Wed, 3 Mar 2010 06:37:30 +0000 (06:37 +0000)]
Export clang_getCursorLinkage().

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

14 years agoAdd clang_getCursorLinkage(), which returns the
Ted Kremenek [Wed, 3 Mar 2010 06:36:57 +0000 (06:36 +0000)]
Add clang_getCursorLinkage(), which returns the
underlying linkage for the entity referred to by a
CXCursor.

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

14 years agoImplement __builtin_eh_return.
John McCall [Wed, 3 Mar 2010 05:38:58 +0000 (05:38 +0000)]
Implement __builtin_eh_return.

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

14 years agoFix a bug with base offset merging that Devang noticed.
Anders Carlsson [Wed, 3 Mar 2010 04:58:02 +0000 (04:58 +0000)]
Fix a bug with base offset merging that Devang noticed.

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

14 years agoImplement name hiding for names found through virtual base subobjects
Douglas Gregor [Wed, 3 Mar 2010 04:38:46 +0000 (04:38 +0000)]
Implement name hiding for names found through virtual base subobjects
that are hidden by other derived base subobjects reached along a
lookup path that does *not* pass through the hiding subobject (C++
[class.member.lookup]p6). Fixes PR6462.

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

14 years agoAdd proper target hooks for __builtin_extract_return_address and
John McCall [Wed, 3 Mar 2010 04:15:11 +0000 (04:15 +0000)]
Add proper target hooks for __builtin_extract_return_address and
__builtin_frob_return_address.  The implementations for both are
still trivial in the default case.

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

14 years agoDon't emit derived-to-base destructor aliases if we don't have a definition
John McCall [Wed, 3 Mar 2010 03:40:11 +0000 (03:40 +0000)]
Don't emit derived-to-base destructor aliases if we don't have a definition
for the base destructor, because aliases to declarations aren't legal.

Fixes PR 6471.

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

14 years agoRefactor CXXRecordDecl::lookupInBases() to push the recursion down a
Douglas Gregor [Wed, 3 Mar 2010 02:18:00 +0000 (02:18 +0000)]
Refactor CXXRecordDecl::lookupInBases() to push the recursion down a
level. No functionality change, and it obeys access control this
time.

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

14 years agoUse SVN_REVISION, not SVN_VERSION.
Ted Kremenek [Wed, 3 Mar 2010 01:30:39 +0000 (01:30 +0000)]
Use SVN_REVISION, not SVN_VERSION.

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

14 years agoFix an algorithmic bug in LiveVariables pointed out by Zhongxing.
Ted Kremenek [Wed, 3 Mar 2010 01:17:41 +0000 (01:17 +0000)]
Fix an algorithmic bug in LiveVariables pointed out by Zhongxing.
If an initializer in a DeclStmt references the declared variable, that
extends the liveness of that variable.

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

14 years agoRevert r97618. Access control sucks
Douglas Gregor [Wed, 3 Mar 2010 01:13:25 +0000 (01:13 +0000)]
Revert r97618. Access control sucks

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

14 years agoMake getClangRevision() check that SVN_VERSION is an empty string
Ted Kremenek [Wed, 3 Mar 2010 01:02:48 +0000 (01:02 +0000)]
Make getClangRevision() check that SVN_VERSION is an empty string
(even if it is defined).  This fixes the issue of this function
returning '0' when SVN_VERSION is defined to be "".

Fixes: <rdar://problem/7663667>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97620 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd comments to test case.
Zhongxing Xu [Wed, 3 Mar 2010 01:02:48 +0000 (01:02 +0000)]
Add comments to test case.

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

14 years agoFactor out the recursive lookup into C++ base classes into a separate,
Douglas Gregor [Wed, 3 Mar 2010 01:02:31 +0000 (01:02 +0000)]
Factor out the recursive lookup into C++ base classes into a separate,
static function. No functionality change.

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

14 years agoInitialize your storage, dummy
Douglas Gregor [Wed, 3 Mar 2010 00:29:43 +0000 (00:29 +0000)]
Initialize your storage, dummy

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

14 years agoDon't use echo in the Index test, which I hope will work around an intermittent Windo...
Douglas Gregor [Wed, 3 Mar 2010 00:03:22 +0000 (00:03 +0000)]
Don't use echo in the Index test, which I hope will work around an intermittent Windows failure

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

14 years agoEliminate the static map of overridden C++ methods, which was going to
Douglas Gregor [Tue, 2 Mar 2010 23:58:15 +0000 (23:58 +0000)]
Eliminate the static map of overridden C++ methods, which was going to
come back to bite us at some point.

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

14 years agoSuppress implicit member redeclarations arising from explicit instantiation
John McCall [Tue, 2 Mar 2010 23:09:38 +0000 (23:09 +0000)]
Suppress implicit member redeclarations arising from explicit instantiation
declarations after the member has been explicitly specialized.  We already
did this after explicit instantiation definitions;  not doing it for
declarations meant that subsequent definitions would see a previous
member declaration with specialization kind "explicit instantiation decl",
which would then happily get overridden.

Fixes PR 6458.

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

14 years ago[CFG]
Ted Kremenek [Tue, 2 Mar 2010 21:43:54 +0000 (21:43 +0000)]
[CFG]

After discussion with Zhongxing, don't force the initializer of DeclStmts to be
block-level expressions.

This led to some interesting fallout:

[UninitializedValues]

Always visit the initializer of DeclStmts (do not assume they are block-level expressions).

[BasicStore]

With initializers of DeclStmts no longer block-level expressions, this causes self-referencing initializers (e.g. 'int x = x') to no longer cause the initialized variable to be live before the DeclStmt.  While this is correct, it caused BasicStore::RemoveDeadBindings() to prune off the values of these variables from the initial store (where they are set to uninitialized).  The fix is to back-port some (and only some) of the lazy-binding logic from RegionStore to
BasicStore.  Now the default values of local variables are determined lazily as opposed
to explicitly initialized.

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

14 years agoDon't conjure a symbol for DeclStmts when the variable is a C++ reference.
Ted Kremenek [Tue, 2 Mar 2010 21:43:52 +0000 (21:43 +0000)]
Don't conjure a symbol for DeclStmts when the variable is a C++ reference.

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

14 years agoDuring codegen assert that any copy assignment, destructor or constructor that
Rafael Espindola [Tue, 2 Mar 2010 21:28:26 +0000 (21:28 +0000)]
During codegen assert that any copy assignment, destructor or constructor that
we need to synthesize has been marked as used by Sema.

Change Sema to avoid these asserts.

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

14 years agoBump the default maximum template-instantiation depth to 500, as in
Douglas Gregor [Tue, 2 Mar 2010 19:14:36 +0000 (19:14 +0000)]
Bump the default maximum template-instantiation depth to 500, as in
GCC. Fixes PR6301.

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

14 years agoAdd test case from PR6064, which now works
Douglas Gregor [Tue, 2 Mar 2010 18:48:07 +0000 (18:48 +0000)]
Add test case from PR6064, which now works

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

14 years agoDiagnose the declaration of enum templates. Also, be a bit more
Douglas Gregor [Tue, 2 Mar 2010 17:53:14 +0000 (17:53 +0000)]
Diagnose the declaration of enum templates. Also, be a bit more
careful about value-dependent enumerators. Fixes PR5786.

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

14 years agoMove Emit24 to clang::io
Kovarththanan Rajaratnam [Tue, 2 Mar 2010 17:41:26 +0000 (17:41 +0000)]
Move Emit24 to clang::io

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

14 years agoUse CXXTemporaryObjectExpr for explicitly-constructed temporaries. We
Douglas Gregor [Tue, 2 Mar 2010 17:18:33 +0000 (17:18 +0000)]
Use CXXTemporaryObjectExpr for explicitly-constructed temporaries. We
used to do this, but it got lost when we switched functional-style
cast syntax over to using the new initialization code. Fixes PR6457.

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

14 years agoPass -m32 and -m64 to the static analyzer when using scan-build. Now we can
Charles Davis [Tue, 2 Mar 2010 15:26:41 +0000 (15:26 +0000)]
Pass -m32 and -m64 to the static analyzer when using scan-build. Now we can
use scan-build with Wine, for example.

Ted, I hope this is OK.

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

14 years agoRegister all parameters even if they didn't occur in the function body.
Zhongxing Xu [Tue, 2 Mar 2010 10:08:30 +0000 (10:08 +0000)]
Register all parameters even if they didn't occur in the function body.
We may query their liveness because they are added to store when passing
argument values.

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

14 years agoUnify initializer-instantiation code for variable declarations and
Douglas Gregor [Tue, 2 Mar 2010 07:38:39 +0000 (07:38 +0000)]
Unify initializer-instantiation code for variable declarations and
base/member initializers.

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

14 years agoSimplify code.
Anders Carlsson [Tue, 2 Mar 2010 05:40:45 +0000 (05:40 +0000)]
Simplify code.

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

14 years agoInspired by seeing "MIPS" go by in the commits, I've gone ahead and
John McCall [Tue, 2 Mar 2010 03:50:12 +0000 (03:50 +0000)]
Inspired by seeing "MIPS" go by in the commits, I've gone ahead and
implemented a (codegen) target hook for __builtin_extend_pointer.
I'm also making it return a uint64_t instead of an unsigned word;  this
comports with typical usage (i.e. the one use I know of).

I don't know if any of the existing targets requires this hook to be
set (other than x86 and x86_64, which I know do not).

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

14 years agoRename BaseOffset to Offset and make it signed in preparation of more construction...
Anders Carlsson [Tue, 2 Mar 2010 03:44:06 +0000 (03:44 +0000)]
Rename BaseOffset to Offset and make it signed in preparation of more construction vtable work.

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

14 years agoAdd in some more MIPS command line options.
Eric Christopher [Tue, 2 Mar 2010 02:41:08 +0000 (02:41 +0000)]
Add in some more MIPS command line options.

Patch by Oleksandr Tymoshenko!

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

14 years agoAfter much consultation aimed at figuring out what this builtin actually
John McCall [Tue, 2 Mar 2010 02:31:24 +0000 (02:31 +0000)]
After much consultation aimed at figuring out what this builtin actually
does, document the results and then implement __builtin_extend_pointer for
platforms where it's a no-op.

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

14 years agoAdd test case from PR5812, which works now.
Douglas Gregor [Tue, 2 Mar 2010 01:36:28 +0000 (01:36 +0000)]
Add test case from PR5812, which works now.

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

14 years agoFix an amusing typo that completely the re-introduction of parameters
Douglas Gregor [Tue, 2 Mar 2010 01:29:43 +0000 (01:29 +0000)]
Fix an amusing typo that completely the re-introduction of parameters
for the purposes of parsing default arguments. In effect, we would
re-introduce the parameter with a default argument N times (where N is
the number of parameters preceding the parameter with a default
argument). This showed up when a defaulted parameter of a member
function of a local class shadowed a parameter of the enclosing
function. Fixes PR6383.

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

14 years agoCast a pointer to 'long long' to satisfy all compilation models.
Fariborz Jahanian [Tue, 2 Mar 2010 01:19:04 +0000 (01:19 +0000)]
Cast a pointer to 'long long' to satisfy all compilation models.
Satisfies radar 7703202.

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

14 years agoAdd comment
Douglas Gregor [Tue, 2 Mar 2010 00:25:00 +0000 (00:25 +0000)]
Add comment

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

14 years agoWhen we're parsing template names as part of base-specifiers, we are
Douglas Gregor [Mon, 1 Mar 2010 23:49:23 +0000 (23:49 +0000)]
When we're parsing template names as part of base-specifiers, we are
*not* entering the context of the nested-name-specifier. This was
causing us to look into an uninstantiated template that we shouldn't
look into. Fixes PR6376.

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

14 years agoSplit out types that are non-canonical unless dependent as their own
John McCall [Mon, 1 Mar 2010 23:49:17 +0000 (23:49 +0000)]
Split out types that are non-canonical unless dependent as their own
category.  Use this in a few places to eliminate unnecessary TST cases and
do some future-proofing.  Provide terrible manglings for typeof.  Mangle
decltype with some hope of accuracy.

Our manglings for some of the cases covered in the testcase are different
from gcc's, which I've raised as an issue with the ABI list.

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

14 years agoMore rewriter of nested blocks fun stuff.
Fariborz Jahanian [Mon, 1 Mar 2010 23:36:21 +0000 (23:36 +0000)]
More rewriter of nested blocks fun stuff.
Radar 7696893.

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

14 years agoUnbreak the build
Douglas Gregor [Mon, 1 Mar 2010 23:31:19 +0000 (23:31 +0000)]
Unbreak the build

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

14 years agoKeep an explicit stack of function and block scopes, each element of
Douglas Gregor [Mon, 1 Mar 2010 23:15:13 +0000 (23:15 +0000)]
Keep an explicit stack of function and block scopes, each element of
which has the label map, switch statement stack, etc. Previously, we
had a single set of maps in Sema (for the function) along with a stack
of block scopes. However, this lead to funky behavior with nested
functions, e.g., in the member functions of local classes.

The explicit-stack approach is far cleaner, and we retain a 1-element
cache so that we're not malloc/free'ing every time we enter a
function. Fixes PR6382.

Also, tweaked the unused-variable warning suppression logic to look at
errors within a given Scope rather than within a given function. The
prior code wasn't looking at the right number-of-errors count when
dealing with blocks, since the block's count would be deallocated
before we got to ActOnPopScope. This approach works with nested
blocks/functions, and gives tighter error recovery.

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

14 years agoFix the lookup of names used in a friend declaration to not attempt to
Chandler Carruth [Mon, 1 Mar 2010 21:17:36 +0000 (21:17 +0000)]
Fix the lookup of names used in a friend declaration to not attempt to
re-declare them. This fixes PR6317. Also add the beginnings of an interesting
test case for p1 of [class.friend] which also covers PR6317.

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

14 years agofix PR5933: don't warn about unused variables if a function has other errors in it.
Chris Lattner [Mon, 1 Mar 2010 21:06:03 +0000 (21:06 +0000)]
fix PR5933: don't warn about unused variables if a function has other errors in it.

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

14 years agoImplement jump checking for initialized c++ variables, implementing
Chris Lattner [Mon, 1 Mar 2010 20:59:53 +0000 (20:59 +0000)]
Implement jump checking for initialized c++ variables, implementing
a fixme and PR6451.

Only perform jump checking if the containing function has no errors,
and add the infrastructure needed to do this.

On the testcase in the PR, we produce:

t.cc:6:3: error: illegal goto into protected scope
  goto later;
  ^
t.cc:7:5: note: jump bypasses variable initialization
  X x;
    ^

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

14 years agoavoid issues with the new scope protector. Previously we'd error
Chris Lattner [Mon, 1 Mar 2010 20:56:44 +0000 (20:56 +0000)]
avoid issues with the new scope protector.  Previously we'd error
with "address taken of label in protected scope, jump to it would have unknown effect on scope"

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

14 years agoStart detangling the BlockSemaInfo/Sema mess. No functionality change.
Douglas Gregor [Mon, 1 Mar 2010 20:44:28 +0000 (20:44 +0000)]
Start detangling the BlockSemaInfo/Sema mess. No functionality change.

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

14 years agoAllow a '0' precision in format strings (as the man page says it is okay).
Ted Kremenek [Mon, 1 Mar 2010 19:22:33 +0000 (19:22 +0000)]
Allow a '0' precision in format strings (as the man page says it is okay).
Fixes <rdar://problem/7700339>.

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

14 years agoThe latest draft uses 'dt' to mangle member expressions, and now so do we.
John McCall [Mon, 1 Mar 2010 19:12:25 +0000 (19:12 +0000)]
The latest draft uses 'dt' to mangle member expressions, and now so do we.

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

14 years agoWhen looking for a redeclaration of a static variable, only look for redeclarations...
Douglas Gregor [Mon, 1 Mar 2010 19:11:54 +0000 (19:11 +0000)]
When looking for a redeclaration of a static variable, only look for redeclarations. Fixes PR6449

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

14 years agoWhen instantiating a function-scoped enum, make sure that it and its
Douglas Gregor [Mon, 1 Mar 2010 19:00:07 +0000 (19:00 +0000)]
When instantiating a function-scoped enum, make sure that it and its
enumeration constants get placed into the local instantiation hash
table. Fixes PR6375.

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

14 years agoRobustify instantiation of templates when there are errors in the
Douglas Gregor [Mon, 1 Mar 2010 18:27:54 +0000 (18:27 +0000)]
Robustify instantiation of templates when there are errors in the
template definition. Do this both by being more tolerant of errors in
our asserts and by not dropping a variable declaration completely when
its initializer is ill-formed. Fixes the crash-on-invalid in PR6375,
but not the original issue.

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

14 years agoDon't infinite-loop if TryAnnotateCXXScopeToken fails to annotate but doesn't
John McCall [Mon, 1 Mar 2010 18:20:46 +0000 (18:20 +0000)]
Don't infinite-loop if TryAnnotateCXXScopeToken fails to annotate but doesn't
signal an error.  This can happen even when the current token is '::' if
this is a ::new or ::delete expression.

This was an oversight in my recent parser refactor;  fixes PR 5825.

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

14 years agoFinish pushing source-location information though TreeTransform's
Douglas Gregor [Mon, 1 Mar 2010 17:25:41 +0000 (17:25 +0000)]
Finish pushing source-location information though TreeTransform's
TransformDefinition.

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

14 years agoWhen looking for the instantiated declaration that corresponds to a
Douglas Gregor [Mon, 1 Mar 2010 15:56:25 +0000 (15:56 +0000)]
When looking for the instantiated declaration that corresponds to a
given declaration in a template, make sure that the context we're
searching through is complete. Fixes PR6376.

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

14 years agoSince now we store the cast type with an ElementRegion, there is
Zhongxing Xu [Mon, 1 Mar 2010 06:56:52 +0000 (06:56 +0000)]
Since now we store the cast type with an ElementRegion, there is
no need to store a type with SymbolRegionValue.

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

14 years agoAssert when loading from a code text region instead of returning an unknown silently.
Zhongxing Xu [Mon, 1 Mar 2010 05:29:02 +0000 (05:29 +0000)]
Assert when loading from a code text region instead of returning an unknown silently.

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

14 years agoAdd comments.
Zhongxing Xu [Mon, 1 Mar 2010 03:48:10 +0000 (03:48 +0000)]
Add comments.

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

14 years agoDon't warn about case-value conversions from a negative value to a
Douglas Gregor [Mon, 1 Mar 2010 01:04:55 +0000 (01:04 +0000)]
Don't warn about case-value conversions from a negative value to a
larger unsigned value, since this is implementation-defined
behavior. (We previously suppressed this warning when converting from
a signed value to an unsigned value of the same size).

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

14 years agoPass '-no-canonical-prefixes' on down to GCC. It's not specific to the Clang
Chandler Carruth [Sun, 28 Feb 2010 22:33:07 +0000 (22:33 +0000)]
Pass '-no-canonical-prefixes' on down to GCC. It's not specific to the Clang
driver and was in fact based on a feature in GCC. =]

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

14 years agoImprove name mangling for dependently-scoped declaration references.
Douglas Gregor [Sun, 28 Feb 2010 22:05:49 +0000 (22:05 +0000)]
Improve name mangling for dependently-scoped declaration references.

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

14 years agoAdd name mangling for DeclRefExprs that refer to external names
Douglas Gregor [Sun, 28 Feb 2010 21:40:32 +0000 (21:40 +0000)]
Add name mangling for DeclRefExprs that refer to external names

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

14 years agoRemove debug output.
Anders Carlsson [Sun, 28 Feb 2010 18:39:30 +0000 (18:39 +0000)]
Remove debug output.

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

14 years agoHandle unused functions in construction vtables correctly.
Anders Carlsson [Sun, 28 Feb 2010 18:37:33 +0000 (18:37 +0000)]
Handle unused functions in construction vtables correctly.

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

14 years agopull some altivec stuff out of line.
Chris Lattner [Sun, 28 Feb 2010 18:33:55 +0000 (18:33 +0000)]
pull some altivec stuff out of line.

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

14 years agoWarn about the deprecated string literal -> char* conversion. Fixes PR6428.
Douglas Gregor [Sun, 28 Feb 2010 18:30:25 +0000 (18:30 +0000)]
Warn about the deprecated string literal -> char* conversion. Fixes PR6428.

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

14 years agoImplement PR6423 by using one token of lookahead to disambiguate
Chris Lattner [Sun, 28 Feb 2010 18:18:36 +0000 (18:18 +0000)]
Implement PR6423 by using one token of lookahead to disambiguate
an *almost* always incorrect case.  This only does the lookahead
in the insanely unlikely case, so it shouldn't impact performance.

On this testcase:

struct foo {
}
typedef int x;

Before:

t.c:3:9: error: cannot combine with previous 'struct' declaration specifier
typedef int x;
        ^

After:

t.c:2:2: error: expected ';' after struct
}
 ^
 ;

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

14 years agoWhen laying out vtables for virtual bases in construction vtables, we need to check...
Anders Carlsson [Sun, 28 Feb 2010 18:08:38 +0000 (18:08 +0000)]
When laying out vtables for virtual bases in construction vtables, we need to check if the vtable is a primary base in the layout class.

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

14 years agoAdd another construction vtable test.
Anders Carlsson [Sun, 28 Feb 2010 17:59:36 +0000 (17:59 +0000)]
Add another construction vtable test.

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

14 years agoSupport constant-evaluation of __builtin_nans* as well as the correct constant
John McCall [Sun, 28 Feb 2010 13:00:19 +0000 (13:00 +0000)]
Support constant-evaluation of __builtin_nans* as well as the correct constant
evaluation of __builtin_nan*.  Most of the work to make this work is in LLVM.

Fixes <rdar://problem/7696712> and part of PR 5255.

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

14 years agoUse getBody() to get the function definition when the decl referenced is not
Zhongxing Xu [Sun, 28 Feb 2010 06:39:11 +0000 (06:39 +0000)]
Use getBody() to get the function definition when the decl referenced is not
definition.

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

14 years agoFix typo.
Ted Kremenek [Sun, 28 Feb 2010 05:14:08 +0000 (05:14 +0000)]
Fix typo.

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

14 years agoMore improvements to construction vtables; we know handle vbase offsets correctly...
Anders Carlsson [Sun, 28 Feb 2010 01:43:58 +0000 (01:43 +0000)]
More improvements to construction vtables; we know handle vbase offsets correctly (I hope).

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

14 years agoOpt into the Verifier now that it's an opt-in feature of
Dan Gohman [Sun, 28 Feb 2010 00:55:40 +0000 (00:55 +0000)]
Opt into the Verifier now that it's an opt-in feature of
addPassesToEmitFile.

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

14 years agoPass information about whether a base is virtual or not down to getCtorVtable, we...
Anders Carlsson [Sun, 28 Feb 2010 00:36:23 +0000 (00:36 +0000)]
Pass information about whether a base is virtual or not down to getCtorVtable, we need this information in the vtable builder.

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

14 years agoAdd new function.
Anders Carlsson [Sun, 28 Feb 2010 00:10:58 +0000 (00:10 +0000)]
Add new function.

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

14 years agoFix to dumpLayout; we want to be able to dump address points even if the vtable doesn...
Anders Carlsson [Sat, 27 Feb 2010 23:58:01 +0000 (23:58 +0000)]
Fix to dumpLayout; we want to be able to dump address points even if the vtable doesn't have any methods.

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

14 years agoDebian sid moved these headers into /4.4 and left /4.4.3 as a symlink. Update.
Nick Lewycky [Sat, 27 Feb 2010 22:35:43 +0000 (22:35 +0000)]
Debian sid moved these headers into /4.4 and left /4.4.3 as a symlink. Update.
Also, add support for 32-bit x86 Debian sid.

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

14 years agoAdd a simple construction vtable test.
Anders Carlsson [Sat, 27 Feb 2010 21:09:00 +0000 (21:09 +0000)]
Add a simple construction vtable test.

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

14 years agoStart fleshing out construction vtable support.
Anders Carlsson [Sat, 27 Feb 2010 20:39:05 +0000 (20:39 +0000)]
Start fleshing out construction vtable support.

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

14 years agoEnable the new vtable layout code for vtables that aren't construction vtables. ...
Anders Carlsson [Sat, 27 Feb 2010 20:02:53 +0000 (20:02 +0000)]
Enable the new vtable layout code for vtables that aren't construction vtables. (This doesn't mean that we emit LLVM IR using it yet, it just means that it's running and hopefully not crashing or asserting).

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

14 years agoMove ComputeThisAdjustmentBaseOffset to VtableBuilder.
Anders Carlsson [Sat, 27 Feb 2010 19:57:44 +0000 (19:57 +0000)]
Move ComputeThisAdjustmentBaseOffset to VtableBuilder.

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

14 years agoMake sure to insert the primary base in the set :)
Anders Carlsson [Sat, 27 Feb 2010 19:51:04 +0000 (19:51 +0000)]
Make sure to insert the primary base in the set :)

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

14 years agoUse the real base offset when calculating vbase offsets.
Anders Carlsson [Sat, 27 Feb 2010 19:21:58 +0000 (19:21 +0000)]
Use the real base offset when calculating vbase offsets.

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

14 years agoFigured out why the test was failing, this will hopefully fix it.
Anders Carlsson [Sat, 27 Feb 2010 19:00:53 +0000 (19:00 +0000)]
Figured out why the test was failing, this will hopefully fix it.

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

14 years agoDon't add this adjustments for pure virtual member functions.
Anders Carlsson [Sat, 27 Feb 2010 18:16:50 +0000 (18:16 +0000)]
Don't add this adjustments for pure virtual member functions.

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

14 years agoWe want to store method info for unused functions.
Anders Carlsson [Sat, 27 Feb 2010 18:09:40 +0000 (18:09 +0000)]
We want to store method info for unused functions.

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