aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/inline.c
AgeCommit message (Collapse)Author
2012-08-21[analyzer] -analyzer-ipa=inlining is now the default. Remove it from tests.Jordan Rose
The actual change here is a little more complicated than the summary above. What we want to do is have our generic inlining tests run under whatever mode is the default. However, there are some tests that depend on the presence of C++ inlining, which still has some rough edges. These tests have been explicitly marked as -analyzer-ipa=inlining in preparation for a new mode that limits inlining to C functions and blocks. This will be the default until the false positives for C++ have been brought down to manageable levels. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162317 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-10[analyzer] Add clang_analyzer_checkInlined for debugging purposes.Jordan Rose
This check is also accessible through the debug.ExprInspection checker. Like clang_analyzer_eval, you can use it to test the analyzer engine's current state; the argument should be true or false to indicate whether or not you expect the function to be inlined. When used in the positive case (clang_analyzer_checkInlined(true)), the analyzer prints the message "TRUE" if the function is ever inlined. However, clang_analyzer_checkInlined(false) should never print a message; this asserts that there should be no paths on which the current function is inlined, but then there are no paths on which to print a message! (If the assertion is violated, the message "FALSE" will be printed.) This asymmetry comes from the fact that the only other chance to print a message is when the function is analyzed as a top-level function. However, when we do that, we can't be sure it isn't also inlined elsewhere (such as in a recursive function, or if we want to analyze in both general or specialized cases). Rather than have all checkInlined calls have an appended, meaningless "FALSE" or "TOP-LEVEL" case, there is just no message printed. void clang_analyzer_checkInlined(int); For debugging purposes only! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161708 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-09[analyzer] When inlining, make sure we use the definition decl.Jordan Rose
This was a regression introduced during the CallEvent changes; a call to FunctionDecl::hasBody was also being used to replace the decl found by lookup with the actual definition. To keep from making this mistake again (particularly if/when we start inlining Objective-C methods), this commit adds a "getDefinition()" method to CallEvent, which should do the right thing under any circumstances. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159940 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-08[analyzer] Rework inlining related command line options.Anna Zaks
- Remove -analyzer-inline-call. - Add -analyzer-ipa=[none|inlining] - Add -analyzer-inlining-mode to allow experimentation for different performance tuning methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152351 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05Teak CallAndMessageChecker to only warn about uninitialized struct fields in ↵Ted Kremenek
call arguments when the called function is never inlined. Fixes <rdar://problem/10977037>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152073 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03[analyzer] do not warn about returning stack-allocated memory when it comes ↵Ted Kremenek
from an ancestor stack frame. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151964 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12[analyzer] fix inlining's handling of mapping actual to formal arguments and ↵Ted Kremenek
limit the call stack depth. The analyzer can now accurately simulate factorial for limited depths. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148036 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-11Remove '#if 0' from ExprEngine::InlineCall(), and start fresh by wiring up ↵Ted Kremenek
inlining for straight C calls. My hope is to reimplement this from first principles based on the simplifications of removing unneeded node builders and re-evaluating how C++ calls are handled in the CFG. The hope is to turn inlining "on-by-default" as soon as possible with a core set of things working well, and then expand over time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147904 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30Begin reworking static analyzer support for C++ method calls. The current ↵Ted Kremenek
logic was divorced from how we process ordinary function calls, had a tremendous about of redundancy, and relied strictly on inlining behavior (which was incomplete) to provide semantics instead of falling back to the conservative analysis we use for C functions. This is a significant step into making C++ analyzer support more useful. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128557 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28[analyzer] Remove '-analyzer-check-objc-mem' flag, the nominee for best ↵Argyrios Kyrtzidis
misnomer award. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126676 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28[analyzer] Migrate NSErrorChecker and DereferenceChecker to CheckerV2.Argyrios Kyrtzidis
They cooperate in that NSErrorChecker listens for ImplicitNullDerefEvent events that DereferenceChecker can dispatch. ImplicitNullDerefEvent is when we dereferenced a location that may be null. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126659 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-14Teach RegionStore::EnterStackFrame() to handleTed Kremenek
the case where the called function has fewer formal arguments than actual arguments. This fixes a crash in the analyzer when doing function call inlining. Patch by Zhenbo Xu! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-06Turn -analyzer-inline-call on for C functions. This also fixed a bug thatZhongxing Xu
after inlining post-call checking shouldn't be done. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30Refactor the AnalysisConsumer to analyze functions after the whole Zhongxing Xu
translation unit is parsed. This enables us to inline some calls when still analyzing one function at a time. Actions are classified into Function, CXXMethod, ObjCMethod, ObjCImplementation. This does not hurt performance much. The analysis time for sqlite3.c: before: real 17m52.440s user 17m49.460s sys 0m2.010s after: real 18m0.500s user 17m56.900s sys 0m2.330s DisplayProgress option is broken now. -inine-call action is removed. It will be reenabled in another form, perhaps as an indenpendant option. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102689 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23Tweak null dereference diagnostics to give clearer diagnostics whenTed Kremenek
a null dereference results from a field access. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99236 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27Add test case for inlining call analysis.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97300 91177308-0d34-0410-b5e6-96231b3b80d8