]> granicus.if.org Git - clang/log
clang
12 years ago[clang tests] Added require ppc64-registered-target to Headers/altivec-header.c to...
Michael Gottesman [Wed, 31 Oct 2012 20:20:04 +0000 (20:20 +0000)]
[clang tests] Added require ppc64-registered-target to Headers/altivec-header.c to ensure it only runs on ppc64.

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

12 years ago[driver] Remove an extra space with the -internal-externc-isystem option, so
Chad Rosier [Wed, 31 Oct 2012 19:28:55 +0000 (19:28 +0000)]
[driver] Remove an extra space with the -internal-externc-isystem option, so
that matching works correctly.
Part of rdar://12329974

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

12 years agoARM AAPCS-VFP: fix tracking of allocated VFP registers.
Manman Ren [Wed, 31 Oct 2012 19:02:26 +0000 (19:02 +0000)]
ARM AAPCS-VFP: fix tracking of allocated VFP registers.

According to the spec, we can backfill VFP registers that were skipped due
to alignment constraints.

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

12 years ago[driver] Remove the -ccc-host-triple alias. This has been replaced by the
Chad Rosier [Wed, 31 Oct 2012 18:59:38 +0000 (18:59 +0000)]
[driver] Remove the -ccc-host-triple alias.  This has been replaced by the
-target option.
rdar://10692880

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

12 years agogetArchTypeForDarwinArchName is only used in the clang driver, copy it there.
Rafael Espindola [Wed, 31 Oct 2012 18:51:07 +0000 (18:51 +0000)]
getArchTypeForDarwinArchName is only used in the clang driver, copy it there.
I will remove it from llvm in the next commit.

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

12 years agoFix for -ast-dump-filter
Alexander Kornienko [Wed, 31 Oct 2012 18:46:31 +0000 (18:46 +0000)]
Fix for -ast-dump-filter

Summary:
-ast-dump-filter implementation used to stop AST traversal after traversing a NULL Decl node.

Added test and fixed.

Reviewers: djasper, klimek, rsmith

Reviewed By: djasper

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D93

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

12 years ago[driver] Completely rework how superfluous options are stripped out of the crash
Chad Rosier [Wed, 31 Oct 2012 18:31:33 +0000 (18:31 +0000)]
[driver] Completely rework how superfluous options are stripped out of the crash
diagnostics script.

This addresses the FIXME pertaining to quoted arguments.  We also delineate
between those flags that have an argument (e.g., -D macro, -MF file) and
those that do not (e.g., -M, -MM, -MG).  Finally, we add the -dwarf-debug-flags
to the list of flags to be removed.
rdar://12329974

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

12 years agoAdd "static" to some functions in altivec.c where it was missing.
Ulrich Weigand [Wed, 31 Oct 2012 18:17:07 +0000 (18:17 +0000)]
Add "static" to some functions in altivec.c where it was missing.

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

12 years agoThis patch removes the XFAIL for powerpc for
Bill Schmidt [Wed, 31 Oct 2012 17:31:46 +0000 (17:31 +0000)]
This patch removes the XFAIL for powerpc for
test/CodeGenCXX/member-alignment.cpp.  The test succeeds for
powerpc64-unknown-linux-gnu.  If other flavors of powerpc are
shown by buildbots to still be broken, we can adjust the test
at that time.

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

12 years agoIf skipping bodies is enabled outside code-completion, just skip the body directly
Argyrios Kyrtzidis [Wed, 31 Oct 2012 17:29:28 +0000 (17:29 +0000)]
If skipping bodies is enabled outside code-completion, just skip the body directly
without using tentative parsing.

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

12 years agoDecouple code-completion for the SkipFunctionBodies frontend option and
Argyrios Kyrtzidis [Wed, 31 Oct 2012 17:29:22 +0000 (17:29 +0000)]
Decouple code-completion for the SkipFunctionBodies frontend option and
add a test to make sure code-completion skips bodies.

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

12 years ago[analyzer] Let ConstraintManager subclasses provide a more efficient checkNull.
Jordan Rose [Wed, 31 Oct 2012 16:44:55 +0000 (16:44 +0000)]
[analyzer] Let ConstraintManager subclasses provide a more efficient checkNull.

Previously, every call to a ConstraintManager's isNull would do a full
assumeDual to test feasibility. Now, ConstraintManagers can override
checkNull if they have a cheaper way to do the same thing.
RangeConstraintManager can do this in less than half the work.

<rdar://problem/12608209>

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

12 years agoFix if-else braces layout accordingly to the style guide.
Simon Atanasyan [Wed, 31 Oct 2012 14:39:28 +0000 (14:39 +0000)]
Fix if-else braces layout accordingly to the style guide.

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

12 years agoExtend -Bprefix functionality and make it closer to gcc. If the "prefix"
Simon Atanasyan [Wed, 31 Oct 2012 12:01:53 +0000 (12:01 +0000)]
Extend -Bprefix functionality and make it closer to gcc. If the "prefix"
is not a directory, Driver::GetProgramPath() routine does not try to append
the program name as a "path component" to it. It just joins the "prefix" with
the program name and checks the resulting path existence.

The patch reviewed by Rafael Espindola.

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

12 years agoRemove empty directories.
Rafael Espindola [Wed, 31 Oct 2012 02:34:48 +0000 (02:34 +0000)]
Remove empty directories.

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

12 years ago[analyzer] SimpleStreamChecker - remove evalAssume and other refinements
Anna Zaks [Wed, 31 Oct 2012 02:32:41 +0000 (02:32 +0000)]
[analyzer] SimpleStreamChecker - remove evalAssume and other refinements

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

12 years agoRemove really old benchmark data.
Rafael Espindola [Wed, 31 Oct 2012 02:29:15 +0000 (02:29 +0000)]
Remove really old benchmark data.

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

12 years agoRemove the -ccc-no-clang option.
Rafael Espindola [Wed, 31 Oct 2012 01:21:20 +0000 (01:21 +0000)]
Remove the -ccc-no-clang option.

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

12 years ago[analyzer]Don't invalidate const arguments when there is no
Anna Zaks [Wed, 31 Oct 2012 01:18:26 +0000 (01:18 +0000)]
[analyzer]Don't invalidate const arguments when there is no
IdentifierInfo.

Ee: C++ copy constructors.

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

12 years agoAddress Jordan's review: comments, spaces.
Anna Zaks [Wed, 31 Oct 2012 01:18:22 +0000 (01:18 +0000)]
Address Jordan's review: comments, spaces.

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

12 years agoadd test for r167063
Seth Cantrell [Wed, 31 Oct 2012 01:03:35 +0000 (01:03 +0000)]
add test for r167063

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

12 years agoisLegalUTF8() was giving the wrong answer
Seth Cantrell [Tue, 30 Oct 2012 23:50:26 +0000 (23:50 +0000)]
isLegalUTF8() was giving the wrong answer

invalid but not caught by isLegalUTF8(): 0xED 0x75 0x84

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

12 years agoRemove ccc-no-clang-cpp, which is also dead now.
Rafael Espindola [Tue, 30 Oct 2012 23:49:11 +0000 (23:49 +0000)]
Remove ccc-no-clang-cpp, which is also dead now.

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

12 years agoHandle string encoding diagnostics when there are too many invalid ranges.
David Blaikie [Tue, 30 Oct 2012 23:22:22 +0000 (23:22 +0000)]
Handle string encoding diagnostics when there are too many invalid ranges.

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

12 years agoARM AAPCS-VFP: fix handling of homogeneous aggreate.
Manman Ren [Tue, 30 Oct 2012 23:21:41 +0000 (23:21 +0000)]
ARM AAPCS-VFP: fix handling of homogeneous aggreate.

If HA can only partially fit into VFP registers, we add padding to make sure
HA will be on stack and later VFP CPRCs will be on stack as well.

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

12 years ago[driver] Older versions of ld expect '-L<dir>' not '-L <dir>'. In Xcode4 and
Chad Rosier [Tue, 30 Oct 2012 21:42:09 +0000 (21:42 +0000)]
[driver] Older versions of ld expect '-L<dir>' not '-L <dir>'.  In Xcode4 and
later, '-L <dir>' is allowed, but rewrite these in the driver as '-L<dir>' to
maintain backward compatibility.  The same is true for the -I option.
rdar://12366753

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

12 years agoobjective-C arc/mrr: Another patch for the new captured block variable
Fariborz Jahanian [Tue, 30 Oct 2012 20:05:29 +0000 (20:05 +0000)]
objective-C arc/mrr: Another patch for the new captured block variable
layout meta-data.  It is currently off (so no tests). This is wip.

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

12 years agoChange ForceSizeOpt attribute into MinSize attribute
Quentin Colombet [Tue, 30 Oct 2012 16:33:19 +0000 (16:33 +0000)]
Change ForceSizeOpt attribute into MinSize attribute

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

12 years agoImplement descendant matchers for NestedNamespecifiers
Daniel Jasper [Tue, 30 Oct 2012 15:42:00 +0000 (15:42 +0000)]
Implement descendant matchers for NestedNamespecifiers

This implements has(), hasDescendant(), forEach() and
forEachDescendant() for NestedNameSpecifier and NestedNameSpecifierLoc
matchers.

Review: http://llvm-reviews.chandlerc.com/D86

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

12 years agoremove duplicate data array
Seth Cantrell [Tue, 30 Oct 2012 06:13:52 +0000 (06:13 +0000)]
remove duplicate data array

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

12 years agofix calculation of end pointer
Seth Cantrell [Tue, 30 Oct 2012 06:13:50 +0000 (06:13 +0000)]
fix calculation of end pointer

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

12 years agoUpdate test case.
Ted Kremenek [Tue, 30 Oct 2012 05:28:33 +0000 (05:28 +0000)]
Update test case.

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

12 years ago[asan docs] explain why asan exits on the first error
Kostya Serebryany [Tue, 30 Oct 2012 05:07:05 +0000 (05:07 +0000)]
[asan docs] explain why asan exits on the first error

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

12 years agoChange -Wcompare-distinct-pointer-type to -Wcompare-distinct-pointer-types, as
Ted Kremenek [Tue, 30 Oct 2012 04:43:57 +0000 (04:43 +0000)]
Change -Wcompare-distinct-pointer-type to -Wcompare-distinct-pointer-types, as
the warning is about comparing different types (plural).

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

12 years agoTrim #includes.
Ted Kremenek [Tue, 30 Oct 2012 04:43:51 +0000 (04:43 +0000)]
Trim #includes.

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

12 years ago[analyzer]SimpleStreamChecker: add a TODO for better leak report.
Anna Zaks [Tue, 30 Oct 2012 04:18:21 +0000 (04:18 +0000)]
[analyzer]SimpleStreamChecker: add a TODO for better leak report.

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

12 years ago[analyzer] Fix a bug in REGISTER_MAP_WITH_PROGRAMSTATE
Anna Zaks [Tue, 30 Oct 2012 04:17:40 +0000 (04:17 +0000)]
[analyzer] Fix a bug in REGISTER_MAP_WITH_PROGRAMSTATE

The ImmutableMap should not be the key into the GDM map as there could
be several entries with the same map type. Thanks, Jordan.

This complicates the usage of the macro a bit. When we want to retrieve
the whole map, we need to use another name. Currently, I set it to be
Name ## Ty as in "type of the map we are storing in the ProgramState".

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

12 years ago[analyzer] Rename REGISTER_MAP_WITH_GDM ->REGISTER_MAP_WITH_PROGRAMSTATE
Anna Zaks [Tue, 30 Oct 2012 04:17:18 +0000 (04:17 +0000)]
[analyzer] Rename REGISTER_MAP_WITH_GDM ->REGISTER_MAP_WITH_PROGRAMSTATE

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

12 years agoRemove leftover const.
Rafael Espindola [Tue, 30 Oct 2012 01:49:46 +0000 (01:49 +0000)]
Remove leftover const.

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

12 years ago[analyzer] Warn about reallocf with an allocation size of 0, like realloc.
Jordan Rose [Tue, 30 Oct 2012 01:37:16 +0000 (01:37 +0000)]
[analyzer] Warn about reallocf with an allocation size of 0, like realloc.

Patch by Sean McBride!

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

12 years ago[analyzer] New checker for missing super calls in UIViewController subclasses.
Jordan Rose [Tue, 30 Oct 2012 01:21:35 +0000 (01:21 +0000)]
[analyzer] New checker for missing super calls in UIViewController subclasses.

This is a syntactic checker aimed at helping iOS programmers correctly
subclass and override the methods of UIViewController. While this should
eventually be covered by the 'objc_requires_super' attribute, this
checker can be used with the existing iOS SDKs without any header changes.

This new checker is currently named 'alpha.osx.cocoa.MissingSuperCall'.
Patch by Julian Mayer!

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

12 years agoDon't crash on bad atomic operations. PR14176.
Eli Friedman [Tue, 30 Oct 2012 01:15:28 +0000 (01:15 +0000)]
Don't crash on bad atomic operations.  PR14176.

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

12 years agogetOriginalSourceFileName and getOriginalSourceFile can return a StringRef.
Rafael Espindola [Tue, 30 Oct 2012 00:38:13 +0000 (00:38 +0000)]
getOriginalSourceFileName and getOriginalSourceFile can return a StringRef.
MaybeAddSystemRootToFilename doesn't need to return anything, it modifies
its argument.

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

12 years ago[PCH] The diagnostic state points can refer to previously created
Argyrios Kyrtzidis [Tue, 30 Oct 2012 00:27:21 +0000 (00:27 +0000)]
[PCH] The diagnostic state points can refer to previously created
diagnostic states; make sure the ASTReader sets the diagnostic state
properly instead of always recreating it.

Fixes rdar://12581618 & http://llvm.org/PR14181

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

12 years agoIn the past "production" clang builds would not be used for c++, and
Rafael Espindola [Tue, 30 Oct 2012 00:13:16 +0000 (00:13 +0000)]
In the past "production" clang builds would not be used for c++, and
we had the -ccc-clang-cxx and -ccc-no-clang-cxx options to force them
on or off for testing.

Clang c++ support is now production quality and these options are dead.

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

12 years ago[libclang] Bump the version number of the libclang API.
Argyrios Kyrtzidis [Mon, 29 Oct 2012 23:53:52 +0000 (23:53 +0000)]
[libclang] Bump the version number of the libclang API.

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

12 years agoRemove a bit of dead code.
Rafael Espindola [Mon, 29 Oct 2012 23:41:43 +0000 (23:41 +0000)]
Remove a bit of dead code.

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

12 years agoMove getOriginalSourceFileName inline. Patch by Laszlo Nagy.
Rafael Espindola [Mon, 29 Oct 2012 23:26:40 +0000 (23:26 +0000)]
Move getOriginalSourceFileName inline. Patch by Laszlo Nagy.

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

12 years ago[libclang] Introduce a version constant for the libclang API.
Argyrios Kyrtzidis [Mon, 29 Oct 2012 23:24:44 +0000 (23:24 +0000)]
[libclang] Introduce a version constant for the libclang API.

rdar://12587974

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

12 years ago[analyzer] Malloc checker cleanup/refactor
Anna Zaks [Mon, 29 Oct 2012 22:51:54 +0000 (22:51 +0000)]
[analyzer] Malloc checker cleanup/refactor

No need for the auxiliary flag. No need to generate a leak node when
there is no error.

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

12 years ago[analyzer] Add SimpleStreamChecker.
Anna Zaks [Mon, 29 Oct 2012 22:51:50 +0000 (22:51 +0000)]
[analyzer] Add SimpleStreamChecker.

This is an example checker for catching fopen fclose API misuses.

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

12 years ago[analyzer] Add checker helpers to CheckerContext.
Anna Zaks [Mon, 29 Oct 2012 22:51:44 +0000 (22:51 +0000)]
[analyzer] Add checker helpers to CheckerContext.

- Adding Immutable Map to GDM and getIdentifierInfo helper method.

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

12 years agoRevert commit r166946
Quentin Colombet [Mon, 29 Oct 2012 18:28:57 +0000 (18:28 +0000)]
Revert commit r166946

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

12 years agoPartially roll back r166898; it exposed a bug in the standard.
Richard Smith [Mon, 29 Oct 2012 18:26:47 +0000 (18:26 +0000)]
Partially roll back r166898; it exposed a bug in the standard.

The problem is as follows: C++11 has contexts which are not
potentially-evaluated, and yet in which we are required or encouraged to
perform constant evaluation. In such contexts, we are not permitted to
implicitly define special member functions for literal types, therefore
we cannot evalaute those constant expressions.

Punt on this in one more context for now by skipping checking constexpr
variable initializers if they occur in dependent contexts.

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

12 years agoMake forcesizeopt attribute available to the end user
Quentin Colombet [Mon, 29 Oct 2012 17:56:23 +0000 (17:56 +0000)]
Make forcesizeopt attribute available to the end user

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

12 years ago-Warc-repeated-use-of-weak: allow single reads in loops from local variables.
Jordan Rose [Mon, 29 Oct 2012 17:46:47 +0000 (17:46 +0000)]
-Warc-repeated-use-of-weak: allow single reads in loops from local variables.

Previously, the warning would erroneously fire on this:

for (Test *a in someArray)
  use(a.weakProp);

...because it looks like the same property is being accessed over and over.
However, clearly this is not the case. We now ignore loops like this for
local variables, but continue to warn if the base object is a parameter,
global variable, or instance variable, on the assumption that these are
not repeatedly usually assigned to within loops.

Additionally, do-while loops where the condition is 'false' are not really
loops at all; usually they're just used for semicolon-swallowing macros or
using "break" like "goto".

<rdar://problem/12578785&12578849>

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

12 years ago[analyzer] New option to not suppress null return paths if an argument is null.
Jordan Rose [Mon, 29 Oct 2012 17:31:59 +0000 (17:31 +0000)]
[analyzer] New option to not suppress null return paths if an argument is null.

Our one basic suppression heuristic is to assume that functions do not
usually return NULL. However, when one of the arguments is NULL it is
suddenly much more likely that NULL is a valid return value. In this case,
we don't suppress the report here, but we do attach /another/ visitor to
go find out if this NULL argument also comes from an inlined function's
error path.

This new behavior, controlled by the 'avoid-suppressing-null-argument-paths'
analyzer-config option, is turned off by default. Turning it on produced
two false positives and no new true positives when running over LLVM/Clang.

This is one of the possible refinements to our suppression heuristics.
<rdar://problem/12350829>

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

12 years ago[analyzer] Use the CallEnter node to get a value for tracked null arguments.
Jordan Rose [Mon, 29 Oct 2012 17:31:53 +0000 (17:31 +0000)]
[analyzer] Use the CallEnter node to get a value for tracked null arguments.

Additionally, don't collect PostStore nodes -- they are often used in
path diagnostics.

Previously, we tried to track null arguments in the same way as any other
null values, but in many cases the necessary nodes had already been
collected (a memory optimization in ExplodedGraph). Now, we fall back to
using the value of the argument at the time of the call, which may not
always match the actual contents of the region, but often will.

This is a precursor to improving our suppression heuristic.
<rdar://problem/12350829>

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

12 years agoThis patch adds alignment information for long double to the 64-bit PowerPC
Bill Schmidt [Mon, 29 Oct 2012 14:59:24 +0000 (14:59 +0000)]
This patch adds alignment information for long double to the 64-bit PowerPC
ELF subtarget.

The existing description string is moved from PPC64TargetInfo to its
DarwinTargetInfo subclass, to avoid any changes to the Darwin ABI.
PPC64TargetInfo now has two possible description strings: one for FreeBSD,
which requires 8-byte alignment, and a default string that requires
16-byte alignment.

I've added a test for PPC64 Linux to verify the 16-byte alignment.  If
somebody wants to add a separate test for FreeBSD, that would be great.

Note that there is a companion patch to update the alignment information
in LLVM, which I am committing now as well.

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

12 years agoHandle '*' and '#' asm constraint modifiers.
Ulrich Weigand [Mon, 29 Oct 2012 12:20:54 +0000 (12:20 +0000)]
Handle '*' and '#' asm constraint modifiers.

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

12 years agoFix ASTMatchersTests to not create an overloaded-virtual warning.
Daniel Jasper [Mon, 29 Oct 2012 10:48:25 +0000 (10:48 +0000)]
Fix ASTMatchersTests to not create an overloaded-virtual warning.

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

12 years agoImplement has(), hasDescendant(), forEach() and forEachDescendant() for
Daniel Jasper [Mon, 29 Oct 2012 10:14:44 +0000 (10:14 +0000)]
Implement has(), hasDescendant(), forEach() and forEachDescendant() for
Types, QualTypes and TypeLocs.

Review: http://llvm-reviews.chandlerc.com/D83

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

12 years agoRemove spurious mode marker from .cpp file.
Nick Lewycky [Mon, 29 Oct 2012 06:05:01 +0000 (06:05 +0000)]
Remove spurious mode marker from .cpp file.

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

12 years agoAdd missing emacs major mode marker.
Nick Lewycky [Mon, 29 Oct 2012 06:03:58 +0000 (06:03 +0000)]
Add missing emacs major mode marker.

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

12 years agoFix name of this file.
Nick Lewycky [Mon, 29 Oct 2012 06:03:40 +0000 (06:03 +0000)]
Fix name of this file.

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

12 years agoAdd missing emacs major mode marker.
Nick Lewycky [Mon, 29 Oct 2012 06:02:59 +0000 (06:02 +0000)]
Add missing emacs major mode marker.

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

12 years agoimprove highlighting of invalid string encodings
Seth Cantrell [Sun, 28 Oct 2012 18:24:46 +0000 (18:24 +0000)]
improve highlighting of invalid string encodings

limit highlight to exactly the bad encoding, and highlight every
bad encoding in a string.

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

12 years agoRevert functional part of r166896 and just suppress -Wunneeded-internal-declaration...
Richard Smith [Sun, 28 Oct 2012 07:39:29 +0000 (07:39 +0000)]
Revert functional part of r166896 and just suppress -Wunneeded-internal-declaration for reference types for now. This needs more work; the cases we currently miss are a bit random.

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

12 years agoWhen determining whether to try evaluating the initializer of a variable, check
Richard Smith [Sun, 28 Oct 2012 06:18:02 +0000 (06:18 +0000)]
When determining whether to try evaluating the initializer of a variable, check
whether the initializer is value-dependent rather than whether we are in a
dependent context. This allows us to detect some errors sooner, and fixes a
crash-on-invalid if a dependent type leaks out to a non-dependent context in
error recovery.

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

12 years agoIn -Wunneeded-internal-declaration, suppress the warning for variables which
Richard Smith [Sun, 28 Oct 2012 04:47:21 +0000 (04:47 +0000)]
In -Wunneeded-internal-declaration, suppress the warning for variables which
might have been used in constant expressions, rather than suppressing it for
variables which are const. The important thing here is that such variables
can have their values used without actually being marked as 'used'.

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

12 years agoFix invalid jump scopes again. This time without trying to find out if an
Rafael Espindola [Sun, 28 Oct 2012 02:44:03 +0000 (02:44 +0000)]
Fix invalid jump scopes again. This time without trying to find out if an
incomplete type has a destructor or not.

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

12 years agoAdd a testcase from the previous bootstrap problem.
Rafael Espindola [Sun, 28 Oct 2012 02:25:27 +0000 (02:25 +0000)]
Add a testcase from the previous bootstrap problem.

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

12 years agoFix crash on missing namespace name in namespace alias definition -- PR14085.
Nico Weber [Sat, 27 Oct 2012 23:44:27 +0000 (23:44 +0000)]
Fix crash on missing namespace name in namespace alias definition -- PR14085.

Patch from Brian Brooks <brooks.brian@gmail.com>!

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

12 years agoobjective-C arc/mrr: Patch for the new block variable layout meta-data.
Fariborz Jahanian [Sat, 27 Oct 2012 21:10:38 +0000 (21:10 +0000)]
objective-C arc/mrr: Patch for the new block variable layout meta-data.
It is currently off (so no tests). This is wip.

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

12 years agoCurrently the initial value of Tok is dependent an the stack contents
Chris Lattner [Sat, 27 Oct 2012 19:49:20 +0000 (19:49 +0000)]
Currently the initial value of Tok is dependent an the stack contents
and could cause the Parser to crash on the first ConsumeToken().

Patcy by Bas van den Berg!

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

12 years agoRevert 166876 while I debug a bootstrap problem.
Rafael Espindola [Sat, 27 Oct 2012 16:49:47 +0000 (16:49 +0000)]
Revert 166876 while I debug a bootstrap problem.

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

12 years agoReapply 166855 with an early exit on null QualTypes.
Rafael Espindola [Sat, 27 Oct 2012 14:56:08 +0000 (14:56 +0000)]
Reapply 166855 with an early exit on null QualTypes.

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

12 years agoReverted back the changes made in 166868 and in 166869
Mahesha S [Sat, 27 Oct 2012 10:44:42 +0000 (10:44 +0000)]
Reverted back the changes made in 166868 and in 166869

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

12 years agoFeature:
Mahesha S [Sat, 27 Oct 2012 09:05:45 +0000 (09:05 +0000)]
Feature:
  OpenMP support.

Sub-Feature:
  Support for "#pragma omp ..." registration with
  Preprocessor.

Files Changed/Added:
  * include/clang/Basic/DiagnosticGroups.td (C)
  * include/clang/Basic/DiagnosticParseKinds.td (C)
  * include/clang/Basic/TokenKinds.def (C)
  * include/clang/Parse/Parser.h (C)
  * lib/Parse/Parser.cpp (C)

Test Cases Changed/Added:
  * test/Preprocessor/pragma_omp.c (A)
  * test/Preprocessor/pragma_omp_ignored_warning.c (A)

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

12 years ago-------------------------------------------------
Mahesha S [Sat, 27 Oct 2012 07:47:56 +0000 (07:47 +0000)]
-------------------------------------------------
Feature:
  OpenMP support in CLANG:

Sub-Feature:
  Support for option -fopenmp

Files Changed/Added:
  * include/clang/Driver/Options.td (C)
  * include/clang/Basic/LangOptions.def (C)
  * lib/Driver/Tools.cpp (C)
  * lib/Frontend/CompilerInvocation.cpp (C)

Test Cases Changed/Added:
  * test/Driver/clang_fopenmp_opt.c (A)
-------------------------------------------------

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

12 years agoRemoved an extra blank line.
Mahesha S [Sat, 27 Oct 2012 07:23:58 +0000 (07:23 +0000)]
Removed an extra blank line.

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

12 years agoAdd a reduced testcase of the last bootstrap failure.
Rafael Espindola [Sat, 27 Oct 2012 04:54:49 +0000 (04:54 +0000)]
Add a reduced testcase of the last bootstrap failure.

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

12 years agoRevert r166855. I can reproduce the bootstrap failure and have a testcase
Rafael Espindola [Sat, 27 Oct 2012 03:06:02 +0000 (03:06 +0000)]
Revert r166855. I can reproduce the bootstrap failure and have a testcase
to reduce.

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

12 years agoAdd a test case for the stack overflow in rdar://12542261
Argyrios Kyrtzidis [Sat, 27 Oct 2012 02:13:28 +0000 (02:13 +0000)]
Add a test case for the stack overflow in rdar://12542261

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

12 years agoFix cases where we were not producing an error when a computed goto could
Rafael Espindola [Sat, 27 Oct 2012 01:17:42 +0000 (01:17 +0000)]
Fix cases where we were not producing an error when a computed goto could
jump over destructor calls.
Fixes pr13812.

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

12 years agoMove two helper functions to AST so that sema can use them.
Rafael Espindola [Sat, 27 Oct 2012 01:03:43 +0000 (01:03 +0000)]
Move two helper functions to AST so that sema can use them.

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

12 years agoRefactor some code into a new findMaterializedTemporary function.
Rafael Espindola [Sat, 27 Oct 2012 00:43:14 +0000 (00:43 +0000)]
Refactor some code into a new findMaterializedTemporary function.

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

12 years agoRefactor some code into a new skipRValueSubobjectAdjustments function.
Rafael Espindola [Sat, 27 Oct 2012 00:40:06 +0000 (00:40 +0000)]
Refactor some code into a new skipRValueSubobjectAdjustments function.

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

12 years agoDelay codegen to after collecting all SubobjectAdjustment so that the collection
Rafael Espindola [Sat, 27 Oct 2012 00:36:38 +0000 (00:36 +0000)]
Delay codegen to after collecting all SubobjectAdjustment so that the collection
can be refactored and used in Sema.

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

12 years agoFix typo.
Eli Friedman [Fri, 26 Oct 2012 23:25:42 +0000 (23:25 +0000)]
Fix typo.

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

12 years agoAdd missing safety check to an optimization for do-while loops. PR14191.
Eli Friedman [Fri, 26 Oct 2012 23:23:35 +0000 (23:23 +0000)]
Add missing safety check to an optimization for do-while loops.  PR14191.

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

12 years agoFix indentation.
Eli Friedman [Fri, 26 Oct 2012 23:05:34 +0000 (23:05 +0000)]
Fix indentation.

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

12 years agoIn Parser::ParseDecltypeSpecifier, make sure the end location it returns
Argyrios Kyrtzidis [Fri, 26 Oct 2012 22:53:44 +0000 (22:53 +0000)]
In Parser::ParseDecltypeSpecifier, make sure the end location it returns
is at the end of parsed tokens when an error occurs, otherwise we'll hit
an assertion when trying to annotate the decltype tokens.

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

12 years agoDon't crash synthesizing an ObjC property with an empty struct type. <rdar://problem...
Eli Friedman [Fri, 26 Oct 2012 22:38:05 +0000 (22:38 +0000)]
Don't crash synthesizing an ObjC property with an empty struct type.  <rdar://problem/12547611>.

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

12 years agoWhen an externally-supplied record layout has a size that clearly
Douglas Gregor [Fri, 26 Oct 2012 22:31:14 +0000 (22:31 +0000)]
When an externally-supplied record layout has a size that clearly
doesn't include padding up to the alignment of the record, take this
as a cue that the alignment of the record should (conservatively) be
set to 1. This is similar to other the other cues we use to determine
that the record has a lower alignment, e.g., that the
externally-supplied layout places fields at lower offsets than we
would. Fixes <rdar://problem/12582052>; test case in LLDB.

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

12 years agoAdd comment for my patch in r166809.
Fariborz Jahanian [Fri, 26 Oct 2012 22:20:25 +0000 (22:20 +0000)]
Add comment for my patch in r166809.

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

12 years agoThis patch is a follow-up to r166805. As suggested on-list, a check was
Bill Schmidt [Fri, 26 Oct 2012 20:34:52 +0000 (20:34 +0000)]
This patch is a follow-up to r166805.  As suggested on-list, a check was
added to ensure no extra alignment code is added in the future.

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

12 years agoRemove BLOCK_BYREF_LAYOUT_BYREF flags from list of
Fariborz Jahanian [Fri, 26 Oct 2012 20:33:59 +0000 (20:33 +0000)]
Remove BLOCK_BYREF_LAYOUT_BYREF flags from list of
flags for __block variable meta-data.

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

12 years agoobjective-C IRGen: for @implementation nested in
Fariborz Jahanian [Fri, 26 Oct 2012 20:22:11 +0000 (20:22 +0000)]
objective-C IRGen: for @implementation nested in
extern "C", its method definitions must be IRGen'ed
before meta-data for class is generated. Otherwise,
IRGen crashes (to say the least).
// rdar://12581683

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

12 years ago[driver] Before applying the working directory check if the input path
Argyrios Kyrtzidis [Fri, 26 Oct 2012 20:09:24 +0000 (20:09 +0000)]
[driver] Before applying the working directory check if the input path
is absolute.

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