]> granicus.if.org Git - clang/log
clang
11 years agoDisallow using -fmodules with -no-integrated-as.
Ted Kremenek [Mon, 11 Mar 2013 20:51:52 +0000 (20:51 +0000)]
Disallow using -fmodules with -no-integrated-as.

Modules enables features such as auto-linking, and we simply do not want to
support a matrix of subtly enabled/disabled features depending on whether or
not a user is using the integrated assembler.

It isn't clear if this is the best place to do this check.  For one thing,
these kind of errors are not caught by the serialized diagnostics.

Fixes <rdar://problem/13289240>

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

11 years agoImprove the caching of debuginfo Objective C interface types.
Adrian Prantl [Mon, 11 Mar 2013 18:33:46 +0000 (18:33 +0000)]
Improve the caching of debuginfo Objective C interface types.
Generate forward declarations that are RAUW'd by finalize().
We thus avoid outputting the same type several times in multiple
stages of completion.

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

11 years agoAdd -Wc99-compat warning for C11 unicode string and character literals.
Richard Smith [Mon, 11 Mar 2013 18:01:42 +0000 (18:01 +0000)]
Add -Wc99-compat warning for C11 unicode string and character literals.

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

11 years agoPartly revert "Move clang tests that depend on llvm/ADT/Statistic.h to a subdir".
Jan Wen Voung [Mon, 11 Mar 2013 17:48:03 +0000 (17:48 +0000)]
Partly revert "Move clang tests that depend on llvm/ADT/Statistic.h to a subdir".

This reverts commit 176730, and uses "REQUIRES: asserts" instead.

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

11 years ago[docs] Add ellipsis.
Sean Silva [Mon, 11 Mar 2013 17:07:47 +0000 (17:07 +0000)]
[docs] Add ellipsis.

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

11 years ago[libclang] Fix a test and a warning on windows.
Argyrios Kyrtzidis [Mon, 11 Mar 2013 16:03:17 +0000 (16:03 +0000)]
[libclang] Fix a test and a warning on windows.

Patch by Guy Benyei!

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

11 years agoAdd a test case for the 'vec_type_hint' attribute that was introduced in
Joey Gouly [Mon, 11 Mar 2013 12:38:45 +0000 (12:38 +0000)]
Add a test case for the 'vec_type_hint' attribute that was introduced in
r176686. I missed this file in the previous commit.

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

11 years agoPR15480: fixed second parameter types of vec_lde, vec_lvebx, vec_lvehx, and vec_lvewx...
Anton Yartsev [Sun, 10 Mar 2013 16:25:43 +0000 (16:25 +0000)]
PR15480: fixed second parameter types of vec_lde, vec_lvebx, vec_lvehx, and vec_lvewx according to AltiVec Programming Interface Manual

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

11 years agoDriver: do not strip file extensions when printing diagnostics.
Benjamin Kramer [Sun, 10 Mar 2013 13:16:18 +0000 (13:16 +0000)]
Driver: do not strip file extensions when printing diagnostics.

Before: clang-3: error: no input files
After:  clang-3.3: error: no input files

This means that we'll also print clang.exe on windows, but I don't see a problem
with that.

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

11 years agoFix indirect byval passing of records in address spaced memory. Allocate memory on...
Guy Benyei [Sun, 10 Mar 2013 12:59:00 +0000 (12:59 +0000)]
Fix indirect byval passing of records in address spaced memory. Allocate memory on stack, and memcpy the actual value before the call.

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

11 years agowww tweaks to embiggen up our near-complete C++11 and C11 support.
Richard Smith [Sun, 10 Mar 2013 00:11:00 +0000 (00:11 +0000)]
www tweaks to embiggen up our near-complete C++11 and C11 support.

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

11 years agoWhen lexing in C11 mode, accept unicode character and string literals, per C11
Richard Smith [Sat, 9 Mar 2013 23:56:02 +0000 (23:56 +0000)]
When lexing in C11 mode, accept unicode character and string literals, per C11
6.4.4.4/1 and 6.4.5/1.

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

11 years agoHandle _Pragma on a u8, u, or U string literal per the C11 specification. Also
Richard Smith [Sat, 9 Mar 2013 23:30:15 +0000 (23:30 +0000)]
Handle _Pragma on a u8, u, or U string literal per the C11 specification. Also
handle raw string literals here. C++11 doesn't yet specify how they will
behave, but discussion on core suggests that we should just strip off
everything but the r-char-sequence.

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

11 years agoRemove unused diagnostic.
Benjamin Kramer [Sat, 9 Mar 2013 18:44:47 +0000 (18:44 +0000)]
Remove unused diagnostic.

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

11 years agoMake helper function static.
Benjamin Kramer [Sat, 9 Mar 2013 15:15:22 +0000 (15:15 +0000)]
Make helper function static.

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

11 years ago[analyzer] Make Suppress IDC checker aware that it might not start from the same...
Anna Zaks [Sat, 9 Mar 2013 03:23:19 +0000 (03:23 +0000)]
[analyzer] Make Suppress IDC checker aware that it might not start from the same node it was registered at

The visitor used to assume that the value it’s tracking is null in the first node it examines. This is not true.
If we are registering the Suppress Inlined Defensive checks visitor while traversing in another visitor
(such as FindlastStoreVisitor). When we restart with the IDC visitor, the invariance of the visitor does
not hold since the symbol we are tracking no longer exists at that point.

I had to pass the ErrorNode when creating the IDC visitor, because, in some cases, node N is
neither the error node nor will be visible along the path (we had not finalized the path at that point
and are dealing with ExplodedGraph.)

We should revisit the other visitors which might not be aware that they might get nodes, which are
later in path than the trigger point.

This suppresses a number of inline defensive checks in JavaScriptCore.

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

11 years ago[analyzer] Rename AttrNonNullChecker -> NonNullParamChecker
Anna Zaks [Sat, 9 Mar 2013 03:23:14 +0000 (03:23 +0000)]
[analyzer] Rename AttrNonNullChecker -> NonNullParamChecker

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

11 years ago[analyzer] Add test case for reference to null pointer param check
Anna Zaks [Sat, 9 Mar 2013 03:23:10 +0000 (03:23 +0000)]
[analyzer] Add test case for reference to null pointer param check

This tests that we track the original Expr if getDerefExpr fails.

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

11 years ago[analyzer] Be more consistent about Objective-C methods that free memory.
Jordan Rose [Sat, 9 Mar 2013 00:59:10 +0000 (00:59 +0000)]
[analyzer] Be more consistent about Objective-C methods that free memory.

Previously, MallocChecker's pointer escape check and its post-call state
update for Objective-C method calls had a fair amount duplicated logic
and not-entirely-consistent checks. This commit restructures all this to
be more consistent and possibly allow us to be more aggressive in warning
about double-frees.

New policy (applies to system header methods only):
(1) If this is a method we know about, model it as taking/holding ownership
    of the passed-in buffer.
  (1a) ...unless there's a "freeWhenDone:" parameter with a zero (NO) value.
(2) If there's a "freeWhenDone:" parameter (but it's not a method we know
    about), treat the buffer as escaping if the value is non-zero (YES) and
    non-escaping if it's zero (NO).
(3) If the first selector piece ends with "NoCopy" (but it's not a method we
    know about and there's no "freeWhenDone:" parameter), treat the buffer
    as escaping.

The reason that (2) and (3) don't explicitly model the ownership transfer is
because we can't be sure that they will actually free the memory using free(),
and we wouldn't want to emit a spurious "mismatched allocator" warning
(coming in Anton's upcoming patch). In the future, we may have an idea of a
"generic deallocation", i.e. we assume that the deallocator is correct but
still continue tracking the region so that we can warn about double-frees.

Patch by Anton Yartsev, with modifications from me.

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

11 years agoAdjust the special non-C++ enum block return type inference
John McCall [Sat, 9 Mar 2013 00:54:31 +0000 (00:54 +0000)]
Adjust the special non-C++ enum block return type inference
so that it looks through certain syntactic forms and applies
even if normal inference would have succeeded.

There is potential for source incompatibility from this
change, but overall we feel that it produces a much
cleaner and more defensible result, and the block
compatibility rules should curb a lot of the potential
for annoyance.

rdar://13200889

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

11 years agoAdd TagDecl::hasNameForLinkage(), which is true if the tag
John McCall [Sat, 9 Mar 2013 00:54:27 +0000 (00:54 +0000)]
Add TagDecl::hasNameForLinkage(), which is true if the tag
is non-anonymous or is defined in a typedef of itself.

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

11 years agoDocumentation parsing. Some refactoring and code
Fariborz Jahanian [Fri, 8 Mar 2013 23:59:23 +0000 (23:59 +0000)]
Documentation parsing. Some refactoring and code
improvements per Dmtiri's comments. // rdar://12379114

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

11 years ago[analyzer] Look for lvalue nodes when tracking a null pointer.
Jordan Rose [Fri, 8 Mar 2013 23:30:56 +0000 (23:30 +0000)]
[analyzer] Look for lvalue nodes when tracking a null pointer.

r176010 introduced the notion of "interesting" lvalue expressions, whose
nodes are guaranteed never to be reclaimed by the ExplodedGraph. This was
used in bugreporter::trackNullOrUndefValue to find the region that contains
the null or undef value being tracked.

However, the /rvalue/ nodes (i.e. the loads from these lvalues that produce
a null or undef value) /are/ still being reclaimed, and if we couldn't
find the node for the rvalue, we just give up. This patch changes that so
that we look for the node for either the rvalue or the lvalue -- preferring
the former, since it lets us fall back to value-only tracking in cases
where we can't get a region, but allowing the latter as well.

<rdar://problem/13342842>

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

11 years ago[analyzer] Don't rely on finding the correct return statement for suppression.
Jordan Rose [Fri, 8 Mar 2013 23:30:53 +0000 (23:30 +0000)]
[analyzer] Don't rely on finding the correct return statement for suppression.

Previously, ReturnVisitor waited to suppress a null return path until it
had found the inlined "return" statement. Now, it checks up front whether
the return value was NULL, and suppresses the warning right away if so.

We still have to wait until generating the path notes to invalidate the bug
report, or counter-suppression will never be triggered. (Counter-suppression
happens while generating path notes, but the generation won't happen for
reports already marked invalid.)

This isn't actually an issue today because we never reclaim nodes for
top-level statements (like return statements), but it could be an issue
some day in the future. (But, no expected behavioral change and no new
test case.)

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

11 years ago[libclang] Change clang_findReferencesInFile and clang_findIncludesInFile to return...
Argyrios Kyrtzidis [Fri, 8 Mar 2013 22:47:41 +0000 (22:47 +0000)]
[libclang] Change clang_findReferencesInFile and clang_findIncludesInFile to return an enum,
as suggested by Jordan.

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

11 years ago<rdar://problem/13170740> Be a little more careful when instantiating 'this' expressions.
Douglas Gregor [Fri, 8 Mar 2013 22:43:48 +0000 (22:43 +0000)]
<rdar://problem/13170740> Be a little more careful when instantiating 'this' expressions.

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

11 years agoMove clang tests that depend on llvm/ADT/Statistic.h to a subdir.
Jan Wen Voung [Fri, 8 Mar 2013 22:42:02 +0000 (22:42 +0000)]
Move clang tests that depend on llvm/ADT/Statistic.h to a subdir.

The subdirectory has a lit.local.cfg that marks the tests unsupported
if llvm was built without Asserts.  There will be a patch in LLVM
that disables statistics gathering when built without Asserts so
that full Release builds can be faster.  Statistics can also
be enabled by building with -DLLVM_ENABLE_STATS.

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

11 years agoSema: Preserve attributes on parameters in instantiated function templates.
Jordan Rose [Fri, 8 Mar 2013 22:25:36 +0000 (22:25 +0000)]
Sema: Preserve attributes on parameters in instantiated function templates.

This was causing correctness issues for ARC and the static analyzer when a
function template has "consumed" Objective-C object parameters (i.e.
parameters that will be released by the function before returning).

The fix is threefold:
(1) Actually copy over the attributes from old ParmVarDecls to new ones.
(2) Have Sema::BuildFunctionType only work for building FunctionProtoTypes,
    which it was doing anyway. This allows us to pass an ExtProtoInfo
    instead of a plain ExtInfo and several flags.
(3) Drop param attributes as part of StripImplicitInstantiation, which is
    used when an implicit instantiation is followed by an explicit one.

<rdar://problem/12685622>

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

11 years ago<rdar://problem/13094134> Don't try to wire up typedef names for invalid anonymous...
Douglas Gregor [Fri, 8 Mar 2013 22:15:15 +0000 (22:15 +0000)]
<rdar://problem/13094134> Don't try to wire up typedef names for invalid anonymous tag declarations encountered during template instantiation.

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

11 years agoArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.
Jordan Rose [Fri, 8 Mar 2013 21:51:21 +0000 (21:51 +0000)]
ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.

No (intended) functionality change.

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

11 years ago<rdar://problem/13140795> Transform the scope type of a pseudo-destructor expression...
Douglas Gregor [Fri, 8 Mar 2013 21:25:01 +0000 (21:25 +0000)]
<rdar://problem/13140795> Transform the scope type of a pseudo-destructor expression within the object scope.

We were transforming the scope type of a pseudo-destructor expression
(e.g., the first T in x->T::~T()) as a freestanding type, which meant
that dependent template specialization types here would stay dependent
even when no template parameters were named. This would eventually
mean that a dependent expression would end up in what should be
fully-instantiated ASTs, causing IRgen to assert.

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

11 years ago[PCH] When complaining that a header from the PCH was modified, also mention
Argyrios Kyrtzidis [Fri, 8 Mar 2013 20:42:38 +0000 (20:42 +0000)]
[PCH] When complaining that a header from the PCH was modified, also mention
the filename of the PCH file.

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

11 years ago[libclang] Modify clang_findReferencesInFile and clang_findIncludesInFile to return...
Argyrios Kyrtzidis [Fri, 8 Mar 2013 20:42:33 +0000 (20:42 +0000)]
[libclang] Modify clang_findReferencesInFile and clang_findIncludesInFile to return a value.

Possible values are:
 1  : if a parameter was invalid
 -1 : if the callback returned CXVisit_Break,
 otherwise returns 0.

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

11 years agoFixes breaking of string literals.
Manuel Klimek [Fri, 8 Mar 2013 18:59:48 +0000 (18:59 +0000)]
Fixes breaking of string literals.

1. We now ignore all non-default string literals, including raw
literals.
2. We do not break inside escape sequences any more.

FIXME: We still break in trigraphs.

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

11 years agoRemove unused variable.
Benjamin Kramer [Fri, 8 Mar 2013 17:04:47 +0000 (17:04 +0000)]
Remove unused variable.

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

11 years agoAdd support for the OpenCL attribute 'vec_type_hint'.
Joey Gouly [Fri, 8 Mar 2013 09:42:32 +0000 (09:42 +0000)]
Add support for the OpenCL attribute 'vec_type_hint'.

Patch by Murat Bolat!

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

11 years ago[libclang] Introduce clang_findIncludesInFile, that can be used to retrieve all ...
Argyrios Kyrtzidis [Fri, 8 Mar 2013 02:32:34 +0000 (02:32 +0000)]
[libclang] Introduce clang_findIncludesInFile, that can be used to retrieve all #import/#include directives in a specific file.

It passes to the visitor, that the caller provides, CXCursor_InclusionDirective cursors for
all the include directives in a particular file.

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

11 years ago[libclang] When calling the function of CXCursorAndRangeVisitor, don't forget to
Argyrios Kyrtzidis [Fri, 8 Mar 2013 02:32:29 +0000 (02:32 +0000)]
[libclang] When calling the function of CXCursorAndRangeVisitor, don't forget to
stop visitation if it returns CXVisit_Break.

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

11 years ago[libclang] Add Logger::operator<< overloads for CXCursor and FileEntry.
Argyrios Kyrtzidis [Fri, 8 Mar 2013 02:32:26 +0000 (02:32 +0000)]
[libclang] Add Logger::operator<< overloads for CXCursor and FileEntry.

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

11 years ago[driver] If we're just linking, don't report --param X as unused option.
Chad Rosier [Fri, 8 Mar 2013 00:05:21 +0000 (00:05 +0000)]
[driver] If we're just linking, don't report --param X as unused option.
PR15327
rdar://13372628

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

11 years agoHeaderDoc: Support more of HeaderDoc documentation
Fariborz Jahanian [Thu, 7 Mar 2013 23:33:11 +0000 (23:33 +0000)]
HeaderDoc: Support more of HeaderDoc documentation
commands; top level tags such as @interface and
their 2nd level tags such as @coclass, etc.
// rdar://12379114

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

11 years agoAdd code completion for @import <rdar://problem/13344306>.
Douglas Gregor [Thu, 7 Mar 2013 23:26:24 +0000 (23:26 +0000)]
Add code completion for @import <rdar://problem/13344306>.

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

11 years agoImprove LLDB's implicit cast-to-id to work with C++11 auto and any Objective-C object...
Douglas Gregor [Thu, 7 Mar 2013 22:57:58 +0000 (22:57 +0000)]
Improve LLDB's implicit cast-to-id to work with C++11 auto and any Objective-C object type <rdar://problem/13338107>.

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

11 years agoWhen possible, move __block variables to the heap rather than copying them.
Douglas Gregor [Thu, 7 Mar 2013 22:38:24 +0000 (22:38 +0000)]
When possible, move __block variables to the heap rather than copying them.

Fixes <rdar://problem/13330126>.

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

11 years agoPromote atomic type sizes up to a power of two, capped by
John McCall [Thu, 7 Mar 2013 21:37:17 +0000 (21:37 +0000)]
Promote atomic type sizes up to a power of two, capped by
MaxAtomicPromoteWidth.  Fix a ton of terrible bugs with
_Atomic types and (non-intrinsic-mediated) loads and stores
thereto.

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

11 years agoMove the atomics code into its own file.
John McCall [Thu, 7 Mar 2013 21:37:12 +0000 (21:37 +0000)]
Move the atomics code into its own file.

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

11 years agoChange hasAggregateLLVMType, which conflates complex and
John McCall [Thu, 7 Mar 2013 21:37:08 +0000 (21:37 +0000)]
Change hasAggregateLLVMType, which conflates complex and
aggregate types in a profoundly wrong way that has to be
worked around in every call site, to getEvaluationKind,
which classifies and distinguishes between all of these
cases.

Also, normalize the API for loading and storing complexes.

I'm working on a larger patch and wanted to pull these
changes out, but it would have be annoying to detangle
them from each other.

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

11 years agoAdd CharUnits::alignmentAtOffset.
John McCall [Thu, 7 Mar 2013 21:37:02 +0000 (21:37 +0000)]
Add CharUnits::alignmentAtOffset.

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

11 years agoEvaluate compound literals directly into the result aggregate
John McCall [Thu, 7 Mar 2013 21:36:54 +0000 (21:36 +0000)]
Evaluate compound literals directly into the result aggregate
when that aggregate isn't potentially aliased.

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

11 years agoRemove temporary std::vectors that ca be replaced with ArrayRef's magic.
Benjamin Kramer [Thu, 7 Mar 2013 21:18:31 +0000 (21:18 +0000)]
Remove temporary std::vectors that ca be replaced with ArrayRef's magic.

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

11 years agoRemove unncessary whitespace when triggered on empty line.
Daniel Jasper [Thu, 7 Mar 2013 20:50:00 +0000 (20:50 +0000)]
Remove unncessary whitespace when triggered on empty line.

With the cursor located at "I", clang-format would not do anything to:

int a;

   I

  int b;

With this patch, it reduces the number of empty lines as necessary, and
removes unnecessary whitespace. It does not change/reformat "int a;" or
"int b;".

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

11 years agoAdding lvalue and rvalue reference type matchers
Edwin Vane [Thu, 7 Mar 2013 15:44:40 +0000 (15:44 +0000)]
Adding lvalue and rvalue reference type matchers

Updated docs and tests.

Reviewers: klimek, gribozavr

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

11 years agoAdd 'e' to the SPIR data layout - SPIR is little endian for now.
Guy Benyei [Thu, 7 Mar 2013 13:06:10 +0000 (13:06 +0000)]
Add 'e' to the SPIR data layout - SPIR is little endian for now.
Add 32/64 bit specific target defines for SPIR.

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

11 years agoMinor refactor of how we get compilation phases.
Matthew Curtis [Thu, 7 Mar 2013 12:32:26 +0000 (12:32 +0000)]
Minor refactor of how we get compilation phases.

There is now a single function to get the list of phases for a given
output Type.

No functionality change intended.

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

11 years agoFix build with clang, this was supposed to be part of r176617.
Nick Lewycky [Thu, 7 Mar 2013 08:42:27 +0000 (08:42 +0000)]
Fix build with clang, this was supposed to be part of r176617.

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

11 years agoAdd flags for additional control over coverage generation. Pick the version
Nick Lewycky [Thu, 7 Mar 2013 08:28:53 +0000 (08:28 +0000)]
Add flags for additional control over coverage generation. Pick the version
string to be emitted, and two properties about the files themselves.

Use $PWD to absolut-ify the path to the coverage file. Yes, this is what GCC
does. Reverts my own r175706.

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

11 years ago[analyzer] Warn on passing a reference to null pointer as an argument in a call
Anna Zaks [Thu, 7 Mar 2013 03:02:36 +0000 (03:02 +0000)]
[analyzer] Warn on passing a reference to null pointer as an argument in a call

Warn about null pointer dereference earlier when a reference to a null pointer is
passed in a call. The idea is that even though the standard might allow this, reporting
the issue earlier is better for diagnostics (the error is reported closer to the place where
the pointer was set to NULL). This also simplifies analyzer’s diagnostic logic, which has
to track “where the null came from”. As a consequence, some of our null pointer
warning suppression mechanisms started triggering more often.

TODO: Change the name of the file and class to reflect the new check.

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

11 years agoDon't duplicate function names. Thanks to Jordan Rose for pointing it out.
Rafael Espindola [Thu, 7 Mar 2013 02:43:24 +0000 (02:43 +0000)]
Don't duplicate function names. Thanks to Jordan Rose for pointing it out.

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

11 years agoAdd a hasExternalLinkage helper. No functionality change.
Rafael Espindola [Thu, 7 Mar 2013 02:00:27 +0000 (02:00 +0000)]
Add a hasExternalLinkage helper. No functionality change.

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

11 years agoAdd a hasExternalStorageAsWritten helper. No functionality change.
Rafael Espindola [Thu, 7 Mar 2013 01:42:44 +0000 (01:42 +0000)]
Add a hasExternalStorageAsWritten helper. No functionality change.

It is possible that some of the current uses of
"getStorageClassAsWritten() == SC_Extern" should use this but I don't know
enough about SC_PrivateExtern to change and test them.

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

11 years agoFix typo.
Rafael Espindola [Thu, 7 Mar 2013 01:34:57 +0000 (01:34 +0000)]
Fix typo.

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

11 years ago[analyzer] Check for returning null references in ReturnUndefChecker.
Jordan Rose [Thu, 7 Mar 2013 01:23:25 +0000 (01:23 +0000)]
[analyzer] Check for returning null references in ReturnUndefChecker.

Officially in the C++ standard, a null reference cannot exist. However,
it's still very easy to create one:

int &getNullRef() {
  int *p = 0;
  return *p;
}

We already check that binds to reference regions don't create null references.
This patch checks that we don't create null references by returning, either.

<rdar://problem/13364378>

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

11 years ago[analyzer] Clean up a few doc comments for ProgramState and CallEvent.
Jordan Rose [Thu, 7 Mar 2013 01:23:14 +0000 (01:23 +0000)]
[analyzer] Clean up a few doc comments for ProgramState and CallEvent.

No functionality change.

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

11 years agoEnsure that DIType is regenerated after we visit an implementation
Adrian Prantl [Wed, 6 Mar 2013 22:03:30 +0000 (22:03 +0000)]
Ensure that DIType is regenerated after we visit an implementation
that adds ivars to an interface.

Fixes rdar://13175234

This is an update to r176116 that performs a smart caching of interfaces.

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

11 years ago[analyzer] Pass the correct Expr to the bug reporter visitors when dealing with Compo...
Anna Zaks [Wed, 6 Mar 2013 20:26:02 +0000 (20:26 +0000)]
[analyzer] Pass the correct Expr to the bug reporter visitors when dealing with CompoundLiteralExpr

This allows us to trigger the IDC visitor in the added test case.

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

11 years ago[analyzer] IDC: Add config option; perform the idc check on first “null node” rather...
Anna Zaks [Wed, 6 Mar 2013 20:25:59 +0000 (20:25 +0000)]
[analyzer] IDC: Add config option; perform the idc check on first “null node” rather than last “non-null”.

The second modification does not lead to any visible result, but, theoretically, is what we should
have been looking at to begin with since we are checking if the node was assumed to be null in
an inlined function.

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

11 years ago[PCH] When pre-validating the headers from the PCH, only validate non-system headers.
Argyrios Kyrtzidis [Wed, 6 Mar 2013 18:12:50 +0000 (18:12 +0000)]
[PCH] When pre-validating the headers from the PCH, only validate non-system headers.

Stat'ing all the headers from the PCH to make sure they are up-to-date takes significant time.
In a particular source file (whose PCH file included Cocoa.h) from total -fsyntax-only time
12% was just stat calls. Change pre-validation to only check non-system headers.

There are some notable disadvantages:

-If a system header, that is not include-guarded, changes after the PCH was created, we will not
find it in the header info table and we will #import it, effectively #importing it twice, thus
we will emit some error due to a multiple definition and after that the "header was modified" error will likely
be emitted, for example something like:

NSDictionary.h:12:1: error: duplicate interface definition for class 'NSDictionary'
@interface NSDictionary : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
^
NSDictionary.h:12:12: note: previous definition is here
@interface NSDictionary : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
           ^
fatal error: file 'NSDictionary.h' has been modified since the precompiled header was built

Though we get the "header was modified" error, this is a bit confusing.

-Theoretically it is possible that such a system header will cause no errors but it will just cause an
unfortunate semantic change, though I find this rather unlikely.

The advantages:

-Reduces compilation time when using a huge PCH like the Cocoa ones
-System headers change very infrequent and when they do, users/build systems should be able to know that
re-building from scratch is needed.

Addresses rdar://13056262

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

11 years ago[PCH] For HeaderFileInfoTrait, hash the key using size & time of the file.
Argyrios Kyrtzidis [Wed, 6 Mar 2013 18:12:47 +0000 (18:12 +0000)]
[PCH] For HeaderFileInfoTrait, hash the key using size & time of the file.

Previously the hash would be the filename portion of the path, which could be
different for a filename with different case or a symbolic link with a different
name completely.
This did not actually create any issue so far because by validating all headers
in the PCH we created uniqued FileEntries based on inodes, so an #include of
a symbolic link (refering to a file from the PCH) would end up with a FileEntry
with filename same as the one recorded in the PCH.

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

11 years ago[PCH] We don't need to instantiate HeaderFileInfoTrait in ASTReader more than once.
Argyrios Kyrtzidis [Wed, 6 Mar 2013 18:12:44 +0000 (18:12 +0000)]
[PCH] We don't need to instantiate HeaderFileInfoTrait in ASTReader more than once.

We can just re-use the one from HeaderFileInfoLookupTable.

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

11 years ago[PCH] Remove a couple of fields from serialization::reader::HeaderFileInfoTrait that...
Argyrios Kyrtzidis [Wed, 6 Mar 2013 18:12:41 +0000 (18:12 +0000)]
[PCH] Remove a couple of fields from serialization::reader::HeaderFileInfoTrait that are not used for anything.

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

11 years agoSpell Objective-C correctly.
Fariborz Jahanian [Wed, 6 Mar 2013 17:55:30 +0000 (17:55 +0000)]
Spell Objective-C correctly.

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

11 years agosay objective-C in the warning and streamline
Fariborz Jahanian [Wed, 6 Mar 2013 17:36:51 +0000 (17:36 +0000)]
say objective-C in the warning and streamline
several diagnostics into one. // rdar://13094352

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

11 years agoDriver: add support for new style multiarch in Ubuntu 13.04
Dmitri Gribenko [Wed, 6 Mar 2013 17:14:05 +0000 (17:14 +0000)]
Driver: add support for new style multiarch in Ubuntu 13.04

Patch by Sanne Wouda.

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

11 years agoNew ASTMatchers and enhancement to hasOverloadedOperatorName
Edwin Vane [Wed, 6 Mar 2013 17:02:57 +0000 (17:02 +0000)]
New ASTMatchers and enhancement to hasOverloadedOperatorName

Added two new narrowing matchers:
* hasMethod: aplies a matcher to a CXXRecordDecl's methods until a match is made
  or there are no more methods.
* hasCanonicalType: applies a matcher to a QualType's canonicalType.

Enhanced hasOverloadedOperatorName to work on CXXMethodDecl as well as
CXXOperatorCallExpr.

Updated tests and docs.

Reviewers: klimek, gribozavr

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

11 years ago[Sanitize] Don't emit function attribute sanitize_address/thread/memory if the functi...
Alexey Samsonov [Wed, 6 Mar 2013 10:54:18 +0000 (10:54 +0000)]
[Sanitize] Don't emit function attribute sanitize_address/thread/memory if the function is blacklisted.

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

11 years agorevert r176531 due to clan-native-arm fails
Weiming Zhao [Wed, 6 Mar 2013 02:08:54 +0000 (02:08 +0000)]
revert r176531 due to clan-native-arm fails

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

11 years agoPR15390: If a function returns a pointer to a function, that function type
Richard Smith [Wed, 6 Mar 2013 01:37:38 +0000 (01:37 +0000)]
PR15390: If a function returns a pointer to a function, that function type
can't have default arguments even though it's a parameter-declaration-clause in
a function declaration.

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

11 years agoAfter issuing a diagnostic for undefining or redefining a builtin macro,
Richard Smith [Wed, 6 Mar 2013 00:46:00 +0000 (00:46 +0000)]
After issuing a diagnostic for undefining or redefining a builtin macro,
continue parsing the directive rather than silently discarding it.

Allowing undef or redef of __TIME__ and __DATE__ is important to folks
who want stable, reproducible builds.

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

11 years agoobjective-C: don't crash after diagnosing
Fariborz Jahanian [Wed, 6 Mar 2013 00:37:40 +0000 (00:37 +0000)]
objective-C: don't crash after diagnosing
using object subscripting without declaring objectForKeyedSubscript:
// rdar://13333205

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

11 years agoRemove unused static variable.
Douglas Gregor [Tue, 5 Mar 2013 23:59:13 +0000 (23:59 +0000)]
Remove unused static variable.

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

11 years agoPreprocessor: don't keep comments under -traditional-cpp.
Jordan Rose [Tue, 5 Mar 2013 23:54:55 +0000 (23:54 +0000)]
Preprocessor: don't keep comments under -traditional-cpp.

This patch is designed for minimal intrusion into normal preprocessing
and compilation; under -E -traditional-cpp, the lexer will still
generate tok::comment nodes since it is preserving all whitespace, but
the output printer will then throw it away.

<rdar://problem/13338680>

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

11 years agoPR 11326: Lack diagnosic message when ABI conflicts on ARM
Weiming Zhao [Tue, 5 Mar 2013 23:27:21 +0000 (23:27 +0000)]
PR 11326: Lack diagnosic message when ABI conflicts on ARM

When both Triple and -mabi are used, it may result into conflicting ABI value.

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

11 years agofix a missing check in my last patch.
Fariborz Jahanian [Tue, 5 Mar 2013 23:20:29 +0000 (23:20 +0000)]
fix a missing check in my last patch.
// rdar://13094352

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

11 years agoPreprocessor: don't consider // to be a line comment in -E -std=c89 mode.
Jordan Rose [Tue, 5 Mar 2013 22:51:04 +0000 (22:51 +0000)]
Preprocessor: don't consider // to be a line comment in -E -std=c89 mode.

It's beneficial when compiling to treat // as the start of a line
comment even in -std=c89 mode, since it's not valid C code (with a few
rare exceptions) and is usually intended as such. We emit a pedantic
warning and then continue on as if line comments were enabled.
This has been our behavior for quite some time.

However, people use the preprocessor for things besides C source files.
In today's prompting example, the input contains (unquoted) URLs, which
contain // but should still be preserved.

This change instructs the lexer to treat // as a plain token if Clang is
in C90 mode and generating preprocessed output rather than actually compiling.

<rdar://problem/13338743>

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

11 years agodoc. parsing. Improve on diagnostics on my last patch.
Fariborz Jahanian [Tue, 5 Mar 2013 22:46:07 +0000 (22:46 +0000)]
doc. parsing. Improve on diagnostics on my last patch.
// rdar://13094352.

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

11 years agoRemove outdated claim that GCC builds without a C++ compiler from compilers comparison.
Richard Smith [Tue, 5 Mar 2013 21:49:52 +0000 (21:49 +0000)]
Remove outdated claim that GCC builds without a C++ compiler from compilers comparison.

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

11 years agoUse ASTContext::getDeclAlign(<Field Decl>) to get the alignment of the first
Lang Hames [Tue, 5 Mar 2013 20:27:24 +0000 (20:27 +0000)]
Use ASTContext::getDeclAlign(<Field Decl>) to get the alignment of the first
field to be memcpy'd, rather instead of ASTContext::getTypeAlign(<Field Type>).
For packed structs the alignment of a field may be less than the alignment of
the field's type.

<rdar://problem/13338585>

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

11 years ago[libclang] When logging a CXTranslationUnit that came from an AST file, print out...
Argyrios Kyrtzidis [Tue, 5 Mar 2013 20:21:14 +0000 (20:21 +0000)]
[libclang] When logging a CXTranslationUnit that came from an AST file, print out the filename.

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

11 years agoFix this checkin.
Fariborz Jahanian [Tue, 5 Mar 2013 19:52:24 +0000 (19:52 +0000)]
Fix this checkin.

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

11 years agodoc parsing. Add @method and @callback for
Fariborz Jahanian [Tue, 5 Mar 2013 19:40:47 +0000 (19:40 +0000)]
doc parsing. Add @method and @callback for
checkings and few other refactoring/cleanup.
// rdar://13094352.

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

11 years agoMips specific inline assembler constraint 'R'
Jack Carter [Tue, 5 Mar 2013 19:10:54 +0000 (19:10 +0000)]
Mips specific inline assembler constraint 'R'

'R' An address that can be sued in a non-macro load or store.

Including missing positive test case and fixed typo for r176453.

Thanks to Richard Smith for catching this!

Jack

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

11 years agoMake LibASTMatchersTutorial code match text
Edwin Vane [Tue, 5 Mar 2013 18:04:37 +0000 (18:04 +0000)]
Make LibASTMatchersTutorial code match text

Fixed code to match text. Slight adjustment for readability.

Author: Béatrice Creusillet

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

11 years agoDocumentation: use code highlighting
Dmitri Gribenko [Tue, 5 Mar 2013 13:05:56 +0000 (13:05 +0000)]
Documentation: use code highlighting

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

11 years agoAdd a test that we are passing the -fobjc-default-synthesize flag for Apple and
David Chisnall [Tue, 5 Mar 2013 11:20:04 +0000 (11:20 +0000)]
Add a test that we are passing the -fobjc-default-synthesize flag for Apple and
non-Apple platforms.

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

11 years agoDon't emit calls to virtual [[noreturn]] functions as noreturn; overrides of a
Richard Smith [Tue, 5 Mar 2013 08:30:04 +0000 (08:30 +0000)]
Don't emit calls to virtual [[noreturn]] functions as noreturn; overrides of a
[[noreturn]] function are not required to also be [[noreturn]]. We still emit
calls to virtual __attribute__((noreturn)) functions as noreturn; unlike GCC,
we do require overriders to also be noreturn for that attribute.

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

11 years agoAdd quotation marks to template names in diagnostics.
David Blaikie [Tue, 5 Mar 2013 06:21:38 +0000 (06:21 +0000)]
Add quotation marks to template names in diagnostics.

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

11 years agoscan-build: explicitly say "No bugs found" if there are no reports.
Jordan Rose [Tue, 5 Mar 2013 02:33:08 +0000 (02:33 +0000)]
scan-build: explicitly say "No bugs found" if there are no reports.

Patch by Martin Storsjo!

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

11 years agoSilence a number of static analyzer warnings with assertions and such.
Jordan Rose [Tue, 5 Mar 2013 01:27:54 +0000 (01:27 +0000)]
Silence a number of static analyzer warnings with assertions and such.

No functionality change.

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

11 years agodoc parsing. We want to issue a strong warning when
Fariborz Jahanian [Tue, 5 Mar 2013 01:05:07 +0000 (01:05 +0000)]
doc parsing. We want to issue a strong warning when
an @function comment is not followed by a function decl.
// rdar://13094352

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

11 years ago[analyzer] Don't let cf_audited_transfer override CFRetain semantics.
Jordan Rose [Mon, 4 Mar 2013 23:21:32 +0000 (23:21 +0000)]
[analyzer] Don't let cf_audited_transfer override CFRetain semantics.

We weren't treating a cf_audited_transfer CFRetain as returning +1 because
its name doesn't contain "Create" or "Copy". Oops! Fortunately, the
standard definitions of these functions are not marked audited.

<rdar://problem/13339601>

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