]> granicus.if.org Git - clang/log
clang
11 years agoSimplify: replace getContext().getLangOpts() with just getLangOpts().
Richard Smith [Thu, 1 Nov 2012 22:30:59 +0000 (22:30 +0000)]
Simplify: replace getContext().getLangOpts() with just getLangOpts().

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

11 years agoClean up misapplication of diff.
Richard Smith [Thu, 1 Nov 2012 22:16:43 +0000 (22:16 +0000)]
Clean up misapplication of diff.

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

11 years agoSplit emission of -ftrapv checks and -fcatch-undefined-behavior checks into
Richard Smith [Thu, 1 Nov 2012 22:15:34 +0000 (22:15 +0000)]
Split emission of -ftrapv checks and -fcatch-undefined-behavior checks into
separate functions, since they share essentially no code.

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

11 years agoRemove divison-by-zero checks from -ftrapv. These checks were incompatible with
Richard Smith [Thu, 1 Nov 2012 22:13:39 +0000 (22:13 +0000)]
Remove divison-by-zero checks from -ftrapv. These checks were incompatible with
g++'s -ftrapv, failed to call the -ftrapv overflow handler, and are still
available under -fcatch-undefined-behavior.

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

11 years agoFix the template type diffing to handle integral template arguments.
Richard Trieu [Thu, 1 Nov 2012 21:29:28 +0000 (21:29 +0000)]
Fix the template type diffing to handle integral template arguments.

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

11 years agoSilence -Wformat on platforms where uint64_t is unsigned long.
Matt Beaumont-Gay [Thu, 1 Nov 2012 20:26:42 +0000 (20:26 +0000)]
Silence -Wformat on platforms where uint64_t is unsigned long.

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

11 years agoobjective-C block meta-data. This patch completes meta-data
Fariborz Jahanian [Thu, 1 Nov 2012 18:32:55 +0000 (18:32 +0000)]
objective-C block meta-data. This patch completes meta-data
generation for captured block variables in arc mode. This includes
inlined version of the meta-data when it can be done. It also includes
severat tests. This is wip. // rdar://12184410.

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

11 years agoMake the FilenameRange of the InclusionDirective callback more accurate,
Argyrios Kyrtzidis [Thu, 1 Nov 2012 17:52:58 +0000 (17:52 +0000)]
Make the FilenameRange of the InclusionDirective callback more accurate,
preserve the macro location of the range end if the filename came from a macro.

Patch by Kim Gräsman!

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

11 years agoFix an incorrect assert, the LHS can be an LValue.
Rafael Espindola [Thu, 1 Nov 2012 14:32:20 +0000 (14:32 +0000)]
Fix an incorrect assert, the LHS can be an LValue.

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

11 years ago-fcatch-undefined-behavior: Start checking loads and stores for null pointers.
Richard Smith [Thu, 1 Nov 2012 07:22:08 +0000 (07:22 +0000)]
-fcatch-undefined-behavior: Start checking loads and stores for null pointers.
We want the diagnostic, and if the load is optimized away, we still want to
trap it. Stop checking non-default address spaces; that doesn't work in
general.

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

11 years ago[clang.py] Add Cursor.get_arguments()
Gregory Szorc [Thu, 1 Nov 2012 05:46:30 +0000 (05:46 +0000)]
[clang.py] Add Cursor.get_arguments()

Patch provided by Matthias Kleine <matthias_kleine@gmx.de>

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

11 years agoRemove first argument from Arg::getValue; it's been unused since r105760.
Richard Smith [Thu, 1 Nov 2012 04:30:05 +0000 (04:30 +0000)]
Remove first argument from Arg::getValue; it's been unused since r105760.

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

11 years agoRemove CompilerInvocation::toArgs and clang -cc1test mode. These were untested
Richard Smith [Thu, 1 Nov 2012 03:48:49 +0000 (03:48 +0000)]
Remove CompilerInvocation::toArgs and clang -cc1test mode. These were untested
and apparently unused (and since they are untested, they're presumably also
broken).

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

11 years ago[libclang] Introduce clang_Cursor_getReceiverType which returns the CXType for
Argyrios Kyrtzidis [Thu, 1 Nov 2012 02:01:34 +0000 (02:01 +0000)]
[libclang] Introduce clang_Cursor_getReceiverType which returns the CXType for
the receiver of an ObjC message expression.

rdar://12578643

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

11 years agoclang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h: Appease...
NAKAMURA Takumi [Thu, 1 Nov 2012 01:47:02 +0000 (01:47 +0000)]
clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h: Appease msvc.

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

11 years ago[analyzer] Optimize assumeDual by assuming constraint managers are consistent.
Jordan Rose [Thu, 1 Nov 2012 01:05:39 +0000 (01:05 +0000)]
[analyzer] Optimize assumeDual by assuming constraint managers are consistent.

Specifically, if adding a constraint makes the current system infeasible,
assume the constraint is false, instead of attempting to add its negation.

In +Asserts builds we will still assert that at least one state is feasible.

Patch by Ryan Govostes!

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

11 years ago[lit] For the "case-insensitive-filesystem" make sure to create the test temporary...
Argyrios Kyrtzidis [Thu, 1 Nov 2012 00:59:15 +0000 (00:59 +0000)]
[lit] For the "case-insensitive-filesystem" make sure to create the test temporary file
in the test output directory.

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

11 years ago[analyzer] Fix typo in r167186.
Jordan Rose [Thu, 1 Nov 2012 00:25:15 +0000 (00:25 +0000)]
[analyzer] Fix typo in r167186.

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

11 years agoclang/test/Index/code-completion-skip-bodies.cpp: Add XFAIL while investigating.
NAKAMURA Takumi [Thu, 1 Nov 2012 00:20:00 +0000 (00:20 +0000)]
clang/test/Index/code-completion-skip-bodies.cpp: Add XFAIL while investigating.

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

11 years ago[analyzer] Minor cleanup in SimpleStreamChecker's class definition.
Jordan Rose [Thu, 1 Nov 2012 00:18:41 +0000 (00:18 +0000)]
[analyzer] Minor cleanup in SimpleStreamChecker's class definition.

No functionality change.

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

11 years ago[analyzer] Rename ConditionTruthVal::isTrue to isConstrainedTrue.
Jordan Rose [Thu, 1 Nov 2012 00:18:27 +0000 (00:18 +0000)]
[analyzer] Rename ConditionTruthVal::isTrue to isConstrainedTrue.

(and the same for isFalse)

No functionality change.

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

11 years agoCorrectly reject gotos in function-level try blocks. PR14225.
Eli Friedman [Wed, 31 Oct 2012 23:55:28 +0000 (23:55 +0000)]
Correctly reject gotos in function-level try blocks.  PR14225.

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

11 years ago[analyzer] Fix a bug in SimpleStreamChecker - return after sink.
Anna Zaks [Wed, 31 Oct 2012 22:17:48 +0000 (22:17 +0000)]
[analyzer] Fix a bug in SimpleStreamChecker - return after sink.

Thanks Ted.

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

11 years ago[driver] Remove an extra space with the -iprefix option, so that
Chad Rosier [Wed, 31 Oct 2012 21:08:30 +0000 (21:08 +0000)]
[driver] Remove an extra space with the -iprefix option, so that
matching works correctly.
Part of rdar://12329974

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

11 years ago[PCH] Remove the stat cache from the PCH file.
Argyrios Kyrtzidis [Wed, 31 Oct 2012 20:59:50 +0000 (20:59 +0000)]
[PCH] Remove the stat cache from the PCH file.

The stat cache became essentially useless ever since we started
validating all file entries in the PCH.
But the motivating reason for removing it now is that it also affected
correctness in this situation:

-You have a header without include guards (using "#pragma once" or #import)
-When creating the PCH:
  -The same header is referenced in an #include with different filename cases.
  -In the PCH, of course, we record only one file entry for the header file
  -But we cache in the PCH file the stat info for both filename cases

-Then the source files are updated and the header file is updated in a way that
 its size and modification time are the same but its inode changes

-When using the PCH:
  -We validate the headers, we check that header file and we create a file entry with its current inode
  -There's another #include with a filename with different case than the previously created file entry
  -In order to get its stat info we go through the cached stat info of the PCH and we receive the old inode
  -because of the different inodes, we think they are different files so we go ahead and include its contents.

Removing the stat cache will potentially break clients that are attempting to use the stat cache
as a way of avoiding having the actual input files available. If that use case is important, patches are welcome
to bring it back in a way that will actually work correctly (i.e., emit a PCH that is self-contained, coping with
literal strings, line/column computations, etc.).

This fixes rdar://5502805

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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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