diff options
author | Faisal Vali <faisalv@yahoo.com> | 2013-12-07 20:22:44 +0000 |
---|---|---|
committer | Faisal Vali <faisalv@yahoo.com> | 2013-12-07 20:22:44 +0000 |
commit | ab3d646a9d63f31c1f569c324cbb8540ed82a016 (patch) | |
tree | e827fafb7d654b2ecf3e6b29df3485a71855df53 /clang/lib/Sema/ScopeInfo.cpp | |
parent | 080133453bae62a43466e881ffc03fb7cffd7288 (diff) | |
download | bcm5719-llvm-ab3d646a9d63f31c1f569c324cbb8540ed82a016.tar.gz bcm5719-llvm-ab3d646a9d63f31c1f569c324cbb8540ed82a016.zip |
[REFACTOR] Refactored some of the generic-lambda capturing code.
Employed the following refactorings:
- Renamed some functions
- Introduced explaining variables
- Cleaned up & added comments
- Used Optional<unsigned> for return value instead of an out parameter
- Added assertions
- Constified a few member functions
No functionality change.
All regressions pass.
llvm-svn: 196662
Diffstat (limited to 'clang/lib/Sema/ScopeInfo.cpp')
-rw-r--r-- | clang/lib/Sema/ScopeInfo.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/ScopeInfo.cpp b/clang/lib/Sema/ScopeInfo.cpp index 6d5088504c4..1e54c5ae3ea 100644 --- a/clang/lib/Sema/ScopeInfo.cpp +++ b/clang/lib/Sema/ScopeInfo.cpp @@ -190,10 +190,11 @@ void FunctionScopeInfo::markSafeWeakUse(const Expr *E) { ThisUse->markSafe(); } -void LambdaScopeInfo::getPotentialVariableCapture(unsigned Idx, VarDecl *&VD, Expr *&E) { +void LambdaScopeInfo::getPotentialVariableCapture(unsigned Idx, VarDecl *&VD, + Expr *&E) const { assert(Idx < getNumPotentialVariableCaptures() && - "Index of potential capture must be within 0 to less than the " - "number of captures!"); + "Index of potential capture must be within 0 to less than the " + "number of captures!"); E = PotentiallyCapturingExprs[Idx]; if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E)) VD = dyn_cast<VarDecl>(DRE->getFoundDecl()); |