]> granicus.if.org Git - clang/log
clang
15 years agoFix <rdar://problem/6848739>. When using -analyze, -Werror has no effect.
Ted Kremenek [Thu, 7 May 2009 19:02:53 +0000 (19:02 +0000)]
Fix <rdar://problem/6848739>.  When using -analyze, -Werror has no effect.

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

15 years agoTighten up relationals with blocks and ints. Radar 6441502
Mike Stump [Thu, 7 May 2009 18:43:07 +0000 (18:43 +0000)]
Tighten up relationals with blocks and ints.  Radar 6441502

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

15 years agoanalyzer: Add ProgramPoint 'PostLValue' just to distinguish (for
Ted Kremenek [Thu, 7 May 2009 18:27:16 +0000 (18:27 +0000)]
analyzer: Add ProgramPoint 'PostLValue' just to distinguish (for
analysis introspection) when we computed an lvalue.  This shouldn't
effect the current analysis results in any way.

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

15 years agoBig update to the C++ status table to reflect "recent"
Douglas Gregor [Thu, 7 May 2009 17:50:16 +0000 (17:50 +0000)]
Big update to the C++ status table to reflect "recent"
development. Still much more to write!

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

15 years agoFix a FIXME in new expression checking.
Sebastian Redl [Thu, 7 May 2009 16:14:23 +0000 (16:14 +0000)]
Fix a FIXME in new expression checking.

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

15 years agoDocument the dependent type equivalence test case's purpose.
Douglas Gregor [Thu, 7 May 2009 15:40:54 +0000 (15:40 +0000)]
Document the dependent type equivalence test case's purpose.

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

15 years agoTest a few more variants of dependent type names
Douglas Gregor [Thu, 7 May 2009 15:31:47 +0000 (15:31 +0000)]
Test a few more variants of dependent type names

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

15 years agoCompute the canonical template name when building a template
Douglas Gregor [Thu, 7 May 2009 06:49:52 +0000 (06:49 +0000)]
Compute the canonical template name when building a template
specialization type for a dependent template name.

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

15 years agoStart canonicalizing template names. This is not yet complete, but it
Douglas Gregor [Thu, 7 May 2009 06:41:52 +0000 (06:41 +0000)]
Start canonicalizing template names. This is not yet complete, but it
improves type identity with dependent types.

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

15 years agoAdd support for LLLi -> int128 in builtins.def
Chris Lattner [Thu, 7 May 2009 04:47:06 +0000 (04:47 +0000)]
Add support for LLLi -> int128 in builtins.def

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

15 years agoMake this test portable to non-x86 hosts, patch by Mark Cianciosa!
Chris Lattner [Thu, 7 May 2009 04:21:16 +0000 (04:21 +0000)]
Make this test portable to non-x86 hosts, patch by Mark Cianciosa!

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

15 years agoImprove semantic checking for blocks. Radar 6441502
Mike Stump [Thu, 7 May 2009 03:14:14 +0000 (03:14 +0000)]
Improve semantic checking for blocks.  Radar 6441502

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

15 years agoAdd preliminary support for enhancing null-pointer dereference diagnostics.
Ted Kremenek [Thu, 7 May 2009 00:45:33 +0000 (00:45 +0000)]
Add preliminary support for enhancing null-pointer dereference diagnostics.

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

15 years agoBug fix: Not all ConstraintManagers always return a null state when setting
Ted Kremenek [Thu, 7 May 2009 00:45:08 +0000 (00:45 +0000)]
Bug fix: Not all ConstraintManagers always return a null state when setting
isFeasible to false. This is something we may wish to do further validation on.

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

15 years agoBack out r70506 (exception spec in AST) again. We won't have exception specs until...
Sebastian Redl [Wed, 6 May 2009 23:27:55 +0000 (23:27 +0000)]
Back out r70506 (exception spec in AST) again. We won't have exception specs until we've had a lot more discussion.

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

15 years agoHandle -march for the LLVM recognized cpu names.
Daniel Dunbar [Wed, 6 May 2009 21:56:32 +0000 (21:56 +0000)]
Handle -march for the LLVM recognized cpu names.
 - x86 target feature handling should not be feature complete, even if
   the code quality is lacking.

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

15 years agoRefactor BugReporter interface to have a new 'BugReporterContext' and
Ted Kremenek [Wed, 6 May 2009 21:39:49 +0000 (21:39 +0000)]
Refactor BugReporter interface to have a new 'BugReporterContext' and
'BugReporterVisitor'. This simplifies callbacks from BugReporter to BugReports
(via VisitNode). It also lays the foundation for arbitrary visitor "call backs"
that can be registered to a BugReporterContext as a PathDiagnostic is
constructed. These call backs can help operate as separate "experts" that can
work on constructed pieces of a PathDiagnostic for which they possess special
knowledge.

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

15 years agoIf stderr isn't a terminal, don't try to guess the terminal width or
Daniel Dunbar [Wed, 6 May 2009 21:28:42 +0000 (21:28 +0000)]
If stderr isn't a terminal, don't try to guess the terminal width or
look at COLUMNS.

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

15 years agoMore x86 target feature support.
Daniel Dunbar [Wed, 6 May 2009 21:07:50 +0000 (21:07 +0000)]
More x86 target feature support.
 - Apologies for the extremely gross code duplication, I want to get
   this working and then decide how to get this information out of the
   back end.

 - This replaces -m[no-]sse4[12] by -m[no-]sse4, it appears gcc
   doesn't distinguish them?

 - -msse, etc. now properly disable/enable related features.

 - Don't always define __SSE3__...

 - The main missing functionality bit here is that we don't initialize
   the features based on the CPU for all -march options.

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

15 years agoUpdate checker build.
Ted Kremenek [Wed, 6 May 2009 20:13:50 +0000 (20:13 +0000)]
Update checker build.

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

15 years agoDocument environment variables we handle, and don't mention -pipe (it
Daniel Dunbar [Wed, 6 May 2009 19:18:09 +0000 (19:18 +0000)]
Document environment variables we handle, and don't mention -pipe (it
isn't yet supported... lazy developers).

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

15 years agoFix analyzer regression reported in PR 4164:
Ted Kremenek [Wed, 6 May 2009 18:19:24 +0000 (18:19 +0000)]
Fix analyzer regression reported in PR 4164:
- Update the old StoreManager::CastRegion to strip off 'ElementRegions' when
  casting to void* (Zhongxing: please validate)
- Pass-by-reference argument invalidation logic in CFRefCount.cpp:
  - Strip ElementRegions when the ElementRegion is just a 'raw data' view
    on top of the underlying typed region.

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

15 years agoMore content.
Chris Lattner [Wed, 6 May 2009 17:22:08 +0000 (17:22 +0000)]
More content.

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

15 years agoImprove RegionStoreManager::getSizeInElements()
Zhongxing Xu [Wed, 6 May 2009 11:51:48 +0000 (11:51 +0000)]
Improve RegionStoreManager::getSizeInElements()
 - add a static function getTypeWidth(), which computes the width of a type
   with the help of TargetInfo.
 - no-outofbounds.c now passes for region store.

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

15 years agoadd getTargetInfo() method to ASTContext.
Zhongxing Xu [Wed, 6 May 2009 11:48:29 +0000 (11:48 +0000)]
add getTargetInfo() method to ASTContext.

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

15 years agoAdd a GDM for recording the cast type of regions.
Zhongxing Xu [Wed, 6 May 2009 08:33:50 +0000 (08:33 +0000)]
Add a GDM for recording the cast type of regions.

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

15 years agoThe super region of ElementRegion no longer needs to be TypedRegion. In the
Zhongxing Xu [Wed, 6 May 2009 08:15:46 +0000 (08:15 +0000)]
The super region of ElementRegion no longer needs to be TypedRegion. In the
future we would create ElementRegion directly on top of typeless regions.

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

15 years agoImplement a heuristic type size comparison method for now.
Zhongxing Xu [Wed, 6 May 2009 08:08:27 +0000 (08:08 +0000)]
Implement a heuristic type size comparison method for now.

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

15 years agoadjust this to bourne shell syntax
Chris Lattner [Wed, 6 May 2009 06:00:28 +0000 (06:00 +0000)]
adjust this to bourne shell syntax

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

15 years agoTweak x86 -mcpu defaults.
Daniel Dunbar [Wed, 6 May 2009 04:58:14 +0000 (04:58 +0000)]
Tweak x86 -mcpu defaults.
 - Default to yonah on Darwin (to get SSE3).

 - Default to Pentium4 (32-bit) and x86-64 (64-bit) on
   non-Darwin. Welcome to the 21st century.

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

15 years agoAdd parsing of friend specifiers.
Anders Carlsson [Wed, 6 May 2009 04:46:28 +0000 (04:46 +0000)]
Add parsing of friend specifiers.

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

15 years agoEliminate extra vertical space in Clang diagnostics
Douglas Gregor [Wed, 6 May 2009 04:43:47 +0000 (04:43 +0000)]
Eliminate extra vertical space in Clang diagnostics

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

15 years agodaniel is buggy :)
Chris Lattner [Wed, 6 May 2009 04:38:30 +0000 (04:38 +0000)]
daniel is buggy :)

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

15 years agoFix rdar://6860124 - invalid input constraint 'J' in asm
Chris Lattner [Wed, 6 May 2009 04:33:31 +0000 (04:33 +0000)]
Fix rdar://6860124 - invalid input constraint 'J' in asm
This recognizes all the target-independent constant constraints
that have target-specific meanings.

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

15 years agoAdd missing include.
Daniel Dunbar [Wed, 6 May 2009 04:07:06 +0000 (04:07 +0000)]
Add missing include.

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

15 years agoCleanup some FIXMEs.
Daniel Dunbar [Wed, 6 May 2009 03:48:17 +0000 (03:48 +0000)]
Cleanup some FIXMEs.

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

15 years agoImprove handling of (X86) target features.
Daniel Dunbar [Wed, 6 May 2009 03:16:41 +0000 (03:16 +0000)]
Improve handling of (X86) target features.
 - This is a WIP...

 - This adds -march= handling to the driver, and fixes the defaulting
   of -mcpu on Darwin (which was using the wrong test).

Instead of handling -m{sse, ...} in the driver, pass them to clang-cc as
 -target-feature [+-]name

In clang-cc, communicate with the (clang) target to discover the legal
features of a target, and the features which are enabled based on
-mcpu. This is currently hardcoded just enough to not be a feature
regression, we need to get this information from the backend's
TableGen information somehow.

This is used to construct the full list of features which are being
used, which is in turn used to initialize the predefines.

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

15 years agoremove commented code.
Zhongxing Xu [Wed, 6 May 2009 02:54:11 +0000 (02:54 +0000)]
remove commented code.

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

15 years agoadd some content
Chris Lattner [Wed, 6 May 2009 02:47:51 +0000 (02:47 +0000)]
add some content

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

15 years agoMake StoreManager::CastRegion() virtual and implement a new CastRegion() for
Zhongxing Xu [Wed, 6 May 2009 02:42:32 +0000 (02:42 +0000)]
Make StoreManager::CastRegion() virtual and implement a new CastRegion() for
RegionStore.

This CastRegion() performs casts according to the kind of the region being
cast instead of the type that is cast to.

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

15 years agoAdd --analyze-auto.
Daniel Dunbar [Wed, 6 May 2009 02:12:32 +0000 (02:12 +0000)]
Add --analyze-auto.
 - Currently just an alias for --analyze, eventually we want to refit
   --analyze so that it is less automatic (i.e., does not force plist
   output and does not hard code the list of checks).

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

15 years agoUpdate checker build.
Ted Kremenek [Wed, 6 May 2009 00:14:14 +0000 (00:14 +0000)]
Update checker build.

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

15 years agoOverride some pod2man defaults.
Daniel Dunbar [Wed, 6 May 2009 00:10:37 +0000 (00:10 +0000)]
Override some pod2man defaults.

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

15 years agoFixes a bug for objc2's gc in the presense of type-casts.
Fariborz Jahanian [Tue, 5 May 2009 23:28:21 +0000 (23:28 +0000)]
Fixes a bug for objc2's gc in the presense of type-casts.

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

15 years agoBugReporter (extensive diagnostics): improve location context generation for the
Ted Kremenek [Tue, 5 May 2009 23:13:38 +0000 (23:13 +0000)]
BugReporter (extensive diagnostics): improve location context generation for the
start of 'do' and '@synchronized' statements.

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

15 years agosource-level CFG: have the body for the @synchronized start with its own basic
Ted Kremenek [Tue, 5 May 2009 23:11:51 +0000 (23:11 +0000)]
source-level CFG: have the body for the @synchronized start with its own basic
block. This makes it a little easier for diagnostics generation.

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

15 years agoBugReporter (extensive diagnostics): Fix getEnclosingStmtLocation to reason
Ted Kremenek [Tue, 5 May 2009 22:19:17 +0000 (22:19 +0000)]
BugReporter (extensive diagnostics): Fix getEnclosingStmtLocation to reason
about Exprs that are not consumed and fix where the loop iteration diagnostic
goes.

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

15 years agoFix subtle bug in ParentMap::isConsumedExpr(): correctly ignore *parents* that
Ted Kremenek [Tue, 5 May 2009 22:16:12 +0000 (22:16 +0000)]
Fix subtle bug in ParentMap::isConsumedExpr(): correctly ignore *parents* that
are ParenExpr or CastExprs.

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

15 years agoFix rdar://6849429 - -Wunused-value with deeply nested macro expansion generates...
Chris Lattner [Tue, 5 May 2009 22:03:18 +0000 (22:03 +0000)]
Fix rdar://6849429 - -Wunused-value with deeply nested macro expansion generates untraceable warnings

The "instantiated from" messages coming from the caret diagnostics system are
basically walking the macro expansion tree, emitting each level as it goes.  However, it was
skipping certain leaves in the tree by skipping up the entire instantiation arm every time
it went up one spelling arm.  This caused it to miss some things.  For example, in this
testcase:

#define M1(x) x
#define M2 1;

void foo() {
 M1(M2)
}

we now print:

/Users/sabre/Desktop/clang-unused-value-macro.c:6:2: warning: expression result unused

 M1(M2)
 ^~~~~~
/Users/sabre/Desktop/clang-unused-value-macro.c:6:5: note: instantiated from:

 M1(M2)
    ^~
/Users/sabre/Desktop/clang-unused-value-macro.c:3:12: note: instantiated from:

#define M2 1;
           ^

Previously we didn't print the last line, so we never emitted the caret pointing to the 1!

Incidentally, the spaces between the lines is really noisy, I think we should reconsider
this heuristic (which adds them when the printed code starts too close to the start of the
line).

The regression test can't use -verify, because -verify doesn't catch notes for macro
instantiation history.

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

15 years agorename test
Chris Lattner [Tue, 5 May 2009 21:52:01 +0000 (21:52 +0000)]
rename test

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

15 years agoPatch to support Gnu runtime's typed selectors.
Fariborz Jahanian [Tue, 5 May 2009 21:36:57 +0000 (21:36 +0000)]
Patch to support Gnu runtime's typed selectors.
Patch by David Chisnall.

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

15 years ago257 -> FS
Chris Lattner [Tue, 5 May 2009 18:54:47 +0000 (18:54 +0000)]
257 -> FS

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

15 years agoEnable tight Objective-C interface layout unconditionally.
Daniel Dunbar [Tue, 5 May 2009 18:52:50 +0000 (18:52 +0000)]
Enable tight Objective-C interface layout unconditionally.
 - I will remove the flag when I'm comfortable there is no fallout
   from this.

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

15 years agoImplement attribute 'ns_autorelease'.
Ted Kremenek [Tue, 5 May 2009 18:44:20 +0000 (18:44 +0000)]
Implement attribute 'ns_autorelease'.

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

15 years agoIssue a warning in odd case of instance method used
Fariborz Jahanian [Tue, 5 May 2009 18:34:37 +0000 (18:34 +0000)]
Issue a warning in odd case of instance method used
in a 'Class' receiver which is not a root instance
method.

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

15 years agoremove some incorrect and unimplemented atomic builtins (e.g.
Chris Lattner [Tue, 5 May 2009 17:48:42 +0000 (17:48 +0000)]
remove some incorrect and unimplemented atomic builtins (e.g.
__sync_umin_and_fetch), add some missing atomic builtins (e.g.
__sync_fetch_and_nand) and reorder the list to match the GCC
documentation.  The builtins still need work and codegen
implementation, more patches coming.

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

15 years agoEnhance ownership attribute tests with functions that use the attributes!
Ted Kremenek [Tue, 5 May 2009 17:46:22 +0000 (17:46 +0000)]
Enhance ownership attribute tests with functions that use the attributes!

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

15 years agoWhen defining a function whose type has no prototype, make an effort
Chris Lattner [Tue, 5 May 2009 06:16:31 +0000 (06:16 +0000)]
When defining a function whose type has no prototype, make an effort
to go back and clean up existing uses of the bitcasted function.  This
is not just an optimization: it is required for correctness to get
always inline functions to work, see testcases in function-attributes.c.

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

15 years agofix some more cases where we'd emit a file with a line of 0 for implicit
Chris Lattner [Tue, 5 May 2009 05:16:17 +0000 (05:16 +0000)]
fix some more cases where we'd emit a file with a line of 0 for implicit
types.  In this case, it was objc_selector and objc_class.  This fixes
rdar://6852754 - clang sometimes generates incorrect/unknown file/line info for DW_TAG__structure_type dies

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

15 years agoDo not generate bogus location info for DW_TAG_inheritance
Chris Lattner [Tue, 5 May 2009 05:05:36 +0000 (05:05 +0000)]
Do not generate bogus location info for DW_TAG_inheritance
DIEs.  We were generating a loc with line of 0 and a file.
These tags do not need locations at all, just remove it.
this fixes rdar://6852792 - Clang generates incorrect (and unnecessary) file and line info for DW_TAG_inheritance dies

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

15 years agoFix generated debug info for decls with no location (which include self/_cmd
Chris Lattner [Tue, 5 May 2009 04:57:08 +0000 (04:57 +0000)]
Fix generated debug info for decls with no location (which include self/_cmd
in ObjC) to not emit file/line location information.  Previously
we would output a file with bogus line information.  This fixes:
rdar://6852814 - Clang generates incorrect file & line info for automatic/understood formal parameters for objc-programs

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

15 years agoTurns out that Sebastian already implemented the logic to compute the
Douglas Gregor [Tue, 5 May 2009 04:50:50 +0000 (04:50 +0000)]
Turns out that Sebastian already implemented the logic to compute the
composite pointer type, and his is better! Updated relational- and
equality-operator checking accordingly.

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

15 years agoRefactor global decls to hold either a regular Decl or a CXXConstructorDecl + ctor...
Anders Carlsson [Tue, 5 May 2009 04:44:02 +0000 (04:44 +0000)]
Refactor global decls to hold either a regular Decl or a CXXConstructorDecl + ctor type or a CXXDestructorDecl + dtor type.

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

15 years agoUpdate checker build.
Ted Kremenek [Tue, 5 May 2009 03:56:29 +0000 (03:56 +0000)]
Update checker build.

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

15 years agoImplement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').
Ted Kremenek [Tue, 5 May 2009 00:46:09 +0000 (00:46 +0000)]
Implement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').

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

15 years agoRemove an unneeded lookup routine.
Daniel Dunbar [Tue, 5 May 2009 00:36:57 +0000 (00:36 +0000)]
Remove an unneeded lookup routine.

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

15 years agoRename ownership attributes:
Ted Kremenek [Tue, 5 May 2009 00:21:59 +0000 (00:21 +0000)]
Rename ownership attributes:
 ns_ownership_returns -> ns_returns_owned
 ns_ownership_retain -> ns_retains
 ns_ownership_release -> ns_releases
 cf_ownership_retain ->  cf_retains
 cf_ownership_release -> cf_releases

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

15 years agoFix unused variable warning
Ted Kremenek [Tue, 5 May 2009 00:06:16 +0000 (00:06 +0000)]
Fix unused variable warning

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

15 years agoRemove possibly incorrect assertion that doesn't matter.
Ted Kremenek [Tue, 5 May 2009 00:02:18 +0000 (00:02 +0000)]
Remove possibly incorrect assertion that doesn't matter.

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

15 years agoRename attribute 'ns_ownership_returns' to 'ns_returns_ownership'.
Ted Kremenek [Mon, 4 May 2009 23:52:59 +0000 (23:52 +0000)]
Rename attribute 'ns_ownership_returns' to 'ns_returns_ownership'.

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

15 years agoRemove experimental attribute 'ns_ownership_make_collectable.'
Ted Kremenek [Mon, 4 May 2009 23:46:06 +0000 (23:46 +0000)]
Remove experimental attribute 'ns_ownership_make_collectable.'

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

15 years agoProvide basic support for generation of objc2's
Fariborz Jahanian [Mon, 4 May 2009 23:27:20 +0000 (23:27 +0000)]
Provide basic support for generation of objc2's
objc_assign_global API when assigning to global
objective-c object pointer.

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

15 years agoFix the field count in interface record layout (it was incorrectly
Daniel Dunbar [Mon, 4 May 2009 23:23:09 +0000 (23:23 +0000)]
Fix the field count in interface record layout (it was incorrectly
compensating for super classes). This was making the reported class
sizes for empty classes very, very wrong.
 - Also, we now report the size info for an empty class like gcc (as
   the offset of the start, not as 0, 0).

 - Add a few more test cases we were mishandling before (padding bit
   field at end of struct, for example).

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

15 years agoAdding more test to ivar-layout-64.m.
Fariborz Jahanian [Mon, 4 May 2009 21:46:27 +0000 (21:46 +0000)]
Adding more test to ivar-layout-64.m.

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

15 years agoCompute interface instanceStart and instanceSize using the record
Daniel Dunbar [Mon, 4 May 2009 21:26:30 +0000 (21:26 +0000)]
Compute interface instanceStart and instanceSize using the record
layout.
 - This is much simpler / more efficient.

 - This also properly computes the size in the presence of bit-fields.

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

15 years agoAdd ASTRecordLayout::getFieldCount accessor, change NextOffset field to 64-bits.
Daniel Dunbar [Mon, 4 May 2009 21:10:32 +0000 (21:10 +0000)]
Add ASTRecordLayout::getFieldCount accessor, change NextOffset field to 64-bits.

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

15 years agoAdd ASTRecordLayout::getNextOffset accessor, and some doxygen comments.
Daniel Dunbar [Mon, 4 May 2009 21:00:40 +0000 (21:00 +0000)]
Add ASTRecordLayout::getNextOffset accessor, and some doxygen comments.

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

15 years agoInitialize NextOffset correctly, otherwise tight layout fails for
Daniel Dunbar [Mon, 4 May 2009 20:52:37 +0000 (20:52 +0000)]
Initialize NextOffset correctly, otherwise tight layout fails for
empty classes.

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

15 years agoignore weak_import attribute on objc method decls.
Fariborz Jahanian [Mon, 4 May 2009 19:35:12 +0000 (19:35 +0000)]
ignore weak_import attribute on objc method decls.

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

15 years agoRename attributes 'objc_ownership...' to 'ns_ownership...'.
Ted Kremenek [Mon, 4 May 2009 19:10:19 +0000 (19:10 +0000)]
Rename attributes 'objc_ownership...' to 'ns_ownership...'.

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

15 years agoIncrease scan-view max timeout to 1 minute.
Ted Kremenek [Mon, 4 May 2009 19:02:41 +0000 (19:02 +0000)]
Increase scan-view max timeout to 1 minute.

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

15 years ago"Fix" a problem with debug info in the presence of always_inline
Chris Lattner [Mon, 4 May 2009 18:27:04 +0000 (18:27 +0000)]
"Fix" a problem with debug info in the presence of always_inline
function calls.  For a program like this:

#include <stdio.h>
static __inline__ __attribute__((always_inline))
int bar(int x) { return 4; }
int main() {
  int X = bar(4);
  printf("%d\n", X);
}

clang was not outputing any debug info for the body of main().  This is
because the backend is getting confused by the region_start/end that clang
is emitting for block scopes.  For now, just disable these (matching llvm-gcc),
this stuff is in progress of rework anyway.

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

15 years agoBugReporter (extensive diagnostics): don't mark location contexts that are
Ted Kremenek [Mon, 4 May 2009 18:15:17 +0000 (18:15 +0000)]
BugReporter (extensive diagnostics): don't mark location contexts that are
control-flow expressions as dead.

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

15 years agoFix false positive null dereference by unifying code paths in GRSimpleVals for
Ted Kremenek [Mon, 4 May 2009 17:53:11 +0000 (17:53 +0000)]
Fix false positive null dereference by unifying code paths in GRSimpleVals for
'==' and '!=' (some code in the '!=' was not replicated in the '==' code,
causing some constraints to get lost).

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

15 years agoRename attributes:
Ted Kremenek [Mon, 4 May 2009 17:29:57 +0000 (17:29 +0000)]
Rename attributes:
'objc_ownership_cfretain' -> 'cf_ownership_retain'
'objc_ownership_cfrelease' -> 'cf_ownership_release'

Motivation: Core Foundation objects can be used in isolation from Objective-C,
and this forces users to reason about the separate semantics of CF objects. More
Sema support pending.

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

15 years agoUpdate test case.
Ted Kremenek [Mon, 4 May 2009 17:27:32 +0000 (17:27 +0000)]
Update test case.

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

15 years agoRemove support for ObjCMethodDecl attributes that appear between the
Ted Kremenek [Mon, 4 May 2009 17:04:30 +0000 (17:04 +0000)]
Remove support for ObjCMethodDecl attributes that appear between the
return type and the selector.  This is inconsistent with C functions
(where such attributes would be placed on the return type, not the the
FunctionDecl), and is inconsistent with what people are use to seeing.

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

15 years ago"The attached diff fixes the //FIXME in message send to super. This should now be...
Chris Lattner [Mon, 4 May 2009 16:56:33 +0000 (16:56 +0000)]
"The attached diff fixes the //FIXME in message send to super.  This should now be faster, and works in the presence of class posing.  This is now the same approach as used in GCC (the earlier code was a quick hack to get something working)."

Patch by David Chisnall!

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

15 years agoretain checker: Add checker support for FunctionDecl ownership annotations. Need...
Ted Kremenek [Mon, 4 May 2009 16:43:50 +0000 (16:43 +0000)]
retain checker: Add checker support for FunctionDecl ownership annotations.  Need to add Sema support.

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

15 years agoretain checker: Pull out logic for parameter annotations into a
Ted Kremenek [Mon, 4 May 2009 15:40:58 +0000 (15:40 +0000)]
retain checker: Pull out logic for parameter annotations into a
separate method.

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

15 years agoretain checker: Don't treat function's declared in macros differently.
Ted Kremenek [Mon, 4 May 2009 15:34:07 +0000 (15:34 +0000)]
retain checker: Don't treat function's declared in macros differently.

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

15 years agoPatch from David Chisnall:
Daniel Dunbar [Mon, 4 May 2009 15:31:17 +0000 (15:31 +0000)]
Patch from David Chisnall:

The attached diff fixes the //FIXME in message send to super.  This
should now be faster, and works in the presence of class posing.  This
is now the same approach as used in GCC (the earlier code was a quick
hack to get something working).

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

15 years agoAdd array index assertion: BasicStore should not expect any fancy
Ted Kremenek [Mon, 4 May 2009 15:25:46 +0000 (15:25 +0000)]
Add array index assertion: BasicStore should not expect any fancy
ElementRegions that have non-zero array indices.

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

15 years agoUpdate test case... the location given for this error makes it look
Daniel Dunbar [Mon, 4 May 2009 15:18:44 +0000 (15:18 +0000)]
Update test case... the location given for this error makes it look
rather odd when truncated.

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

15 years agoRename 'makeZeroIndex' to 'makeZeroArrayIndex'.
Ted Kremenek [Mon, 4 May 2009 15:17:38 +0000 (15:17 +0000)]
Rename 'makeZeroIndex' to 'makeZeroArrayIndex'.

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

15 years agoZhongxing already implemented this FIXME.
Ted Kremenek [Mon, 4 May 2009 15:14:27 +0000 (15:14 +0000)]
Zhongxing already implemented this FIXME.

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

15 years agoRename no-outofbounds.c to xfail-no-outofbounds.c and split off that
Ted Kremenek [Mon, 4 May 2009 14:31:19 +0000 (14:31 +0000)]
Rename no-outofbounds.c to xfail-no-outofbounds.c and split off that
test into a separate file to monitor the fact that BasicStoreManager
passes the test.

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

15 years agoUpdate checker build.
Ted Kremenek [Mon, 4 May 2009 14:24:29 +0000 (14:24 +0000)]
Update checker build.

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

15 years agoarray indexes are unsigned integers of the same width as pointer.
Zhongxing Xu [Mon, 4 May 2009 08:52:47 +0000 (08:52 +0000)]
array indexes are unsigned integers of the same width as pointer.
no-outofbounds.c still fails. Previously it passed because the array index
is mistakenly a loc::ConcreteInt.

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

15 years agoTest now passes. I'll hold off merging it with the BasicStore test until we know...
Ted Kremenek [Mon, 4 May 2009 07:11:21 +0000 (07:11 +0000)]
Test now passes.  I'll hold off merging it with the BasicStore test until we know this is a stable change.

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