]> granicus.if.org Git - clang/log
clang
14 years agoadd missing #include
Chris Lattner [Sat, 7 Nov 2009 09:22:46 +0000 (09:22 +0000)]
add missing #include

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

14 years agoSupport -Wshorten-64-to-32 for integer types only, which seems to satisfy the
John McCall [Sat, 7 Nov 2009 09:03:53 +0000 (09:03 +0000)]
Support -Wshorten-64-to-32 for integer types only, which seems to satisfy the
core requirements.  Fixes rdar://problem/6389954

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

14 years agoAdd bug number.
Anders Carlsson [Sat, 7 Nov 2009 08:24:59 +0000 (08:24 +0000)]
Add bug number.

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

14 years agoImprove -Wconversion by permitting binary operations on values of the target
John McCall [Sat, 7 Nov 2009 08:15:46 +0000 (08:15 +0000)]
Improve -Wconversion by permitting binary operations on values of the target
type (or smaller) to stay "closed" within the type.

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

14 years agoDon't treat variables with non-trivial ctors or dtors as unused. Fixes PR5407.
Anders Carlsson [Sat, 7 Nov 2009 07:26:56 +0000 (07:26 +0000)]
Don't treat variables with non-trivial ctors or dtors as unused. Fixes PR5407.

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

14 years agoCleanup, no functionality change.
Anders Carlsson [Sat, 7 Nov 2009 07:18:14 +0000 (07:18 +0000)]
Cleanup, no functionality change.

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

14 years agoAlways mangle functions with special names. Fixes PR5420.
Anders Carlsson [Sat, 7 Nov 2009 07:15:03 +0000 (07:15 +0000)]
Always mangle functions with special names. Fixes PR5420.

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

14 years agoWhen instantiating a field decl, make sure to clone its attributes. With this change...
Anders Carlsson [Sat, 7 Nov 2009 06:07:58 +0000 (06:07 +0000)]
When instantiating a field decl, make sure to clone its attributes. With this change FileCheck no longer crashes when it's run without any arguments.

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

14 years agoUse SaveAndRestore to simplify logic in LiveVariables::runOnAllBlocks(). Patch by...
Ted Kremenek [Sat, 7 Nov 2009 05:57:35 +0000 (05:57 +0000)]
Use SaveAndRestore to simplify logic in LiveVariables::runOnAllBlocks().  Patch by Kovarththanan Rajaratnam!

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

14 years agoSwitch clang-cc to use ApplyHeaderSearchOptions, and fix a thinko.
Daniel Dunbar [Sat, 7 Nov 2009 04:58:12 +0000 (04:58 +0000)]
Switch clang-cc to use ApplyHeaderSearchOptions, and fix a thinko.

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

14 years agoWhen looking up and adding substitutions to the substitution table, make sure to...
Anders Carlsson [Sat, 7 Nov 2009 04:26:04 +0000 (04:26 +0000)]
When looking up and adding substitutions to the substitution table, make sure to always use the canonical declaration. With tihs change, FileCheck compiles and links but crashes during startup.

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

14 years agoAdd HeaderSearchOptions class, for packaging the information needed to
Daniel Dunbar [Sat, 7 Nov 2009 04:20:50 +0000 (04:20 +0000)]
Add HeaderSearchOptions class, for packaging the information needed to
initialize HeaderSearch. Not used yet.

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

14 years agoLift InitHeaderSearch::AddEnvVarPaths logic higher.
Daniel Dunbar [Sat, 7 Nov 2009 04:20:39 +0000 (04:20 +0000)]
Lift InitHeaderSearch::AddEnvVarPaths logic higher.

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

14 years agoFormatting fixes.
Daniel Dunbar [Sat, 7 Nov 2009 04:20:25 +0000 (04:20 +0000)]
Formatting fixes.

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

14 years agoRename PreprocessorInitOptions to PreprocessorOptions for consistency, and fix
Daniel Dunbar [Sat, 7 Nov 2009 04:20:15 +0000 (04:20 +0000)]
Rename PreprocessorInitOptions to PreprocessorOptions for consistency, and fix
filenames.

Also, move InitializePreprocessor to Utils.h.

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

14 years agoLift compiler builtin include path logic higher.
Daniel Dunbar [Sat, 7 Nov 2009 04:19:57 +0000 (04:19 +0000)]
Lift compiler builtin include path logic higher.

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

14 years agoRemove Checker::CheckType() (and instead using CheckerVisitor::PreVisitDeclStmt(...
Ted Kremenek [Sat, 7 Nov 2009 03:56:57 +0000 (03:56 +0000)]
Remove Checker::CheckType() (and instead using CheckerVisitor::PreVisitDeclStmt()), and refactor VLASizeChecker to have only one Checker subclass (not two) and to not use the node builders directly (and instead use the newer CheckerContext).

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

14 years agoTest case for -Wconversion.
John McCall [Sat, 7 Nov 2009 03:30:38 +0000 (03:30 +0000)]
Test case for -Wconversion.

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

14 years agoImplement -Wconversion. Off by default, in the non-gcc group. There's
John McCall [Sat, 7 Nov 2009 03:30:10 +0000 (03:30 +0000)]
Implement -Wconversion.  Off by default, in the non-gcc group.  There's
significant work left to be done to reduce the false-positive rate here.

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

14 years agoAdd basic code completion support for ObjC messages.
Steve Naroff [Sat, 7 Nov 2009 02:08:14 +0000 (02:08 +0000)]
Add basic code completion support for ObjC messages.

Still a work in progress...

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

14 years agoRevert r86315 and add Type::FixedWidthInt to the FIXME cases.
Anders Carlsson [Sat, 7 Nov 2009 01:19:37 +0000 (01:19 +0000)]
Revert r86315 and add Type::FixedWidthInt to the FIXME cases.

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

14 years agoMIPS linkage name confuses gdb here. Generate and test DW_AT_name here.
Devang Patel [Sat, 7 Nov 2009 00:41:37 +0000 (00:41 +0000)]
MIPS linkage name confuses gdb here. Generate and test DW_AT_name here.

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

14 years agoDo not assert if debug info for certain type is not generated.
Devang Patel [Sat, 7 Nov 2009 00:29:05 +0000 (00:29 +0000)]
Do not assert if debug info for certain type is not generated.

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

14 years agoDo not emit linkage name for global variables. It confuses gdb, because it picks...
Devang Patel [Sat, 7 Nov 2009 00:10:18 +0000 (00:10 +0000)]
Do not emit linkage name for global variables. It confuses gdb, because it picks up AT_MIPS_linkage_name and ignores AT_name.

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

14 years agoMake sure isCopyAssignment is only true for actual copy assignment operators,
Eli Friedman [Sat, 7 Nov 2009 00:02:45 +0000 (00:02 +0000)]
Make sure isCopyAssignment is only true for actual copy assignment operators,
instead of all assignment operators.  The mistake messes up IRGen because
it ends up assuming that the assignment operator is actually the implicit
copy assignment operator, and therefore tries to emit the RHS as an lvalue.

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

14 years agoVarious improvements to Clang's code-completion infrastructure:
Douglas Gregor [Sat, 7 Nov 2009 00:00:49 +0000 (00:00 +0000)]
Various improvements to Clang's code-completion infrastructure:
  - Introduce more code-completion string "chunk" kinds that describe
  symbols, the actual text that the user is expected to type, etc.
  - Make the generation of macro results optional, since it can be
  slow
  - Make code-completion accessible through the C API, marshalling the
  code-completion results through a temporary file (ick) to maintain
  process separation.

The last doesn't have tests yet.

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

14 years agoRefine the non-virtual this adjustment. Optimize out virtual this
Mike Stump [Fri, 6 Nov 2009 23:27:42 +0000 (23:27 +0000)]
Refine the non-virtual this adjustment.  Optimize out virtual this
adjustments of zero.

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

14 years agoSince default writable attribute is 'assign', allow
Fariborz Jahanian [Fri, 6 Nov 2009 22:59:12 +0000 (22:59 +0000)]
Since default writable attribute is 'assign', allow
specification of 'assign' (no warning to be issued),
when a continuation class makes a 'readonly' attribute
'readwrite' but also specifies the 'assign' attribute.
(this matches gcc's behavior and prevents exessive
 warnings)/

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

14 years agoMake fragile-abi test run happy.
Fariborz Jahanian [Fri, 6 Nov 2009 22:15:27 +0000 (22:15 +0000)]
Make fragile-abi test run happy.

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

14 years agoMake the VLASizeChecker implementation private, and its creation only known to GRExpr...
Ted Kremenek [Fri, 6 Nov 2009 21:51:50 +0000 (21:51 +0000)]
Make the VLASizeChecker implementation private, and its creation only known to GRExprEngineInternalChecks.cpp.

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

14 years agoFix a bogus objective-c warning with -pedantic.
Fariborz Jahanian [Fri, 6 Nov 2009 21:48:47 +0000 (21:48 +0000)]
Fix a bogus objective-c warning with -pedantic.
(radar 7370882).

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

14 years agoMake the implementation of DivZeroChecker private.
Ted Kremenek [Fri, 6 Nov 2009 20:47:51 +0000 (20:47 +0000)]
Make the implementation of DivZeroChecker private.

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

14 years agoPrevent a code gen. crash on empty unions - pr5408.
Fariborz Jahanian [Fri, 6 Nov 2009 20:47:40 +0000 (20:47 +0000)]
Prevent a code gen. crash on empty unions - pr5408.

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

14 years agotesting: Merge PR3135.c into misc-ps-region-store.m.
Ted Kremenek [Fri, 6 Nov 2009 20:32:38 +0000 (20:32 +0000)]
testing: Merge PR3135.c into misc-ps-region-store.m.

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

14 years agoSentence-case bug type, and pull tests from region-only-test.c into misc-ps-region...
Ted Kremenek [Fri, 6 Nov 2009 20:16:31 +0000 (20:16 +0000)]
Sentence-case bug type, and pull tests from region-only-test.c into misc-ps-region.store.m (removing an extra unneeded test file).  Also add a bunch of FIXME comments for future enhancements.

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

14 years agoSimplify the debug info code, handle lvalue references and template specializations.
Anders Carlsson [Fri, 6 Nov 2009 19:19:55 +0000 (19:19 +0000)]
Simplify the debug info code, handle lvalue references and template specializations.

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

14 years agoThis patch fixes code gen. part of pr5333 (Conversion
Fariborz Jahanian [Fri, 6 Nov 2009 18:47:57 +0000 (18:47 +0000)]
This patch fixes code gen. part of pr5333 (Conversion
using elipsis conversion).

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

14 years agoHandle QualifiedNameType and SubstTemplateTypeParmType types in CGDebugInfo::CreateTy...
Anders Carlsson [Fri, 6 Nov 2009 18:45:16 +0000 (18:45 +0000)]
Handle QualifiedNameType and SubstTemplateTypeParmType types in CGDebugInfo::CreateTypeNode.

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

14 years agoadd test case for PR3135 which was already fixed
Nuno Lopes [Fri, 6 Nov 2009 18:42:13 +0000 (18:42 +0000)]
add test case for PR3135 which was already fixed

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

14 years agoDon't assert when trying to generate debug info for vector types. This needs to be...
Anders Carlsson [Fri, 6 Nov 2009 18:24:04 +0000 (18:24 +0000)]
Don't assert when trying to generate debug info for vector types. This needs to be fixed eventually...

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

14 years agoDon't warn -Wsign-compare if we're in an unevaluated context, and fixed
John McCall [Fri, 6 Nov 2009 18:16:06 +0000 (18:16 +0000)]
Don't warn -Wsign-compare if we're in an unevaluated context, and fixed
a typo pointed out by Fariborz.

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

14 years agoupdate comment, pointed out by Gabor
Chris Lattner [Fri, 6 Nov 2009 18:10:47 +0000 (18:10 +0000)]
update comment, pointed out by Gabor

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

14 years agoadd some const qualifiers, patch by Kovarththanan Rajaratnam!
Chris Lattner [Fri, 6 Nov 2009 18:01:14 +0000 (18:01 +0000)]
add some const qualifiers, patch by Kovarththanan Rajaratnam!

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

14 years agoindirectbr seems to work! Rip out the old code.
Chris Lattner [Fri, 6 Nov 2009 17:38:18 +0000 (17:38 +0000)]
indirectbr seems to work!  Rip out the old code.

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

14 years agoInstead of returning a null DIType for unhandled types, assert.
Anders Carlsson [Fri, 6 Nov 2009 17:01:39 +0000 (17:01 +0000)]
Instead of returning a null DIType for unhandled types, assert.

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

14 years agoAdd a checker for CWE-466: Return of Pointer Value Outside of Expected Range.
Zhongxing Xu [Fri, 6 Nov 2009 13:30:44 +0000 (13:30 +0000)]
Add a checker for CWE-466: Return of Pointer Value Outside of Expected Range.

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

14 years agocompare.c also needs a target triple now, and improve some comments while we're
John McCall [Fri, 6 Nov 2009 08:53:51 +0000 (08:53 +0000)]
compare.c also needs a target triple now, and improve some comments while we're
at it.

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

14 years agoImprove the -Wsign-compare heuristics:
John McCall [Fri, 6 Nov 2009 08:49:08 +0000 (08:49 +0000)]
Improve the -Wsign-compare heuristics:
  * If the unsigned type is smaller than the signed type, never warn, because
    its value will not change when zero-extended to the larger type.
  * If we're testing for (in)equality, and the unsigned value is an integer
    constant whose sign bit is not set, never warn, because even though the
    signed value might change, it can't affect the result of the equality.

Also make the comparison test cases much more rigorous, and have them expose
the subtle differences between C and C++ here.

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

14 years agoCreate a warning group "non-gcc" for diagnostics which are not enabled
John McCall [Fri, 6 Nov 2009 07:53:21 +0000 (07:53 +0000)]
Create a warning group "non-gcc" for diagnostics which are not enabled
by default in GCC.  Users who want to emulate gcc's warning behavior
exactly should be able to use CC="clang -Wno-non-gcc";  this should help
projects to transition.

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

14 years agoadd some fixit hints.
Chris Lattner [Fri, 6 Nov 2009 06:40:12 +0000 (06:40 +0000)]
add some fixit hints.

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

14 years agoRework the fix-it hint for code like
Douglas Gregor [Fri, 6 Nov 2009 06:30:47 +0000 (06:30 +0000)]
Rework the fix-it hint for code like

  get_origin->x

where get_origin is actually a function and the user has forgotten the
parentheses. Instead of giving a lame note for the fix-it, give a
full-fledge error, early, then build the call expression to try to
recover.

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

14 years agoImprove recovery when we fail to parse the operand of a C++ named cast. Fixes PR5210
Douglas Gregor [Fri, 6 Nov 2009 05:48:00 +0000 (05:48 +0000)]
Improve recovery when we fail to parse the operand of a C++ named cast. Fixes PR5210

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

14 years agoTurn off -Wsign-compare warnings by default
Douglas Gregor [Fri, 6 Nov 2009 05:24:12 +0000 (05:24 +0000)]
Turn off -Wsign-compare warnings by default

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

14 years agoIf a member variable of reference type is bound to a temporary in its member initiali...
Anders Carlsson [Fri, 6 Nov 2009 04:19:02 +0000 (04:19 +0000)]
If a member variable of reference type is bound to a temporary in its member initializer it needs to be destroyed at the end of the constructor.

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

14 years agoIf a member initializer create temporaries we need to destroy them. Fixes PR5077.
Anders Carlsson [Fri, 6 Nov 2009 04:11:09 +0000 (04:11 +0000)]
If a member initializer create temporaries we need to destroy them. Fixes PR5077.

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

14 years agoMore cleanup.
Anders Carlsson [Fri, 6 Nov 2009 03:23:06 +0000 (03:23 +0000)]
More cleanup.

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

14 years agoCleanup ctor/dtor emission.
Anders Carlsson [Fri, 6 Nov 2009 02:55:43 +0000 (02:55 +0000)]
Cleanup ctor/dtor emission.

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

14 years agoHandle ParenExprs in mangleExpression.
Anders Carlsson [Fri, 6 Nov 2009 02:50:19 +0000 (02:50 +0000)]
Handle ParenExprs in mangleExpression.

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

14 years agoRefine the vcall for a function that is defined in a virtual base
Mike Stump [Fri, 6 Nov 2009 02:38:24 +0000 (02:38 +0000)]
Refine the vcall for a function that is defined in a virtual base
class that is overridden in a base that isn't morally virtual.

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

14 years agostatic analyzer: refactor checking logic for returning the address of a stack variabl...
Ted Kremenek [Fri, 6 Nov 2009 02:24:13 +0000 (02:24 +0000)]
static analyzer: refactor checking logic for returning the address of a stack variable or a garbage
value into their own respective subclasses of Checker (and put them in .cpp files where their
implementation details are hidden from GRExprEngine).

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

14 years agoIf we have a C-style cast, functional cast, or a static_cast to a
Douglas Gregor [Fri, 6 Nov 2009 01:14:41 +0000 (01:14 +0000)]
If we have a C-style cast, functional cast, or a static_cast to a
class type, don't perform the array-to-pointer or function-to-pointer
conversions, because we may end up binding a reference to a function
or array.

With this change, FileCheck now passes -fsyntax-only!

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

14 years agoWhen we encounter a derived-to-base conversion when performing an
Douglas Gregor [Fri, 6 Nov 2009 01:02:41 +0000 (01:02 +0000)]
When we encounter a derived-to-base conversion when performing an
implicit conversion sequence, check the validity of this conversion
and then perform it.

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

14 years agoMinor cleanup of my last patch.
Fariborz Jahanian [Fri, 6 Nov 2009 00:55:14 +0000 (00:55 +0000)]
Minor cleanup of my last patch.

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

14 years agoMinor cleanup: use BuiltinBug (which will soon be renamed) for DeferenceChecker and...
Ted Kremenek [Fri, 6 Nov 2009 00:44:32 +0000 (00:44 +0000)]
Minor cleanup: use BuiltinBug (which will soon be renamed) for DeferenceChecker and friends so that they always report the same bug type.

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

14 years agoThis patch implements Sema for clause 13.3.3.1p4.
Fariborz Jahanian [Fri, 6 Nov 2009 00:23:08 +0000 (00:23 +0000)]
This patch implements Sema for clause 13.3.3.1p4.
It has to do with vararg constructors used as conversion
functions. Code gen needs work. This is WIP.

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

14 years agoConvert file over to checking the .ll file for codegen. Also, we
Mike Stump [Fri, 6 Nov 2009 00:18:25 +0000 (00:18 +0000)]
Convert file over to checking the .ll file for codegen.  Also, we
speed up this file by not doing twice the checking.

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

14 years agoUpdate clang web pages with respect to Windows
John Thompson [Fri, 6 Nov 2009 00:06:29 +0000 (00:06 +0000)]
Update clang web pages with respect to Windows

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

14 years agoMake sure that EnumConstantDecls always get a type, even when they have type-dependen...
Douglas Gregor [Fri, 6 Nov 2009 00:03:12 +0000 (00:03 +0000)]
Make sure that EnumConstantDecls always get a type, even when they have type-dependent initializers.

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

14 years agoStrip off the /clang/tools/clang at the end of the Subversion URL, if it's there
Douglas Gregor [Thu, 5 Nov 2009 23:46:05 +0000 (23:46 +0000)]
Strip off the /clang/tools/clang at the end of the Subversion URL, if it's there

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

14 years agoEliminate tabls
John Thompson [Thu, 5 Nov 2009 22:03:02 +0000 (22:03 +0000)]
Eliminate tabls

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

14 years agoclean up integer preprocessor type definitions, patch by Ken Dyck!
Chris Lattner [Thu, 5 Nov 2009 21:21:32 +0000 (21:21 +0000)]
clean up integer preprocessor type definitions, patch by Ken Dyck!

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

14 years agoMake ASTContext::getIntWidth return 1 for all boolean type variations, not just for...
Sebastian Redl [Thu, 5 Nov 2009 21:10:57 +0000 (21:10 +0000)]
Make ASTContext::getIntWidth return 1 for all boolean type variations, not just for the unqualified, unaliased bool.

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

14 years agoThe signed/unsigned checker should not warn for value-dependent expressions, and...
Sebastian Redl [Thu, 5 Nov 2009 21:09:23 +0000 (21:09 +0000)]
The signed/unsigned checker should not warn for value-dependent expressions, and should especially not try to evaluate them.

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

14 years agoBe a little more careful when trying to extract a TypeDecl from a enum/class/struct...
Douglas Gregor [Thu, 5 Nov 2009 20:54:04 +0000 (20:54 +0000)]
Be a little more careful when trying to extract a TypeDecl from a enum/class/struct/union specifier; in invalid code, we may also see ClassTemplateDecls.

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

14 years agoAdding -fshort-wchar option.
John Thompson [Thu, 5 Nov 2009 20:14:16 +0000 (20:14 +0000)]
Adding -fshort-wchar option.

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

14 years agoDe-FIXME a test
Douglas Gregor [Thu, 5 Nov 2009 20:02:41 +0000 (20:02 +0000)]
De-FIXME a test

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

14 years agoDon't allow definitions of array variables without some size information in C++....
Sebastian Redl [Thu, 5 Nov 2009 19:47:47 +0000 (19:47 +0000)]
Don't allow definitions of array variables without some size information in C++. Fixed PR5401

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

14 years agoEnable debug info for global variables at -O1+
Devang Patel [Thu, 5 Nov 2009 19:13:29 +0000 (19:13 +0000)]
Enable debug info for global variables at -O1+

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

14 years agoAdds doxygen comment for HasSideEffects method.
Fariborz Jahanian [Thu, 5 Nov 2009 18:47:38 +0000 (18:47 +0000)]
Adds doxygen comment for HasSideEffects method.

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

14 years agoAdded support for static variables which require
Fariborz Jahanian [Thu, 5 Nov 2009 18:03:03 +0000 (18:03 +0000)]
Added support for static variables which require
initialization before main. Fixes pr5396.

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

14 years agoEliminate some false positives due to a thinko in the "'blah' is
Douglas Gregor [Thu, 5 Nov 2009 17:49:26 +0000 (17:49 +0000)]
Eliminate some false positives due to a thinko in the "'blah' is
always zero in this context" warning logic. Also, make the diagnostic
itself more precise when referring to pointer values ("NULL" vs. "zero").

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

14 years agoAdd Ubuntu 9.10 libstdc++ install location.
Sebastian Redl [Thu, 5 Nov 2009 17:44:49 +0000 (17:44 +0000)]
Add Ubuntu 9.10 libstdc++ install location.

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

14 years agoWhen collecting types for built-in candidates, make arrays decay to pointers. Otherwi...
Sebastian Redl [Thu, 5 Nov 2009 16:36:20 +0000 (16:36 +0000)]
When collecting types for built-in candidates, make arrays decay to pointers. Otherwise, subscripting an array leads to no candidates at all. Fixes PR5360.

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

14 years agoAdd clang_site_config user variable, so that extra tests (e.g., utils/C++Syntax)
Daniel Dunbar [Thu, 5 Nov 2009 16:36:19 +0000 (16:36 +0000)]
Add clang_site_config user variable, so that extra tests (e.g., utils/C++Syntax)
can always find the main clang site config (when invoked via CMake/Makefiles, at
least).

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

14 years agoAllow the element type of arrays to be incomplete in C++.
Sebastian Redl [Thu, 5 Nov 2009 15:52:31 +0000 (15:52 +0000)]
Allow the element type of arrays to be incomplete in C++.
This fixes PR5048. Also fix a bug where zero-sized arrays weren't warned about when the size was unsigned.

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

14 years agoParse C++0x constexpr. Test case follows when this does something useful.
Sebastian Redl [Thu, 5 Nov 2009 15:47:02 +0000 (15:47 +0000)]
Parse C++0x constexpr. Test case follows when this does something useful.

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

14 years agoDon't run anything other than the compiler in these tests.
Daniel Dunbar [Thu, 5 Nov 2009 15:28:24 +0000 (15:28 +0000)]
Don't run anything other than the compiler in these tests.

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

14 years agoFixed two places where we needed to force completion of a type
Douglas Gregor [Thu, 5 Nov 2009 13:06:35 +0000 (13:06 +0000)]
Fixed two places where we needed to force completion of a type
(without complaining if it fails) to get proper semantics: reference
binding with a derived-to-base conversion and the enumeration of
constructors for user-defined conversions. There are probably more
cases to fix, but my prior attempt at statically ensuring that
complete-type checking always happens failed. Perhaps I'll try again.

With this change, Clang can parse include/llvm/*.h!

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

14 years agoImplement the conditional-operator part of -Wsign-compare. Turn
John McCall [Thu, 5 Nov 2009 09:23:39 +0000 (09:23 +0000)]
Implement the conditional-operator part of -Wsign-compare.  Turn
DiagnoseSignCompare into Sema::CheckSignCompare and call it from more places.

Add some enumerator tests.  These seem to expose some oddities in the
types we're converting C++ enumerators to;  in particular, they're converting
to unsigned before int, which seems to contradict 4.5 [conv.prom] p2.

Note to self: stop baiting Doug in my commit messages.

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

14 years agoTweak wording and classifications of analyzer diagnostics.
Ted Kremenek [Thu, 5 Nov 2009 08:30:12 +0000 (08:30 +0000)]
Tweak wording and classifications of analyzer diagnostics.

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

14 years agoUpdate checker build.
Ted Kremenek [Thu, 5 Nov 2009 08:07:41 +0000 (08:07 +0000)]
Update checker build.

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

14 years agoAdd EXTRA_TESTDIRS variable for specifying additional test directories.
Daniel Dunbar [Thu, 5 Nov 2009 06:55:24 +0000 (06:55 +0000)]
Add EXTRA_TESTDIRS variable for specifying additional test directories.

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

14 years agoReferences can't be zero; omit zero check for return value adjustments
Mike Stump [Thu, 5 Nov 2009 06:32:02 +0000 (06:32 +0000)]
References can't be zero; omit zero check for return value adjustments
in covariant thunks that return references.

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

14 years agoRefine covariant return value adjustments for thunks when null
Mike Stump [Thu, 5 Nov 2009 06:12:26 +0000 (06:12 +0000)]
Refine covariant return value adjustments for thunks when null
pointers are returned.

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

14 years agoTestcase for a recent checkin.
Mike Stump [Thu, 5 Nov 2009 05:26:28 +0000 (05:26 +0000)]
Testcase for a recent checkin.

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

14 years agoUpdate.
Mike Stump [Thu, 5 Nov 2009 05:01:19 +0000 (05:01 +0000)]
Update.

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

14 years agoRefine layout for indirect virtual base classes.
Mike Stump [Thu, 5 Nov 2009 04:02:15 +0000 (04:02 +0000)]
Refine layout for indirect virtual base classes.

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

14 years agoFix 80-col violation.
Mike Stump [Thu, 5 Nov 2009 03:47:55 +0000 (03:47 +0000)]
Fix 80-col violation.

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

14 years agoReplace DiagnosticClient::setLangOptions with {Begin,End}SourceFile, and clarify
Daniel Dunbar [Thu, 5 Nov 2009 02:42:12 +0000 (02:42 +0000)]
Replace DiagnosticClient::setLangOptions with {Begin,End}SourceFile, and clarify
invariants (diagnostics with source informations must occur between
{Begin,End}SourceFile).

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

14 years agoConvert CreateAnalysisConsumer and friends to just take a const Preprocessor&, and...
Daniel Dunbar [Thu, 5 Nov 2009 02:41:58 +0000 (02:41 +0000)]
Convert CreateAnalysisConsumer and friends to just take a const Preprocessor&, and simplify.

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