diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-08-02 17:33:11 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-08-02 17:33:11 +0000 | 
| commit | c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (patch) | |
| tree | 27425930fc0c91650a7f3527fcac8e0f92907b90 /lib/Analysis/UninitializedValues.cpp | |
| parent | 486754660bb926339aefcf012a3f848592babb8b (diff) | |
Notes
Diffstat (limited to 'lib/Analysis/UninitializedValues.cpp')
| -rw-r--r-- | lib/Analysis/UninitializedValues.cpp | 22 | 
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Analysis/UninitializedValues.cpp b/lib/Analysis/UninitializedValues.cpp index 63353292349b..31c88a109565 100644 --- a/lib/Analysis/UninitializedValues.cpp +++ b/lib/Analysis/UninitializedValues.cpp @@ -62,13 +62,13 @@ class DeclToIndex {  public:    DeclToIndex() = default; -   +    /// Compute the actual mapping from declarations to bits.    void computeMap(const DeclContext &dc); -   +    /// Return the number of declarations in the map.    unsigned size() const { return map.size(); } -   +    /// Returns the bit vector index for a given declaration.    Optional<unsigned> getValueIndex(const VarDecl *d) const;  }; @@ -126,8 +126,8 @@ public:    CFGBlockValues(const CFG &cfg);    unsigned getNumEntries() const { return declToIndex.size(); } -   -  void computeSetOfDeclarations(const DeclContext &dc);   + +  void computeSetOfDeclarations(const DeclContext &dc);    ValueVector &getValueVector(const CFGBlock *block) {      return vals[block->getBlockID()]; @@ -136,13 +136,13 @@ public:    void setAllScratchValues(Value V);    void mergeIntoScratch(ValueVector const &source, bool isFirst);    bool updateValueVectorWithScratch(const CFGBlock *block); -   +    bool hasNoDeclarations() const {      return declToIndex.size() == 0;    }    void resetScratch(); -   +    ValueVector::reference operator[](const VarDecl *vd);    Value getValue(const CFGBlock *block, const CFGBlock *dstBlock, @@ -151,7 +151,7 @@ public:      assert(idx.hasValue());      return getValueVector(block)[idx.getValue()];    } -};   +};  } // namespace @@ -235,7 +235,7 @@ public:        ++PO_I;      }    } -   +    void enqueueSuccessors(const CFGBlock *block);    const CFGBlock *dequeue();  }; @@ -614,7 +614,7 @@ public:          const CFGBlock *Pred = *I;          if (!Pred)            continue; -         +          Value AtPredExit = vals.getValue(Pred, B, vd);          if (AtPredExit == Initialized)            // This block initializes the variable. @@ -923,7 +923,7 @@ void clang::runUninitializedVariablesAnalysis(                                classification, wasAnalyzed, PBH);      ++stats.NumBlockVisits;      if (changed || !previouslyVisited[block->getBlockID()]) -      worklist.enqueueSuccessors(block);     +      worklist.enqueueSuccessors(block);      previouslyVisited[block->getBlockID()] = true;    }  | 
