summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Don't crash on array constructors and destructors.Jordan Rose2012-07-264-17/+82
| | | | | | | | This workaround is fairly lame: we simulate the first element's constructor and destructor and rely on the region invalidation to "initialize" the rest of the elements. llvm-svn: 160809
* [analyzer] Handle C++ member initializers and destructors.Jordan Rose2012-07-266-28/+127
| | | | | | | This uses CFG to tell if a constructor call is for a member, and uses the member's region appropriately. llvm-svn: 160808
* [analyzer] Use the CFG to see if a constructor is for a local variable.Jordan Rose2012-07-261-34/+22
| | | | | | | | | Previously we were using ParentMap and crawling through the parent DeclStmt. This should be at least slightly cheaper (and is also more flexible). No (intended) functionality change. llvm-svn: 160807
* [analyzer] Handle base class initializers and destructors.Jordan Rose2012-07-265-92/+149
| | | | | | | | | | | | | Most of the logic here is fairly simple; the interesting thing is that we now distinguish complete constructors from base or delegate constructors. We also make sure to cast to the base class before evaluating a constructor or destructor, since non-virtual base classes may behave differently. This includes some refactoring of VisitCXXConstructExpr and VisitCXXDestructor in order to keep ExprEngine.cpp as clean as possible (leaving the details for ExprEngineCXX.cpp). llvm-svn: 160806
* [analyzer] Variables with destructors are live until the destructor is run.Jordan Rose2012-07-261-0/+6
| | | | | | | Test case in the next commit, which enables destructors under certain circumstances. llvm-svn: 160805
* [analyzer] Show paths for destructor calls.Jordan Rose2012-07-265-64/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies BugReporter and friends to handle CallEnter and CallExitEnd program points that came from implicit call CFG nodes (read: destructors). This required some extra handling for nested implicit calls. For example, the added multiple-inheritance test case has a call graph that looks like this: testMultipleInheritance3 ~MultipleInheritance ~SmartPointer ~Subclass ~SmartPointer ***bug here*** In this case we correctly notice that we started in an inlined function when we reach the CallEnter program point for the second ~SmartPointer. However, when we reach the next CallEnter (for ~Subclass), we were accidentally re-using the inner ~SmartPointer call in the diagnostics. Rather than guess if we saw the corresponding CallExitEnd based on the contents of the active path, we now just ask the PathDiagnostic if there's any known stack before popping off the top path. (A similar issue could have occured without multiple inheritance, but there wasn't a test case for it.) llvm-svn: 160804
* [analyzer] Inline ctors + dtors when the CFG is built for them.Jordan Rose2012-07-262-5/+33
| | | | | | | At the very least this means initializer nodes for constructors and automatic object destructors are present in the CFG. llvm-svn: 160803
* [analyzer] PostImplicitCall can also occur between CFGElements.Jordan Rose2012-07-261-1/+3
| | | | | | | This avoids an assertion crash when we invalidate on a destructor call instead of inlining it. llvm-svn: 160802
* Add a const version of Expr::IgnoreImplicit. No functionality change.Jordan Rose2012-07-261-0/+4
| | | | llvm-svn: 160801
* Un-break standalone invocations of CmpRuns.py.Jordan Rose2012-07-261-1/+1
| | | | | | Fallout from CmpRuns.py API changes in r160314. llvm-svn: 160800
* objective-c parsing. Don't crash when selector nameFariborz Jahanian2012-07-262-5/+57
| | | | | | is missing in method prototype. // rdar://11939584 llvm-svn: 160789
* Put back dump() without a default argument, "because debuggers don't usually ↵Alexander Kornienko2012-07-261-2/+6
| | | | | | respect default arguments". llvm-svn: 160788
* Added -ast-dump-filter option to clang -cc1.Alexander Kornienko2012-07-269-31/+79
| | | | llvm-svn: 160784
* Remove an outdated comment; add one test to compare function pointer and ↵Timur Iskhodzhanov2012-07-262-5/+7
| | | | | | block mangling llvm-svn: 160783
* Add more tests for PR13207 (Mangling of template back references with ↵Timur Iskhodzhanov2012-07-261-0/+25
| | | | | | -cxx-abi microsoft) now that PR13389 is fixed (mangling of return types) llvm-svn: 160782
* Fix PR13389 (Wrong mangling of return type qualifiers with -cxx-abi microsoft)Timur Iskhodzhanov2012-07-262-2/+182
| | | | llvm-svn: 160780
* Removed standalone clang-ast-dump tool.Alexander Kornienko2012-07-267-197/+3
| | | | llvm-svn: 160772
* [analyzer] Inline ObjC class methods.Anna Zaks2012-07-266-66/+214
| | | | | | | | | | - Some cleanup(the TODOs) will be done after ObjC method inlining is complete. - Simplified CallEvent::getDefinition not to require ISDynamicDispatch parameter. - Also addressed Jordan's comments from r160530. llvm-svn: 160768
* Add static analyzer check for calling a C++ instance method with a ↵Ted Kremenek2012-07-262-2/+46
| | | | | | null/uninitialized pointer. llvm-svn: 160767
* Disable the warning for missing prototypes for OpenCL kernels. Includes ↵Tanya Lattner2012-07-262-0/+10
| | | | | | testcase. llvm-svn: 160766
* Remove the ability to stash arbitrary pointers into UndefinedVal (no longer ↵Ted Kremenek2012-07-252-10/+0
| | | | | | needed). llvm-svn: 160764
* Fix two typos in the docSylvestre Ledru2012-07-252-2/+2
| | | | llvm-svn: 160763
* Remove ExprEngine::MarkBranch(), as it is no longer needed.Ted Kremenek2012-07-252-72/+4
| | | | llvm-svn: 160761
* Update ExprEngine's handling of ternary operators to find the ternary expressionTed Kremenek2012-07-252-9/+26
| | | | | | | | value by scanning the path, rather than assuming we have visited the '?:' operator as a terminator (which sets a value indicating which expression to grab the final ternary expression value from). llvm-svn: 160760
* objective-c modern translator. Provide declaration ofFariborz Jahanian2012-07-251-6/+3
| | | | | | | | "memset' lazily when is needed in translation of struct-valued methods which require checkinf of nil receivers outside their bodies. // rdar://11847319 llvm-svn: 160759
* Remove experimental invalid iterators checker from the codebase until we ↵Ted Kremenek2012-07-254-718/+0
| | | | | | | | | have the time to fix all the issues. Currently the code is essentially unmaintained and buggy, and needs major revision (with coupled enhancements to the analyzer core). llvm-svn: 160754
* [driver crash diagnostics] Strip -internal-isystem and ↵Chad Rosier2012-07-252-0/+5
| | | | | | | | -internal-externc-isystem. rdar://11949066 llvm-svn: 160752
* [driver crash diagnostics] Strip -idirafter, -iprefix, -iwithprefix,Chad Rosier2012-07-252-1/+13
| | | | | | | -iwithprefixbefore, and -isystem options, per Matt's suggestion. rdar://11949066 llvm-svn: 160750
* [driver crash diagnostics] A few enhancements:Chad Rosier2012-07-252-3/+25
| | | | | | | | | -Strip -iquote and -M options. -Quote -D options to avoid problems with command line macros that include parens. rdar://11949066 llvm-svn: 160743
* libclang comment to HTML rendering: \result is the same as \returnsDmitri Gribenko2012-07-252-31/+47
| | | | llvm-svn: 160738
* test/PCH/objc_stmts.m: Suppress stderr to be fed to FileCheck.NAKAMURA Takumi2012-07-251-2/+2
| | | | llvm-svn: 160720
* Introduces the 'decl' matcher which was missing for a whileManuel Klimek2012-07-252-4/+27
| | | | | | | | | and became necessary with the change to require BindableMatchers for binding. Also fixes PR 13445: "hasSourceExpression only works for implicit casts". llvm-svn: 160716
* test/Analysis/iterators.cpp: Mark as REQUIRES:asserts. It crashes due to ↵NAKAMURA Takumi2012-07-251-0/+2
| | | | | | | | assertion failure. I saw the case it XPASSes. llvm-svn: 160715
* Add a FIXME to revisit the performance of BackRefMap laterTimur Iskhodzhanov2012-07-251-0/+2
| | | | llvm-svn: 160709
* Adds a introductionary document to the Clang AST.Manuel Klimek2012-07-251-0/+139
| | | | | | Next steps are adding information about types & source location handling. llvm-svn: 160708
* Turn -Wobjc-root-class on by default. <rdar://problem/11203649>.Ted Kremenek2012-07-2510-11/+11
| | | | llvm-svn: 160707
* Promote warn_unknown_analyzer_checker to an error. Addresses ↵Ted Kremenek2012-07-253-5/+5
| | | | | | <rdar://problem/10987863>. llvm-svn: 160706
* PR12057: Allow variadic template pack expansions to cross lambda boundaries.Richard Smith2012-07-2512-62/+216
| | | | | | | | | | Rather than adding a ContainsUnexpandedParameterPack bit to essentially every AST node, we tunnel the bit directly up to the surrounding lambda expression when we reach a context where an unexpanded pack can not normally appear. Thus any statement or declaration within a lambda can now potentially contain an unexpanded parameter pack. llvm-svn: 160705
* Make comments::Parser and comments::Sema noncopyable.Dmitri Gribenko2012-07-252-0/+6
| | | | llvm-svn: 160702
* Comment parsing tests: fix testDmitri Gribenko2012-07-241-1/+1
| | | | llvm-svn: 160700
* Add __has_feature(attribute_availability_with_message).Jordan Rose2012-07-242-0/+7
| | | | | | | | | | | | | | | | | This tests for the ability to include a "message" field in availability attributes, like so: extern void ATSFontGetName(const char *oName) __attribute__((availability(macosx,introduced=8.0,deprecated=9.0, message="use CTFontCopyFullName"))); This was actually supported in Clang 3.1, but we got a request for a __has_feature so that header files can use this more safely. It's unfortunate that the 3.1 release doesn't include this, however. <rdar://problem/11886458> llvm-svn: 160699
* Comment diagnostics tests: add a function with zero arguments, for completeness.Dmitri Gribenko2012-07-241-6/+10
| | | | llvm-svn: 160697
* Comment diagnostics: add warning for multiple \param commands with duplicateDmitri Gribenko2012-07-244-1/+37
| | | | | | parameter names. llvm-svn: 160696
* When a && or || appears as the condition of a ?:, perform appropriateRichard Smith2012-07-242-10/+18
| | | | | | | | | short-circuiting when building the CFG. Also be sure to skip parens before checking for the && / || special cases. Finally, fix some crashes in CFG printing in the presence of calls to destructors for array of array of class type. llvm-svn: 160691
* CommentSema: simplify functions, per Jordan's comment.Dmitri Gribenko2012-07-241-8/+4
| | | | llvm-svn: 160689
* Pedantic -pedantic correction. Duplicate cv-qualifiers are permitted in C++11Richard Smith2012-07-244-10/+16
| | | | | | unless they appear in a decl-specifier-seq. llvm-svn: 160688
* Don't use a temporary file.Rafael Espindola2012-07-241-2/+1
| | | | llvm-svn: 160686
* ABIArgInfo's constructor is private and only used by the static get* methods.Rafael Espindola2012-07-241-6/+6
| | | | | | No need to abuse default arguments. llvm-svn: 160684
* Comment parsing: allow newlines between \param, direction specification (e.g.,Dmitri Gribenko2012-07-242-50/+110
| | | | | | [in]), parameter name and description paragraph. llvm-svn: 160682
* Tweak warning text for returning incomplete type from extern "C" functions.Hans Wennborg2012-07-243-4/+10
| | | | | | | | | | A warning was added in r150128 for returning non-C compatible user-defined types from functions with C linkage. This makes the text more clear for the case when the type isn't decidedly non-C compatible, but incomplete. llvm-svn: 160681
OpenPOWER on IntegriCloud