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

14 years agoWhen comparing two method overload candidates during overload diagnostics,
John McCall [Thu, 25 Feb 2010 10:46:05 +0000 (10:46 +0000)]
When comparing two method overload candidates during overload diagnostics,
skip the object argument conversion if either of the candidates didn't
initialize it.

Fixes PR6421, which is such a very straightforward extension of PR6398 that I
should have worked it into the last test case (and therefore caught it then).
Ah well.

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

14 years agoFix a really trivial crasher and begin fleshing out one of the namespace test
Chandler Carruth [Thu, 25 Feb 2010 09:32:59 +0000 (09:32 +0000)]
Fix a really trivial crasher and begin fleshing out one of the namespace test
cases.

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

14 years agoAdd a minimal C interpreter example.
Daniel Dunbar [Thu, 25 Feb 2010 08:49:05 +0000 (08:49 +0000)]
Add a minimal C interpreter example.
 - Demonstrates how to build a standalone tool which loads source code using the
   Driver and Frontend libraries, and then uses CodeGen and the JIT to actually
   execute the code.

 - Still more complicated than it should be, but hey its only 153 lines. :)

--
ddunbar@ozzy:tmp$ cat hello.c
#include <stdio.h>
int main() { printf("hello world\n"); return 0; }
ddunbar@ozzy:tmp$ clang-interpreter hello.c
hello world
--

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

14 years agoMove the GenerateCallExitNode logic completely into GREndPathNodeBuilder.
Zhongxing Xu [Thu, 25 Feb 2010 07:57:35 +0000 (07:57 +0000)]
Move the GenerateCallExitNode logic completely into GREndPathNodeBuilder.

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

14 years agoMove the dead bindings removal logic from CallInliner to GRExprEngine::ProcessCallExit().
Zhongxing Xu [Thu, 25 Feb 2010 07:36:34 +0000 (07:36 +0000)]
Move the dead bindings removal logic from CallInliner to GRExprEngine::ProcessCallExit().

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

14 years agoAdd a new conversion rank to classify conversions between complex and scalar
Chandler Carruth [Thu, 25 Feb 2010 07:20:54 +0000 (07:20 +0000)]
Add a new conversion rank to classify conversions between complex and scalar
types. Rank these conversions below other conversions. This allows overload
resolution when the only distinction is between a complex and scalar type. It
also brings the complex overload resolutin in line with GCC's.

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

14 years agoAdd comments.
Zhongxing Xu [Thu, 25 Feb 2010 07:03:08 +0000 (07:03 +0000)]
Add comments.

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

14 years agoCall inliner improvements:
Zhongxing Xu [Thu, 25 Feb 2010 06:46:30 +0000 (06:46 +0000)]
Call inliner improvements:

This patch implements the CallEnter/CallExit idea of Ted.

Add two interfaces to GRSubEngine: ProcessCallEnter, ProcessCallExit.

The CallEnter program point uses caller's location context. The
CallExit program point uses callee's location context.

CallEnter is built by GRStmtNodeBuilder. CallExit is built by
GREndPathNodeBuilder.

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

14 years agoAdd MacOSXAPIChecker, a meta checker to include various precondition checks for calls
Ted Kremenek [Thu, 25 Feb 2010 05:44:09 +0000 (05:44 +0000)]
Add MacOSXAPIChecker, a meta checker to include various precondition checks for calls
to various MacOS X functions.  The checks in BasicObjCFoundationChecks.cpp will
gradually be migrated here.

As a first check, check that when 'dispatch_once()' is passed a predicate value
that has non-local storage.

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

14 years agoWhen generating error node, check to see if we already cached out.
Ted Kremenek [Thu, 25 Feb 2010 05:44:05 +0000 (05:44 +0000)]
When generating error node, check to see if we already cached out.

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

14 years agoTargets (like pic16) may have mangled the name of global variables,
Sanjiv Gupta [Thu, 25 Feb 2010 05:20:44 +0000 (05:20 +0000)]
Targets (like pic16) may have mangled the name of global variables,
so get the name from Var rather than the original decl.

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

14 years agoUpdate CMake makefiles
Douglas Gregor [Thu, 25 Feb 2010 04:52:01 +0000 (04:52 +0000)]
Update CMake makefiles

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

14 years agoRestore the invariant that a nested-name-specifier can only contain
Douglas Gregor [Thu, 25 Feb 2010 04:46:04 +0000 (04:46 +0000)]
Restore the invariant that a nested-name-specifier can only contain
class types, dependent types, and namespaces. I had previously
weakened this invariant while working on parsing pseudo-destructor
expressions, but recent work in that area has made these changes
unnecessary.

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

14 years agoFrontend: Add CodeGenAction::takeModule().
Daniel Dunbar [Thu, 25 Feb 2010 04:37:50 +0000 (04:37 +0000)]
Frontend: Add CodeGenAction::takeModule().

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

14 years agoFrontend: Pull CodeGenAction out more, and eliminate CreateBackendConsumer.
Daniel Dunbar [Thu, 25 Feb 2010 04:37:45 +0000 (04:37 +0000)]
Frontend: Pull CodeGenAction out more, and eliminate CreateBackendConsumer.

This is the way I would like to move the frontend function towards -- distinct
pieces of functionality should be exposed only via FrontendAction
implementations which have clean and relatively-stable APIs.

This also isolates the surface area in clang which depends on LLVM CodeGen.

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

14 years agoRemove dead code.
Anders Carlsson [Thu, 25 Feb 2010 03:57:50 +0000 (03:57 +0000)]
Remove dead code.

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

14 years agoMove the vcall and vbase offset layout code out into its own class.
Anders Carlsson [Thu, 25 Feb 2010 03:45:56 +0000 (03:45 +0000)]
Move the vcall and vbase offset layout code out into its own class.

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

14 years agoDriver: Allow driver title (for --help) to be overridden by clients.
Daniel Dunbar [Thu, 25 Feb 2010 03:31:53 +0000 (03:31 +0000)]
Driver: Allow driver title (for --help) to be overridden by clients.

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