[cfe-commits] r99921 - /cfe/trunk/lib/Checker/RegionStore.cpp
Ted Kremenek
kremenek at apple.com
Tue Mar 30 13:30:52 PDT 2010
Author: kremenek
Date: Tue Mar 30 15:30:52 2010
New Revision: 99921
URL: http://llvm.org/viewvc/llvm-project?rev=99921&view=rev
Log:
Use 'const Optional<SVal>&' to avoid an extra copy.
Modified:
cfe/trunk/lib/Checker/RegionStore.cpp
Modified: cfe/trunk/lib/Checker/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/RegionStore.cpp?rev=99921&r1=99920&r2=99921&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/RegionStore.cpp (original)
+++ cfe/trunk/lib/Checker/RegionStore.cpp Tue Mar 30 15:30:52 2010
@@ -963,7 +963,7 @@
Optional<SVal> RegionStoreManager::getBinding(RegionBindings B,
const MemRegion *R) {
- if (Optional<SVal> V = getDirectBinding(B, R))
+ if (const Optional<SVal> &V = getDirectBinding(B, R))
return V;
return getDefaultBinding(B, R);
@@ -1144,7 +1144,7 @@
const ElementRegion* R) {
// Check if the region has a binding.
RegionBindings B = GetRegionBindings(store);
- if (Optional<SVal> V = getDirectBinding(B, R))
+ if (const Optional<SVal> &V = getDirectBinding(B, R))
return *V;
const MemRegion* superR = R->getSuperRegion();
@@ -1175,7 +1175,7 @@
}
// Check if the immediate super region has a direct binding.
- if (Optional<SVal> V = getDirectBinding(B, superR)) {
+ if (const Optional<SVal> &V = getDirectBinding(B, superR)) {
if (SymbolRef parentSym = V->getAsSymbol())
return ValMgr.getDerivedRegionValueSymbolVal(parentSym, R);
@@ -1203,7 +1203,7 @@
// Check if the region has a binding.
RegionBindings B = GetRegionBindings(store);
- if (Optional<SVal> V = getDirectBinding(B, R))
+ if (const Optional<SVal> &V = getDirectBinding(B, R))
return *V;
QualType Ty = R->getValueType(getContext());
@@ -1278,13 +1278,13 @@
// Check if the region has a binding.
RegionBindings B = GetRegionBindings(store);
- if (Optional<SVal> V = getDirectBinding(B, R))
+ if (const Optional<SVal> &V = getDirectBinding(B, R))
return *V;
const MemRegion *superR = R->getSuperRegion();
// Check if the super region has a default binding.
- if (Optional<SVal> V = getDefaultBinding(B, superR)) {
+ if (const Optional<SVal> &V = getDefaultBinding(B, superR)) {
if (SymbolRef parentSym = V->getAsSymbol())
return ValMgr.getDerivedRegionValueSymbolVal(parentSym, R);
@@ -1300,7 +1300,7 @@
// Check if the region has a binding.
RegionBindings B = GetRegionBindings(store);
- if (Optional<SVal> V = getDirectBinding(B, R))
+ if (const Optional<SVal> &V = getDirectBinding(B, R))
return *V;
// Lazily derive a value for the VarRegion.
@@ -1788,7 +1788,7 @@
}
// Get the data binding for R (if any).
- if (Optional<SVal> V = RM.getBinding(B, R))
+ if (const Optional<SVal> &V = RM.getBinding(B, R))
VisitBinding(*V);
}
More information about the cfe-commits
mailing list