OLD | NEW |
1 // CFRefCount.cpp - Transfer functions for tracking simple values -*- C++ -*--// | 1 // CFRefCount.cpp - Transfer functions for tracking simple values -*- C++ -*--// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines the methods for CFRefCount, which implements | 10 // This file defines the methods for CFRefCount, which implements |
(...skipping 2661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2672 | 2672 |
2673 case RetEffect::NoRet: { | 2673 case RetEffect::NoRet: { |
2674 // Make up a symbol for the return value (not reference counted). | 2674 // Make up a symbol for the return value (not reference counted). |
2675 // FIXME: Most of this logic is not specific to the retain/release | 2675 // FIXME: Most of this logic is not specific to the retain/release |
2676 // checker. | 2676 // checker. |
2677 | 2677 |
2678 // FIXME: We eventually should handle structs and other compound types | 2678 // FIXME: We eventually should handle structs and other compound types |
2679 // that are returned by value. | 2679 // that are returned by value. |
2680 | 2680 |
2681 QualType T = callOrMsg.getResultType(Eng.getContext()); | 2681 QualType T = callOrMsg.getResultType(Eng.getContext()); |
2682 if (Loc::IsLocType(T) || (T->isIntegerType() && T->isScalarType())) { | 2682 if (Loc::isLocType(T) || (T->isIntegerType() && T->isScalarType())) { |
2683 unsigned Count = Builder.getCurrentBlockCount(); | 2683 unsigned Count = Builder.getCurrentBlockCount(); |
2684 SValBuilder &svalBuilder = Eng.getSValBuilder(); | 2684 SValBuilder &svalBuilder = Eng.getSValBuilder(); |
2685 SVal X = svalBuilder.getConjuredSymbolVal(NULL, Ex, T, Count); | 2685 SVal X = svalBuilder.getConjuredSymbolVal(NULL, Ex, T, Count); |
2686 state = state->BindExpr(Ex, X, false); | 2686 state = state->BindExpr(Ex, X, false); |
2687 } | 2687 } |
2688 | 2688 |
2689 break; | 2689 break; |
2690 } | 2690 } |
2691 | 2691 |
2692 case RetEffect::Alias: { | 2692 case RetEffect::Alias: { |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3510 // Register the RetainReleaseChecker with the ExprEngine object. | 3510 // Register the RetainReleaseChecker with the ExprEngine object. |
3511 // Functionality in CFRefCount will be migrated to RetainReleaseChecker | 3511 // Functionality in CFRefCount will be migrated to RetainReleaseChecker |
3512 // over time. | 3512 // over time. |
3513 Eng.registerCheck(new RetainReleaseChecker(this)); | 3513 Eng.registerCheck(new RetainReleaseChecker(this)); |
3514 } | 3514 } |
3515 | 3515 |
3516 TransferFuncs* ento::MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled, | 3516 TransferFuncs* ento::MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled, |
3517 const LangOptions& lopts) { | 3517 const LangOptions& lopts) { |
3518 return new CFRefCount(Ctx, GCEnabled, lopts); | 3518 return new CFRefCount(Ctx, GCEnabled, lopts); |
3519 } | 3519 } |
OLD | NEW |