Further cleanup. Moved definitions for SymbolManager and ValueManager into
their own [.cpp;.h] files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47201 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/SymbolManager.cpp b/Analysis/SymbolManager.cpp
new file mode 100644
index 0000000..bdda0e6
--- /dev/null
+++ b/Analysis/SymbolManager.cpp
@@ -0,0 +1,53 @@
+//== SymbolManager.h - Management of Symbolic Values ------------*- C++ -*--==//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This files defines SymbolManager, a class that manages symbolic values
+// created for use by GRExprEngine and related classes.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Analysis/PathSensitive/SymbolManager.h"
+
+using namespace clang;
+
+SymbolID SymbolManager::getSymbol(ParmVarDecl* D) {
+ SymbolID& X = DataToSymbol[getKey(D)];
+
+ if (!X.isInitialized()) {
+ X = SymbolToData.size();
+ SymbolToData.push_back(SymbolDataParmVar(D));
+ }
+
+ return X;
+}
+
+SymbolID SymbolManager::getContentsOfSymbol(SymbolID sym) {
+ SymbolID& X = DataToSymbol[getKey(sym)];
+
+ if (!X.isInitialized()) {
+ X = SymbolToData.size();
+ SymbolToData.push_back(SymbolDataContentsOf(sym));
+ }
+
+ return X;
+}
+
+QualType SymbolData::getType() const {
+ switch (getKind()) {
+ default:
+ assert (false && "getType() not implemented for this symbol.");
+
+ case ParmKind:
+ return cast<SymbolDataParmVar>(this)->getDecl()->getType();
+
+ }
+}
+
+SymbolManager::SymbolManager() {}
+SymbolManager::~SymbolManager() {}