aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-04-20[analyzer] Flip printPretty and printPrettyAsExpr as per suggestion from ↵Anna Zaks
Jordan (r179572) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179915 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-20[analyzer] Correct the commentAnna Zaks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179914 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19[libclang] Make sure the preable does not truncate comments.Argyrios Kyrtzidis
rdar://13647445 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179907 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19[analyzer] Website: update lists of potential and actual checkers.Jordan Rose
- memory.MismatchedDelete, memory.MultipleDelete, and memory.DeallocateNonPtr are complete (unix.MismatchedDeallocator and cplusplus.NewDelete) - Per discussion on the mailing list, different.UnaryPlusWithUnsigned has dubious value; remove it. - Add potential checker ctordtor.PlacementSelfCopy per an internal bug report. - core.AttributeNonNull is now core.NonNullParamChecker, though no one should be depending on this name anyway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179900 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19Remove an empty line so the line numbers match up again after the recent ↵Adrian Prantl
documentation change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179898 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19still not relaxed enough.Adrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179897 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19cleanup and relax test casesAdrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179896 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19Note that we support (and in fact have supported since the dawn of time itself)Richard Smith
C++1y binary literals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179883 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19[ms-inline asm] The parsing of C++ identifiers is a task of the front-end ↵Chad Rosier
parser, not the asm parser. As such, begin moving the parsing logic in that direction. This patch is just a temporary hack until the real frontend parser can be hooked up. Part of rdar://13663589 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179882 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19Emit the underlying type in the debug info for all kinds of fixed enumsAdrian Prantl
instead of only C++11-scoped-with-class-tag enums. rdar://problem/13463793 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179879 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19s/C++0x/C++11/Adrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179878 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19Initial work on status page for C++14.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179864 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19Keep the parentheses in #pragma message (partial revert of r179771).Andy Gibbs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179862 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19C++11 support is now feature-complete.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179861 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19Avoid names like __in that conflict with SAL in builtin headersReid Kleckner
Microsoft's Source Annotation Language (SAL) defines a bunch of keywords for annotating the inputs and outputs of functions. Empty definitions for the keywords are provided by <stdlib.h> -> <crtdefs.h> -> <sal.h>. This makes it basically impossible to include MSVC's stdlib.h and Clang's *mmintrin.h headers at the same time if they have variables named __in. As a workaround, I've renamed those variables. This fixes the Modules/compiler_builtins.m test which was XFAILed, presumably due to this conflict. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179860 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19Implement CodeGen for C++11 thread_local, following the Itanium ABI ↵Richard Smith
specification as discussed on cxx-abi-dev. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179858 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19[analyzer] Call proper callback for const regions escaped other then on call.Anton Yartsev
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179846 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19Revert "PR14606: Debug info for using directives/DW_TAG_imported_module"Eric Christopher
This reverts commit r179837 as it seems to be causing test failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179839 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19PR14606: Debug info for using directives/DW_TAG_imported_moduleDavid Blaikie
More changes later for using declarations/DW_TAG_imported_declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179837 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19Give CGDebugInfo::getContextDescriptor a more specific return typeDavid Blaikie
Not that the DI* hierarchy is terribly type safe, but this makes the contract a little clearer I think. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179835 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19[libclang] Fix copy-paste error in comment.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179823 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18[libclang] Introduce clang_Cursor_isVariadic, which returns non-zero if the ↵Argyrios Kyrtzidis
given cursor is a variadic function or method. rdar://13667150 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179819 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Objective-C++: Enable passing of modern C++11 style Fariborz Jahanian
initialized temporaries to objc++ methods. // rdar://12788429 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179818 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18[libclang] Introduce clang_Cursor_getObjCDeclQualifiers, to query for 'ObjC ↵Argyrios Kyrtzidis
Qualifiers' written next to the return and parameter types in an ObjC method declarations. rdar://13676977 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179816 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Fix typo.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179811 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Add comment to describe cleverness.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179806 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18[libclang] Introduce clang_Cursor_getObjCPropertyAttributes to query the ↵Argyrios Kyrtzidis
written attributes in a property declaration. rdar://13684512 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179803 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Comment parsing: simplify code. As a side effect, this also silences GCC'sDmitri Gribenko
-Wunitnitialized warning. Patch by Rui Ueyama. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179794 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Objective-C parsing [qoi]: Provide good recovery whenFariborz Jahanian
Objective-C dictionary literals has bad syntax for the separator. // rdar://10679157 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179784 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18[CMake] Create the directory before creating the link to the clang headers.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179782 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18some more tests for r179743.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179781 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Add IRGen test case for r179743.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179777 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18[analyzer] Refine 'nil receiver' diagnostics to mention the name of the ↵Ted Kremenek
method not called. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179776 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Dropped the parentheses for #pragma message and its kin in the -E output ↵Andy Gibbs
generator. This was a suggestion by Jordan Rose since the documented format for these pragmas is without the parentheses. At the same time, I've increased test coverage too for the preprocessed output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179771 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Adds a new doxygen tag needed. // rdar://12379053Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179770 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18[libclang] Report parameter array types as written in source, not decayed to ↵Argyrios Kyrtzidis
pointer types. Patch by Doug. rdar://13684618 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179769 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18[analyzer] "Force" LazyCompoundVals on bind when they are simple enough.Jordan Rose
The analyzer uses LazyCompoundVals to represent rvalues of aggregate types, most importantly structs and arrays. This allows us to efficiently copy around an entire struct, rather than doing a memberwise load every time a struct rvalue is encountered. This can also keep memory usage down by allowing several structs to "share" the same snapshotted bindings. However, /lookup/ through LazyCompoundVals can be expensive, especially since they can end up chaining back to the original value. While we try to reuse LazyCompoundVals whenever it's safe, and cache information about this transitivity, the fact is it's sometimes just not a good idea to perpetuate LazyCompoundVals -- the tradeoffs just aren't worth it. This commit changes RegionStore so that binding a LazyCompoundVal to struct will do a memberwise copy if the struct is simple enough. Today's definition of "simple enough" is "up to N scalar members" (see below), but that could easily be changed in the future. This is enough to bring the test case in PR15697 back down to a manageable analysis time (within 20% of its original time, in an unfair test where the new analyzer is not compiled with LTO). The actual value of "N" is controlled by a new -analyzer-config option, 'region-store-small-struct-limit'. It defaults to "2", meaning structs with zero, one, or two scalar members will be considered "simple enough" for this code path. It's worth noting that a more straightforward implementation would do this on load, not on bind, and make use of the structure we already have for this: CompoundVal. A long time ago, this was actually how RegionStore modeled aggregate-to-aggregate copies, but today it's only used for compound literals. Unfortunately, it seems that we've special-cased LazyCompoundVal in certain places (such as liveness checks) but failed to similarly special-case CompoundVal in all of them. Until we're confident that CompoundVal is handled properly everywhere, this solution is safer, since the entire optimization is just an implementation detail of RegionStore. <rdar://problem/13599304> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179767 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18[analyzer] Don't crash if we cache out after making a temporary region.Jordan Rose
A C++ overloaded operator may be implemented as an instance method, and that instance method may be called on an rvalue object, which has no associated region. The analyzer handles this by creating a temporary region just for the evaluation of this call; however, it is possible that /by creating the region/, the analyzer ends up in a previously-explored state. In this case we don't need to continue along this path. This doesn't actually show any behavioral change now, but it starts being used with the next commit and prevents an assertion failure there. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179766 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Specify that we're parsing ms-style inline assembly.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179762 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Multiple improvements to the AST matcher tutorial.Manuel Klimek
Patch by Jochen Eisinger. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179758 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Reject asm output constraints that consist of modifiers only.Benjamin Kramer
Fixes PR15759. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179756 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Add llvm_unreachable at end of fully covered switch to pacify GCC.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179753 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18[Parser] Handle #pragma pack/align inside C structs.Argyrios Kyrtzidis
Fixes PR13580. Patch by Serge Pavlov! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179743 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Switch the note order for -Woverloaded-shift-op-parentheses so that the noteRichard Trieu
with the silence fix-it comes first. This is more consistent with the rest of the warnings in -Wparentheses. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179742 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18Update the -Wparentheses tests to check that fix-its are in the correct place.Richard Trieu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179740 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18[analyzer] Tweak getDerefExpr more to track DeclRefExprs to references.Anna Zaks
In the committed example, we now see a note that tells us when the pointer was assumed to be null. This is the only case in which getDerefExpr returned null (failed to get the dereferenced expr) throughout our regression tests. (There were multiple occurrences of this one.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179736 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-17[analyzer] Improve dereferenced expression tracking for MemberExpr with a ↵Anna Zaks
dot and non-reference base git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179734 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-17Add description of -Ofast optimization option to the man page. <rdar://13660458>Bob Wilson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179733 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-17[analyzer] Gain more precision retrieving the right SVal by specifying the ↵Anna Zaks
type of the expression. Thanks to Jordan for suggesting the fix. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179732 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-17[analyzer] Allow TrackConstraintBRVisitor to work when the value it’s ↵Anna Zaks
tracking is not live in the last node of the path We always register the visitor on a node in which the value we are tracking is live and constrained. However, the visitation can restart at a node, later on the path, in which the value is under constrained because it is no longer live. Previously, we just silently stopped tracking in that case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179731 91177308-0d34-0410-b5e6-96231b3b80d8