]> granicus.if.org Git - clang/log
clang
14 years agoTypo correction for member access into classes/structs/unions, e.g.,
Douglas Gregor [Thu, 31 Dec 2009 07:42:17 +0000 (07:42 +0000)]
Typo correction for member access into classes/structs/unions, e.g.,

  s.fnd("hello")

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

14 years agoLet constraint manager inform checkers that some assumption logic has happend.
Zhongxing Xu [Thu, 31 Dec 2009 06:13:07 +0000 (06:13 +0000)]
Let constraint manager inform checkers that some assumption logic has happend.
Add new states for symbolic regions tracked by malloc checker. This enables us
to do malloc checking more accurately. See test case.

Based on Lei Zhang's patch and discussion.

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

14 years agoImplement typo correction for id-expressions, e.g.,
Douglas Gregor [Thu, 31 Dec 2009 05:20:13 +0000 (05:20 +0000)]
Implement typo correction for id-expressions, e.g.,

typo.cpp:22:10: error: use of undeclared identifier 'radious'; did
      you mean 'radius'?
  return radious * pi;
         ^~~~~~~
         radius

This was super-easy, since we already had decent recovery by looking
for names in dependent base classes.

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

14 years agoimprove diagnostics for case when a field type is unknown by
Chris Lattner [Thu, 31 Dec 2009 03:10:55 +0000 (03:10 +0000)]
improve diagnostics for case when a field type is unknown by
not emitting a follow-on error about 'int', which the user
never wrote.  PR5924.

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

14 years agoFix a bunch of bugs with VMI RTTI building, and add a whole bunch of tests.
Anders Carlsson [Wed, 30 Dec 2009 23:47:56 +0000 (23:47 +0000)]
Fix a bunch of bugs with VMI RTTI building, and add a whole bunch of tests.

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

14 years agoThe element type should also be canonicalized. Add a case for VariableArrayType.
Zhongxing Xu [Wed, 30 Dec 2009 22:59:54 +0000 (22:59 +0000)]
The element type should also be canonicalized. Add a case for VariableArrayType.

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

14 years agotestcase for previous patch!
Chris Lattner [Wed, 30 Dec 2009 22:10:22 +0000 (22:10 +0000)]
testcase for previous patch!

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

14 years agowhen making a decl for __builtin_fabsf() make sure to
Chris Lattner [Wed, 30 Dec 2009 22:06:22 +0000 (22:06 +0000)]
when making a decl for __builtin_fabsf() make sure to
attach the appropriate attributes to it.  I don't think
this manifests as any real change though, we're still
not getting the right LLVM IR attributes out of codegen.

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

14 years agoFix a comment.
Zhongxing Xu [Wed, 30 Dec 2009 21:24:23 +0000 (21:24 +0000)]
Fix a comment.

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

14 years agofix PR5917, L'x' was getting the wrong type in c++ mode. Per
Chris Lattner [Wed, 30 Dec 2009 21:19:39 +0000 (21:19 +0000)]
fix PR5917, L'x' was getting the wrong type in c++ mode. Per
C++2.13.2p2: "A wide-character literal has type wchar_t"

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

14 years agoWhen rewriting a __block declaration, use a suitable API to get location of
Fariborz Jahanian [Wed, 30 Dec 2009 20:38:08 +0000 (20:38 +0000)]
When rewriting a __block declaration, use a suitable API to get location of
the declaration in the presence of an initializer macro.

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

14 years agoremove extraneous #include
Chris Lattner [Wed, 30 Dec 2009 19:54:10 +0000 (19:54 +0000)]
remove extraneous #include

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

14 years agoTypo correction for type names when they appear in declarations, e.g., given
Douglas Gregor [Wed, 30 Dec 2009 17:04:44 +0000 (17:04 +0000)]
Typo correction for type names when they appear in declarations, e.g., given

  tring str2;

we produce the following diagnostic + fix-it:

typo.cpp:15:1: error: unknown type name 'tring'; did you mean 'string'?
  tring str2;
  ^~~~~
  string

To make this really useful, we'll need to introduce typo correction in
many more places (wherever we do name lookup), and implement
declaration-vs-expression heuristics that cope with typos
better. However, for now this will handle the simple cases where we
already get good "unknown type name" diagnostics.

The LookupVisibleDecls functions are intended to be used by code
completion as well as typo correction; that refactoring will happen
later.

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

14 years agoFix typo in comment
Douglas Gregor [Wed, 30 Dec 2009 16:01:52 +0000 (16:01 +0000)]
Fix typo in comment

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

14 years agoRemove an duplicated #include.
Zhongxing Xu [Wed, 30 Dec 2009 06:48:20 +0000 (06:48 +0000)]
Remove an duplicated #include.

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

14 years agoSimplify code by using an equivalent template class.
Zhongxing Xu [Wed, 30 Dec 2009 06:38:20 +0000 (06:38 +0000)]
Simplify code by using an equivalent template class.

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

14 years agoMore fixes to the handling of CVR-comparisons on array types. Adds a method to
Chandler Carruth [Wed, 30 Dec 2009 04:10:01 +0000 (04:10 +0000)]
More fixes to the handling of CVR-comparisons on array types. Adds a method to
QualType to get CVR-qualifiers through array types, and switches the primary
comparison methods to use it. This may allow simplifying some of the callers of
getUnqualifiedArrayType.

Also fix the normalizing of CV-qualification during template deduction to
normalize through arrays and allow a more qualified deduced array type. This
fixes PR5911.

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

14 years agoAdd base class checks.
Anders Carlsson [Wed, 30 Dec 2009 01:29:05 +0000 (01:29 +0000)]
Add base class checks.

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

14 years agoAdd more vtable tests.
Anders Carlsson [Wed, 30 Dec 2009 01:25:42 +0000 (01:25 +0000)]
Add more vtable tests.

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

14 years agoMore RTTI cleanup, test that RTTI classes have the correct vtables.
Anders Carlsson [Wed, 30 Dec 2009 01:00:12 +0000 (01:00 +0000)]
More RTTI cleanup, test that RTTI classes have the correct vtables.

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

14 years agoTypedefs can be redeclared. That seems like something we should record in
John McCall [Wed, 30 Dec 2009 00:31:22 +0000 (00:31 +0000)]
Typedefs can be redeclared.  That seems like something we should record in
the AST lest we run into some crazy canonicalization bug like PR5874.

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

14 years agoTest for PR5908.
Eli Friedman [Wed, 30 Dec 2009 00:20:14 +0000 (00:20 +0000)]
Test for PR5908.

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

14 years agoMake sure to explicitly pass type/value dependence to Expr constructor. This
Eli Friedman [Wed, 30 Dec 2009 00:13:48 +0000 (00:13 +0000)]
Make sure to explicitly pass type/value dependence to Expr constructor.  This
caught several cases where we were not doing the right thing. I'm
not completely sure all cases are being handled correctly, but this should
be an improvement.

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

14 years agoMatch gcc and treat vector types as fundamental types.
Anders Carlsson [Tue, 29 Dec 2009 22:30:11 +0000 (22:30 +0000)]
Match gcc and treat vector types as fundamental types.

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

14 years agoHandle enum types as well.
Anders Carlsson [Tue, 29 Dec 2009 22:13:01 +0000 (22:13 +0000)]
Handle enum types as well.

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

14 years agoTest linkage of RTTI descriptors of array types.
Anders Carlsson [Tue, 29 Dec 2009 21:58:32 +0000 (21:58 +0000)]
Test linkage of RTTI descriptors of array types.

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

14 years agoFix function type RTTI linkage and add tests.
Anders Carlsson [Tue, 29 Dec 2009 20:20:19 +0000 (20:20 +0000)]
Fix function type RTTI linkage and add tests.

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

14 years agoFix support for const_cast<>s of array types which actual change the
Chandler Carruth [Tue, 29 Dec 2009 08:05:19 +0000 (08:05 +0000)]
Fix support for const_cast<>s of array types which actual change the
CV-qualifiers. Remove an error expectation from the 'good' set of const-cast
test cases. With this patch, the final non-template test case from PR5542
passes. (It's the same as the one already in const-cast.cpp.)

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

14 years agostrength reduce this call away.
Chris Lattner [Tue, 29 Dec 2009 07:49:13 +0000 (07:49 +0000)]
strength reduce this call away.

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

14 years agofix whitespace in test to match llvm asmprinter change.
Chris Lattner [Tue, 29 Dec 2009 07:42:23 +0000 (07:42 +0000)]
fix whitespace in test to match llvm asmprinter change.

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

14 years agoCorrectly refer to element CVR qualifications when determining if a type is
Chandler Carruth [Tue, 29 Dec 2009 07:16:59 +0000 (07:16 +0000)]
Correctly refer to element CVR qualifications when determining if a type is
more or less cv-qualified than another during implicit conversion and overload
resolution ([basic.type.qualifier] p5). Factors the logic out of template
deduction and into the ASTContext so it can be shared.

This fixes several aspects of PR5542, but not all of them.

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

14 years agoGet rid of FixedWidthIntType, as suggested by Chris and Eli.
Anders Carlsson [Tue, 29 Dec 2009 07:07:36 +0000 (07:07 +0000)]
Get rid of FixedWidthIntType, as suggested by Chris and Eli.

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

14 years agoHandle using declarations in overloaded and template functions during ADL and
Chandler Carruth [Tue, 29 Dec 2009 06:17:27 +0000 (06:17 +0000)]
Handle using declarations in overloaded and template functions during ADL and
address resolution. This fixes PR5751.

Also, while we're here, remove logic from ADL which mistakenly included the
definition namespaces of overloaded and/or templated functions whose name or
address is used as an argument.

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

14 years agoadjust for llvm api changes.
Chris Lattner [Mon, 28 Dec 2009 23:41:39 +0000 (23:41 +0000)]
adjust for llvm api changes.

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

14 years agothis form of SetDebugLocation is about to go away, add some #includes that
Chris Lattner [Mon, 28 Dec 2009 21:44:41 +0000 (21:44 +0000)]
this form of SetDebugLocation is about to go away, add some #includes that
are about to not come in implicitly.

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

14 years agoAdjust indentation.
Zhongxing Xu [Mon, 28 Dec 2009 06:52:51 +0000 (06:52 +0000)]
Adjust indentation.

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

14 years agoFix 80-col violation.
Zhongxing Xu [Mon, 28 Dec 2009 06:49:22 +0000 (06:49 +0000)]
Fix 80-col violation.

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

14 years agouse best-fit instead of first-fit when reusing a MacroArgs object,
Chris Lattner [Mon, 28 Dec 2009 06:36:46 +0000 (06:36 +0000)]
use best-fit instead of first-fit when reusing a MacroArgs object,
this speeds up Eonly on the testcase in PR5888 from 30.5s to 0.85s

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

14 years agoThe PreExpArgTokens array is indexed with an argument #,
Chris Lattner [Mon, 28 Dec 2009 06:17:16 +0000 (06:17 +0000)]
The PreExpArgTokens array is indexed with an argument #,
not a token number.  Fix the reserve logic to get the right
amount of space.

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

14 years agoFix for PR5871. Make __PRETTY_FUNCTION__ work for member functions defined in a class...
Sam Weinig [Mon, 28 Dec 2009 03:19:38 +0000 (03:19 +0000)]
Fix for PR5871. Make __PRETTY_FUNCTION__ work for member functions defined in a class local to a function.

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

14 years agoMake sure to give an error for template argument lists followed by junk.
Eli Friedman [Sun, 27 Dec 2009 22:31:18 +0000 (22:31 +0000)]
Make sure to give an error for template argument lists followed by junk.

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

14 years agoPromote arguments of frameaddr / returnaddr builtins to i32 type, when needed.
Anton Korobeynikov [Sun, 27 Dec 2009 14:27:22 +0000 (14:27 +0000)]
Promote arguments of frameaddr / returnaddr builtins to i32 type, when needed.
This is needed for the platforms, where bitwidth of "int" is not 32 bits
(e.g. 16 on msp430).

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

14 years agoAdd a sanity assertion so that we don't silently generate bad code; I'll file
Eli Friedman [Sun, 27 Dec 2009 07:02:50 +0000 (07:02 +0000)]
Add a sanity assertion so that we don't silently generate bad code; I'll file
a bug with a testcase hitting this assertion in a moment.

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

14 years agoFix runline.
Eli Friedman [Sun, 27 Dec 2009 05:59:41 +0000 (05:59 +0000)]
Fix runline.

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

14 years agoFix PointerExprEvaluator::VisitCastExpr so it doesn't misfold C++ casts which
Eli Friedman [Sun, 27 Dec 2009 05:43:15 +0000 (05:43 +0000)]
Fix PointerExprEvaluator::VisitCastExpr so it doesn't misfold C++ casts which
it doesn't know how to fold, like derived-to-base casts.

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

14 years agoFix obvious mistake.
Eli Friedman [Sun, 27 Dec 2009 03:44:17 +0000 (03:44 +0000)]
Fix obvious mistake.

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

14 years agoFix for PR5872. Add static specifier and const/volatile qualifiers to member function...
Sam Weinig [Sun, 27 Dec 2009 01:38:20 +0000 (01:38 +0000)]
Fix for PR5872. Add static specifier and const/volatile qualifiers to member functions in __PRETTY_FUNCTION__ predefined expressions.

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

14 years agoTests: Tweak LLVM-Code-Symbols test to ignore common and undefined symbols for
Daniel Dunbar [Sat, 26 Dec 2009 22:58:48 +0000 (22:58 +0000)]
Tests: Tweak LLVM-Code-Symbols test to ignore common and undefined symbols for
now, let's start small.

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

14 years agoDon't look through casts when looking for the underlying decl for a function
Eli Friedman [Sat, 26 Dec 2009 03:35:45 +0000 (03:35 +0000)]
Don't look through casts when looking for the underlying decl for a function
call; the standard doesn't expect us to, and the program could be doing
something crazy.  Fixes PR5882.

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

14 years agoAttempted fix for PR5884; this code will be dead soon, but this fix should
Eli Friedman [Fri, 25 Dec 2009 23:59:21 +0000 (23:59 +0000)]
Attempted fix for PR5884; this code will be dead soon, but this fix should
help for the moment.

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

14 years agoDriver: Use "g++" as generic gcc name when running in C++ mode, for platforms
Daniel Dunbar [Fri, 25 Dec 2009 20:21:23 +0000 (20:21 +0000)]
Driver: Use "g++" as generic gcc name when running in C++ mode, for platforms
that lack real tool definitions.

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

14 years agoMake sure operator new[] and operator delete[] match. This will hopefully silence...
Benjamin Kramer [Fri, 25 Dec 2009 17:06:27 +0000 (17:06 +0000)]
Make sure operator new[] and operator delete[] match. This will hopefully silence 3 remaining MSVC warnings.

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

14 years agoRemove some dead variables clang-analyzer found.
Benjamin Kramer [Fri, 25 Dec 2009 15:43:36 +0000 (15:43 +0000)]
Remove some dead variables clang-analyzer found.

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

14 years agoFix typo spotted by MSVC.
Benjamin Kramer [Fri, 25 Dec 2009 09:44:02 +0000 (09:44 +0000)]
Fix typo spotted by MSVC.

GRExprEngine.cpp(1348) : warning C4305: 'argument' : truncation from 'clang::ProgramPoint::Kind' to 'bool'

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

14 years agoMinor optimization; emit proper unsupported messages for a couple of cases.
Eli Friedman [Fri, 25 Dec 2009 06:17:05 +0000 (06:17 +0000)]
Minor optimization; emit proper unsupported messages for a couple of cases.

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

14 years agoSome small improvements to dead code elimination; helps a bit on
Eli Friedman [Fri, 25 Dec 2009 05:29:40 +0000 (05:29 +0000)]
Some small improvements to dead code elimination; helps a bit on
LLVM-Code-Symbols test.

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

14 years agoMake copy constructor elimination work in more cases; the case in question
Eli Friedman [Thu, 24 Dec 2009 23:33:34 +0000 (23:33 +0000)]
Make copy constructor elimination work in more cases; the case in question
here affects clang-on-clang.

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

14 years agoFix for PR5844. Be explicit about anonymous struct/class/union/namespaces in __PRETTY...
Sam Weinig [Thu, 24 Dec 2009 23:15:03 +0000 (23:15 +0000)]
Fix for PR5844. Be explicit about anonymous struct/class/union/namespaces in __PRETTY_FUNCTION__ predefined expression.

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

14 years agoMove a bunch of class related functions to CGClass.cpp, no functionality change.
Anders Carlsson [Thu, 24 Dec 2009 22:46:43 +0000 (22:46 +0000)]
Move a bunch of class related functions to CGClass.cpp, no functionality change.

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

14 years agoSketch a simple new C++Tests suite for checking that llvm-gcc and clang generate
Daniel Dunbar [Thu, 24 Dec 2009 21:27:38 +0000 (21:27 +0000)]
Sketch a simple new C++Tests suite for checking that llvm-gcc and clang generate
the same visible symbols, useful for finding ABI/Mangler/vtable/etc. issues.

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

14 years agoPass the return value slot to all call exprs.
Anders Carlsson [Thu, 24 Dec 2009 21:13:40 +0000 (21:13 +0000)]
Pass the return value slot to all call exprs.

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

14 years agoEgregious, disgusting workaround for PR5866. We need to rework how we
Douglas Gregor [Thu, 24 Dec 2009 20:56:24 +0000 (20:56 +0000)]
Egregious, disgusting workaround for PR5866. We need to rework how we
keep track of friends within templates, which will provide a real for
PR5866. For now, this makes sure we don't do something entirely stupid
with friends of specializations.

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

14 years agoFill in the return value slot in CGExprAgg::VisitCallExpr. This takes us halfway...
Anders Carlsson [Thu, 24 Dec 2009 20:40:36 +0000 (20:40 +0000)]
Fill in the return value slot in CGExprAgg::VisitCallExpr. This takes us halfway towards fixing PR5824.

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

14 years agoAdd test case for PR5868, and improve location information slightly for implicit...
Douglas Gregor [Thu, 24 Dec 2009 20:23:34 +0000 (20:23 +0000)]
Add test case for PR5868, and improve location information slightly for implicit "this" expressions

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

14 years agoAdd a test for x86-64 struct returns under gc.
Anders Carlsson [Thu, 24 Dec 2009 20:21:41 +0000 (20:21 +0000)]
Add a test for x86-64 struct returns under gc.

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

14 years agoWhen rebuilding a MemberExpr that refers to an anonymous union, be
Douglas Gregor [Thu, 24 Dec 2009 20:02:50 +0000 (20:02 +0000)]
When rebuilding a MemberExpr that refers to an anonymous union, be
sure to perform derived-to-base conversions on the base
expression. Fixes PR5868. Proper testcase is coming soon.

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

14 years agoPass ReturnValueSlot to EmitCall. No functionality change yet.
Anders Carlsson [Thu, 24 Dec 2009 19:25:24 +0000 (19:25 +0000)]
Pass ReturnValueSlot to EmitCall. No functionality change yet.

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

14 years agoFix -Asserts warning.
Daniel Dunbar [Thu, 24 Dec 2009 19:19:26 +0000 (19:19 +0000)]
Fix -Asserts warning.

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

14 years agoAdd a ReturnValueSlot class. Change the argument order in EmitCall to match the other...
Anders Carlsson [Thu, 24 Dec 2009 19:08:58 +0000 (19:08 +0000)]
Add a ReturnValueSlot class. Change the argument order in EmitCall to match the other overload better.

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

14 years agoWhen transforming CXXExprWithTemporaries and CXXBindTemporaryExpr
Douglas Gregor [Thu, 24 Dec 2009 18:51:59 +0000 (18:51 +0000)]
When transforming CXXExprWithTemporaries and CXXBindTemporaryExpr
expressions (e.g., for template instantiation), just transform the
subexpressions and return those, since the temporary-related nodes
will be implicitly regenerated. Fixes PR5867, but I said that
before...

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

14 years agoFix double-destruction assertion to account for temporaries in conditionals
Douglas Gregor [Thu, 24 Dec 2009 18:16:21 +0000 (18:16 +0000)]
Fix double-destruction assertion to account for temporaries in conditionals

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

14 years agoAssert that we aren't trying to push the same C++ temporary onto the live temporary...
Douglas Gregor [Thu, 24 Dec 2009 17:48:05 +0000 (17:48 +0000)]
Assert that we aren't trying to push the same C++ temporary onto the live temporary stack twice. A little insurance against PR5867 surprising us again

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

14 years agoInitializationSequence handles binding to temporaries, so that
Douglas Gregor [Thu, 24 Dec 2009 17:16:46 +0000 (17:16 +0000)]
InitializationSequence handles binding to temporaries, so that
argument-passing doesn't have to. Fixes PR5867, where we were binding
a temporary twice in the AST and, therefore, calling its destructor
twice.

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

14 years agoFix the clang-on-clang build: APFloat reports underflow whenever we get a
John McCall [Thu, 24 Dec 2009 11:09:08 +0000 (11:09 +0000)]
Fix the clang-on-clang build:  APFloat reports underflow whenever we get a
denormal, but we only want to diagnose if we underflowed to zero.  This
allows people to write constants in the denormal range.

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

14 years agoTweak the text of several main() diagnostics and punch a hole specifically for
John McCall [Thu, 24 Dec 2009 09:58:38 +0000 (09:58 +0000)]
Tweak the text of several main() diagnostics and punch a hole specifically for
Darwin's sekrit fourth argument.  This should probably be factored to
let targets make target-specific decisions about what main() should look like.

Fixes rdar://problem/7414990
or if different platforms have radically different ideas of what they want in

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

14 years agoDiagnose out-of-bounds floating-point constants. Fixes rdar://problem/6974641
John McCall [Thu, 24 Dec 2009 09:08:04 +0000 (09:08 +0000)]
Diagnose out-of-bounds floating-point constants.  Fixes rdar://problem/6974641

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

14 years agoRemove some dead code.
Mike Stump [Thu, 24 Dec 2009 07:29:41 +0000 (07:29 +0000)]
Remove some dead code.

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

14 years agoCleanup some dead code.
Mike Stump [Thu, 24 Dec 2009 06:52:05 +0000 (06:52 +0000)]
Cleanup some dead code.

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

14 years agoAs Ted suggested, record the callsite information with the StackFrameContext.
Zhongxing Xu [Thu, 24 Dec 2009 03:34:38 +0000 (03:34 +0000)]
As Ted suggested, record the callsite information with the StackFrameContext.

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

14 years agoAdd analyzer test case for 'ForStmt' with condition variable.
Ted Kremenek [Thu, 24 Dec 2009 02:41:19 +0000 (02:41 +0000)]
Add analyzer test case for 'ForStmt' with condition variable.

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

14 years agoEnhance dataflow analyses to recognize branch statements in the CFG used as hooks...
Ted Kremenek [Thu, 24 Dec 2009 02:40:30 +0000 (02:40 +0000)]
Enhance dataflow analyses to recognize branch statements in the CFG used as hooks for the initialization of condition variables.

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

14 years agoDon't set hidden for a non-external symbol as that would make it extenal.
Mike Stump [Thu, 24 Dec 2009 02:33:48 +0000 (02:33 +0000)]
Don't set hidden for a non-external symbol as that would make it extenal.

Refine codegen for visibility and hidden.  WIP.

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

14 years agoFix for bug 5691.
David Chisnall [Thu, 24 Dec 2009 02:26:34 +0000 (02:26 +0000)]
Fix for bug 5691.

This fixes throwing exceptions inside @catch blocks nested inside outer @try blocks and also fixes jumping from an inner @finally to an outer @finally (via any relevant @catch blocks).

The code exhibiting this bug was based on code from CGObjCMac.  I believe that this bug may still be present on the Mac runtimes, although the test case in the bug contains a few GNUisms and won't compile without some minor tweaks with Apple's libobjc.

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

14 years agoInter-procedural analysis: now we can return from the callee.
Zhongxing Xu [Thu, 24 Dec 2009 02:25:21 +0000 (02:25 +0000)]
Inter-procedural analysis: now we can return from the callee.

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

14 years agoFix bug I just introduced in ForStmt::child_end() where we could iterate off into...
Ted Kremenek [Thu, 24 Dec 2009 01:59:46 +0000 (01:59 +0000)]
Fix bug I just introduced in ForStmt::child_end() where we could iterate off into garbage values.

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

14 years agoTeach GRExprEngine to handle the initialization of the condition variable of a ForStmt.
Ted Kremenek [Thu, 24 Dec 2009 01:49:25 +0000 (01:49 +0000)]
Teach GRExprEngine to handle the initialization of the condition variable of a ForStmt.

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

14 years agoAdd CFG support for the initializer of the condition variable of a ForStmt.
Ted Kremenek [Thu, 24 Dec 2009 01:49:06 +0000 (01:49 +0000)]
Add CFG support for the initializer of the condition variable of a ForStmt.

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

14 years agoCoelesce 'DoDestroy()' methods in Stmt.cpp, and modify the child_iterator returned...
Ted Kremenek [Thu, 24 Dec 2009 01:48:39 +0000 (01:48 +0000)]
Coelesce 'DoDestroy()' methods in Stmt.cpp, and modify the child_iterator returned by ForStmt to include the initializer of the condition variable.

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

14 years agoCFG tweak: in a WhileStmt, the condition variable initializer is evaluated every...
Ted Kremenek [Thu, 24 Dec 2009 01:34:10 +0000 (01:34 +0000)]
CFG tweak: in a WhileStmt, the condition variable initializer is evaluated every time the condition is checked.

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

14 years agoFix recent regression caught by g++.old-deja/g++.mike/eh19.C.
Mike Stump [Thu, 24 Dec 2009 01:10:27 +0000 (01:10 +0000)]
Fix recent regression caught by g++.old-deja/g++.mike/eh19.C.

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

14 years agoTeach GRExprEngine to handle the initialization of the condition variable of a WhileStmt.
Ted Kremenek [Thu, 24 Dec 2009 00:54:56 +0000 (00:54 +0000)]
Teach GRExprEngine to handle the initialization of the condition variable of a WhileStmt.

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

14 years agoAdd CFG support for the initializer of the condition variable of a WhileStmt.
Ted Kremenek [Thu, 24 Dec 2009 00:54:37 +0000 (00:54 +0000)]
Add CFG support for the initializer of the condition variable of a WhileStmt.

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

14 years agoModify WhileStmt::child_begin()/child_end() to include the initializer for the condit...
Ted Kremenek [Thu, 24 Dec 2009 00:54:19 +0000 (00:54 +0000)]
Modify WhileStmt::child_begin()/child_end() to include the initializer for the condition variable.

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

14 years agoAdd test case for PR 4358.
Ted Kremenek [Thu, 24 Dec 2009 00:48:11 +0000 (00:48 +0000)]
Add test case for PR 4358.

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

14 years agoTeach GRExprEngine to handle the initialization of the condition variable of a Switch...
Ted Kremenek [Thu, 24 Dec 2009 00:40:03 +0000 (00:40 +0000)]
Teach GRExprEngine to handle the initialization of the condition variable of a SwitchStmt.

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

14 years agoAdd CFG support for the initializer of the condition variable of a SwitchStmt.
Ted Kremenek [Thu, 24 Dec 2009 00:39:26 +0000 (00:39 +0000)]
Add CFG support for the initializer of the condition variable of a SwitchStmt.

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

14 years agoModify SwitchStmt::child_begin()/child_end() to include the initializer for the condi...
Ted Kremenek [Thu, 24 Dec 2009 00:39:05 +0000 (00:39 +0000)]
Modify SwitchStmt::child_begin()/child_end() to include the initializer for the condition variable.

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

14 years agosupport the warn_unused_result in C++ class methods
Nuno Lopes [Thu, 24 Dec 2009 00:28:18 +0000 (00:28 +0000)]
support the warn_unused_result in C++ class methods

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

14 years agoallow the noreturn attribute to be used in class methods
Nuno Lopes [Wed, 23 Dec 2009 23:40:33 +0000 (23:40 +0000)]
allow the noreturn attribute to be used in class methods

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

14 years agoAdd StmtIterator support for iterating over both the condition
Ted Kremenek [Wed, 23 Dec 2009 23:38:34 +0000 (23:38 +0000)]
Add StmtIterator support for iterating over both the condition
variable initializer and the other expressions in an IfStmt.

This change required adding a 'DoDestroy()' method for IfStmt that did
not include destroying the initializer (since that is owned by the
VarDecl).

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