]> granicus.if.org Git - clang/log
clang
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

14 years agoXFAIL this for now. I have no idea why this test is failing on some machines. Looks...
Anders Carlsson [Sat, 27 Feb 2010 18:09:05 +0000 (18:09 +0000)]
XFAIL this for now. I have no idea why this test is failing on some machines. Looks like some sort of whitespace issue in FileCheck.

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

14 years agoRevert 97324. Chris says this cleanup could hurt -E performance.
Benjamin Kramer [Sat, 27 Feb 2010 18:02:51 +0000 (18:02 +0000)]
Revert 97324. Chris says this cleanup could hurt -E performance.

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

14 years agoMove method out-of-line. I thought this would be a candidate for inlining but I was...
Benjamin Kramer [Sat, 27 Feb 2010 17:05:45 +0000 (17:05 +0000)]
Move method out-of-line. I thought this would be a candidate for inlining but I was wrong.

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

14 years agoAdd another test.
Anders Carlsson [Sat, 27 Feb 2010 16:55:58 +0000 (16:55 +0000)]
Add another test.

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

14 years agoFinish up the changes to this adjustments.
Anders Carlsson [Sat, 27 Feb 2010 16:52:49 +0000 (16:52 +0000)]
Finish up the changes to this adjustments.

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

14 years agoAnother trivial getSpelling simplification.
Benjamin Kramer [Sat, 27 Feb 2010 16:29:36 +0000 (16:29 +0000)]
Another trivial getSpelling simplification.

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

14 years agoStub out more of the 'this' pointer adjustment fixes I've been planning. Start using...
Anders Carlsson [Sat, 27 Feb 2010 16:18:19 +0000 (16:18 +0000)]
Stub out more of the 'this' pointer adjustment fixes I've been planning. Start using a set vector for primary bases so they will be ordered.

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

14 years agoSimplify code.
Benjamin Kramer [Sat, 27 Feb 2010 14:22:08 +0000 (14:22 +0000)]
Simplify code.

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

14 years agoFix thinko.
Benjamin Kramer [Sat, 27 Feb 2010 14:15:42 +0000 (14:15 +0000)]
Fix thinko.

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

14 years agoAdd an overload of Preprocessor::getSpelling which takes a SmallVector and
Benjamin Kramer [Sat, 27 Feb 2010 13:44:12 +0000 (13:44 +0000)]
Add an overload of Preprocessor::getSpelling which takes a SmallVector and
returns a StringRef. Use it to simplify some repetitive code.

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

14 years agoFix crasher caused by setting a bit in a possibly empty bitvector while
Ted Kremenek [Sat, 27 Feb 2010 08:34:51 +0000 (08:34 +0000)]
Fix crasher caused by setting a bit in a possibly empty bitvector while
doing printf format string checking.  This is a recent regression.

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

14 years agoWire up Daniel's new spiffy C interpreter into the CMake build system
Kovarththanan Rajaratnam [Sat, 27 Feb 2010 07:46:49 +0000 (07:46 +0000)]
Wire up Daniel's new spiffy C interpreter into the CMake build system

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

14 years agoAdd comment
Kovarththanan Rajaratnam [Sat, 27 Feb 2010 07:06:44 +0000 (07:06 +0000)]
Add comment

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

14 years agoAdd header + comments
Kovarththanan Rajaratnam [Sat, 27 Feb 2010 07:05:56 +0000 (07:05 +0000)]
Add header + comments

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

14 years agoFix another vtable layout bug; we weren't looking hard enough for overriden functions...
Anders Carlsson [Sat, 27 Feb 2010 06:38:03 +0000 (06:38 +0000)]
Fix another vtable layout bug; we weren't looking hard enough for overriden functions when determining if an overrider will ever be used.

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

14 years agoHandle vcall offset sharing between destructors.
Anders Carlsson [Sat, 27 Feb 2010 04:12:52 +0000 (04:12 +0000)]
Handle vcall offset sharing between destructors.

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

14 years agoFix a bug where we were generating an unnecessary vtable for a virtual base that...
Anders Carlsson [Sat, 27 Feb 2010 04:05:52 +0000 (04:05 +0000)]
Fix a bug where we were generating an unnecessary vtable for a virtual base that's already a primary virtual base.

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

14 years agoAdd test case for inlining call analysis.
Zhongxing Xu [Sat, 27 Feb 2010 02:44:37 +0000 (02:44 +0000)]
Add test case for inlining call analysis.

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

14 years agoRobustify SourceManager::getLocation(), so that it returns an
Douglas Gregor [Sat, 27 Feb 2010 02:42:25 +0000 (02:42 +0000)]
Robustify SourceManager::getLocation(), so that it returns an
end-of-line source location when given a column number beyond the
length of the line, or an end-of-file source location when given a
line number beyond the length of the file. Previously, we would return
an invalid location.

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

14 years agoAdd reference to positional arguments documentation.
Ted Kremenek [Sat, 27 Feb 2010 01:46:29 +0000 (01:46 +0000)]
Add reference to positional arguments documentation.

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

14 years agoFor printf format string checking, add support for positional format strings.
Ted Kremenek [Sat, 27 Feb 2010 01:41:03 +0000 (01:41 +0000)]
For printf format string checking, add support for positional format strings.
Along the way, coelesce some of the diagnostics.

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

14 years agoWhen given unsaved files in clang_createTranslationUnitFromSourceFile,
Douglas Gregor [Sat, 27 Feb 2010 01:32:48 +0000 (01:32 +0000)]
When given unsaved files in clang_createTranslationUnitFromSourceFile,
copy the source buffers provided rather than referencing them
directly, so that the caller can free those buffers immediately after
calling clang_createTranslationUnitFromSourceFile(). Otherwise, we
risk hitting those buffers later (when building source ranges, forming
diagnostics, etc.).

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

14 years agoSkip dependent virtual base classes; fixes PR6413.
Douglas Gregor [Sat, 27 Feb 2010 00:25:28 +0000 (00:25 +0000)]
Skip dependent virtual base classes; fixes PR6413.

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

14 years agoPut BadLiteral in the NonGCC group. I'd completely forgotten about this.
John McCall [Fri, 26 Feb 2010 23:48:57 +0000 (23:48 +0000)]
Put BadLiteral in the NonGCC group.  I'd completely forgotten about this.

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

14 years agoAt sabre's request, drop the FP bounds diagnostics down to warnings and file
John McCall [Fri, 26 Feb 2010 23:35:57 +0000 (23:35 +0000)]
At sabre's request, drop the FP bounds diagnostics down to warnings and file
them under -Wbad-literal.  They're still on by default.

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

14 years agoPrevent rewriter crash when variable type is missing.
Fariborz Jahanian [Fri, 26 Feb 2010 22:49:11 +0000 (22:49 +0000)]
Prevent rewriter crash when variable type is missing.
Fixes radar 7692183.

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

14 years agoMinor cleanup of the rewriter.
Fariborz Jahanian [Fri, 26 Feb 2010 22:36:30 +0000 (22:36 +0000)]
Minor cleanup of the rewriter.

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

14 years agoRemoved some unused code in rewriter.
Fariborz Jahanian [Fri, 26 Feb 2010 21:46:27 +0000 (21:46 +0000)]
Removed some unused code in rewriter.

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

14 years agoSundry fixes to the new vtable builder.
John McCall [Fri, 26 Feb 2010 20:22:44 +0000 (20:22 +0000)]
Sundry fixes to the new vtable builder.

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

14 years agoFix rewriting of byref variables in nested blocks.
Fariborz Jahanian [Fri, 26 Feb 2010 19:55:31 +0000 (19:55 +0000)]
Fix rewriting of byref variables in nested blocks.
Fixes radar 7692350.

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

14 years agofix rdar://7683173, rejecting an invalid conditional
Chris Lattner [Fri, 26 Feb 2010 19:42:53 +0000 (19:42 +0000)]
fix rdar://7683173, rejecting an invalid conditional

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

14 years agoFor printf format string checking, move the tracking of the data argument index out of
Ted Kremenek [Fri, 26 Feb 2010 19:18:41 +0000 (19:18 +0000)]
For printf format string checking, move the tracking of the data argument index out of
Sema and into analyze_printf::ParseFormatString().  Also use a bitvector to determine
what arguments have been covered (instead of just checking to see if the last argument consumed is the max argument).  This is prep. for support positional arguments (an IEEE extension).

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

14 years agoRewriting of imported variable from outer
Fariborz Jahanian [Fri, 26 Feb 2010 19:05:20 +0000 (19:05 +0000)]
Rewriting of imported variable from outer
blocks's argument in the inner block requires special treatment.
Fixes radar 7692419.

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

14 years agoUse a GDM to record the returned expression in the state when VisitReturnStmt.
Zhongxing Xu [Fri, 26 Feb 2010 15:43:34 +0000 (15:43 +0000)]
Use a GDM to record the returned expression in the state when VisitReturnStmt.
Use this information to find the returned value and bind it to CallExpr in
ProcessCallExit.
And there is no need to remove dead bindings in ProcessCallExit, because
a. it would clean up the return value bound to CallExpr
b. we still would do it in the next ProcessStmt(), where we would not misclean
   up the return value.

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

14 years agoMake the destructor public. ddunbar, lemme know if you'd prefer a different
Chandler Carruth [Fri, 26 Feb 2010 08:51:12 +0000 (08:51 +0000)]
Make the destructor public. ddunbar, lemme know if you'd prefer a different
fix, just trying to get the build bots happy again.

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

14 years agoMake GDM private.
Zhongxing Xu [Fri, 26 Feb 2010 08:46:13 +0000 (08:46 +0000)]
Make GDM private.

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

14 years agoFix an assertion-on-error during tentative constructor parsing by
John McCall [Fri, 26 Feb 2010 08:45:28 +0000 (08:45 +0000)]
Fix an assertion-on-error during tentative constructor parsing by
propagating error conditions out of the various annotate-me-a-snowflake
routines.  Generally (but not universally) removes redundant diagnostics
as well as, you know, not crashing on bad code.  On the other hand,
I have just signed myself up to fix fiddly parser errors for the next
week.  Again.

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

14 years agoAn explicit specialization is allowed following an explicit
Douglas Gregor [Fri, 26 Feb 2010 06:03:23 +0000 (06:03 +0000)]
An explicit specialization is allowed following an explicit
instantiation so long as that explicit specialization was declared
previously. Fixes PR6160.

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

14 years agoImplement semantic analysis for C++ [expr.new]p18-20, which describe
Douglas Gregor [Fri, 26 Feb 2010 05:06:18 +0000 (05:06 +0000)]
Implement semantic analysis for C++ [expr.new]p18-20, which describe
how we find the operator delete that matches withe operator new we
found in a C++ new-expression.

This will also need CodeGen support. On a happy note, we're now a
"nans" away from building tramp3d-v4.

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

14 years agoRemove derelict GRStmtNodeBuilder::LastNode.
Zhongxing Xu [Fri, 26 Feb 2010 02:38:09 +0000 (02:38 +0000)]
Remove derelict GRStmtNodeBuilder::LastNode.

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

14 years agoSupport rewriting of property synthesis with retain/copy
Fariborz Jahanian [Fri, 26 Feb 2010 01:42:20 +0000 (01:42 +0000)]
Support rewriting of property synthesis with retain/copy
attributes. Fixes radar 7214439.

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

14 years agoCommit Eli's fix for implicit conversions to array type. Fixes PR6264.
Douglas Gregor [Fri, 26 Feb 2010 01:17:27 +0000 (01:17 +0000)]
Commit Eli's fix for implicit conversions to array type. Fixes PR6264.

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

14 years agoDon't generate method metadata for @dynamic properties. Fixes PR6354.
David Chisnall [Fri, 26 Feb 2010 01:11:38 +0000 (01:11 +0000)]
Don't generate method metadata for @dynamic properties.  Fixes PR6354.

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

14 years agoUse the power of types to track down another canonicalization bug in
John McCall [Fri, 26 Feb 2010 00:48:12 +0000 (00:48 +0000)]
Use the power of types to track down another canonicalization bug in
the ABI-computation interface.  Fixes <rdar://problem/7691046>.

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

14 years agoMake sure to mark constructors, operator new, and operator delete as
Douglas Gregor [Fri, 26 Feb 2010 00:38:10 +0000 (00:38 +0000)]
Make sure to mark constructors, operator new, and operator delete as
used when we instantiate C++ new expressions, delete expressions, and
object-construction expressions. Fixes PR6424, although we can't test
all of it until we finish implementing lookup of "operator delete" for
new expressions (!).

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

14 years agoUpdate checker build.
Ted Kremenek [Fri, 26 Feb 2010 00:07:31 +0000 (00:07 +0000)]
Update checker build.

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

14 years agoWhen we decide to re-use an existing CXXConstructExpr node, make sure
Douglas Gregor [Fri, 26 Feb 2010 00:01:57 +0000 (00:01 +0000)]
When we decide to re-use an existing CXXConstructExpr node, make sure
to mark the constructor as referenced. Fixes the narrow issue reported
in PR6424, but there are a few other places that I'll fix before
closing out that PR.

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