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

14 years agoWhen computing the composite pointer type for relational comparisons,
Douglas Gregor [Thu, 25 Feb 2010 22:29:57 +0000 (22:29 +0000)]
When computing the composite pointer type for relational comparisons,
equality comparisons, and conditional operators, produce a composite
pointer type with the appropriate additional "const" qualifiers if the
pointer types would otherwise be incompatible. This is a small
extension (also present in GCC and EDG in a slightly different form)
that permits code like:

  void** i; void const** j;
  i == j;

with the following extwarn:

t.cpp:5:5: warning: comparison of distinct pointer types ('void **' and
      'void const **') uses non-standard composite pointer type
      'void const *const *' [-pedantic]
  i == j;
  ~ ^  ~

Fixes PR6346, and I'll be filing a core issue about this with the C++
committee.

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

14 years agoImprove vcall offset handling.
Anders Carlsson [Thu, 25 Feb 2010 22:23:13 +0000 (22:23 +0000)]
Improve vcall offset handling.

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

14 years agoFux a bug where we were trying to add overriders for non-virtual bases of virtual...
Anders Carlsson [Thu, 25 Feb 2010 22:18:35 +0000 (22:18 +0000)]
Fux a bug where we were trying to add overriders for non-virtual bases of virtual bases more than once.

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

14 years agoMove ~CodeGenAction out-of-line.
Daniel Dunbar [Thu, 25 Feb 2010 20:37:44 +0000 (20:37 +0000)]
Move ~CodeGenAction out-of-line.

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

14 years agoRestore Zhongxing's commits r97122 r97127 r97129 r97131 which were reverted due to...
Douglas Gregor [Thu, 25 Feb 2010 19:01:53 +0000 (19:01 +0000)]
Restore Zhongxing's commits r97122 r97127 r97129 r97131 which were reverted due to a Clang-on-Clang failure

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

14 years agoAllow us to compare derived-to-base conversions between a reference
Douglas Gregor [Thu, 25 Feb 2010 19:01:05 +0000 (19:01 +0000)]
Allow us to compare derived-to-base conversions between a reference
binding and a copy-construction. Fixes an overloading problem in the
Clang-on-Clang build.

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

14 years agoForgot to include nested protocols in collection, resulting in
Fariborz Jahanian [Thu, 25 Feb 2010 18:24:33 +0000 (18:24 +0000)]
Forgot to include nested protocols in collection, resulting in
bogus warning. Fixes radar 7682116.

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

14 years agoDon't try to finalize an ill-formed variable or one whose class type is ill-formed...
Douglas Gregor [Thu, 25 Feb 2010 18:11:54 +0000 (18:11 +0000)]
Don't try to finalize an ill-formed variable or one whose class type is ill-formed. Fixes PR6421

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

14 years agoRevert patches r97122 r97127 r97129 r97131.
Jakob Stoklund Olesen [Thu, 25 Feb 2010 15:47:53 +0000 (15:47 +0000)]
Revert patches r97122 r97127 r97129 r97131.
They were breaking clang-x86_64-darwin10-selfhost

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

14 years agoAdd "template" keyword at strategic position to fix
Gabor Greif [Thu, 25 Feb 2010 13:04:33 +0000 (13:04 +0000)]
Add "template" keyword at strategic position to fix
compilation using g++ v3.4.

I'll watch the buildbots and back out if necessary.
Feel free to do the same if something breaks.

Without this patch I get (on g++ 3.4.6) following error:

In file included from clang/lib/Sema/SemaTemplate.cpp:14:
clang/lib/Sema/TreeTransform.h: In member function `clang::ASTOwningResult<&clang::ActionBase::DeleteExpr> clang::TreeTransform<Derived>::RebuildCXXPseudoDestructorExpr(clang::ASTOwningResult<&clang::ActionBase::DeleteExpr>, clang::SourceLocation, bool, clang::NestedNameSpecifier*, clang::SourceRange, clang::TypeSourceInfo*, clang::SourceLocation, clang::SourceLocation, clang::PseudoDestructorTypeStorage)':
clang/lib/Sema/TreeTransform.h:5784: error: expected primary-expression before '>' token
clang/lib/Sema/TreeTransform.h:5784: error: expected primary-expression before ')' token
make[4]: *** [clang/lib/Sema/Release/SemaTemplate.o] Error 1

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