summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2008-05-30 06:11:18 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2008-05-30 06:11:18 +0000
commit706aecf98edad4cc7d1bf9d17e2f7f2cee1e2d99 (patch)
tree0be836d1e3bbeb9fbd4104536812c0ace52668dd /tools
parent14ec27fff1cddeb0255dc384f353a1a7e51b1c7e (diff)
downloadllvm-706aecf98edad4cc7d1bf9d17e2f7f2cee1e2d99.tar.gz
llvm-706aecf98edad4cc7d1bf9d17e2f7f2cee1e2d99.tar.bz2
llvm-706aecf98edad4cc7d1bf9d17e2f7f2cee1e2d99.tar.xz
Update the code to the fact that StringSet now lives in llvm/ADT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51730 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvmc2/CompilationGraph.h4
-rw-r--r--tools/llvmc2/StringSet.h40
-rw-r--r--tools/llvmc2/Tool.h9
3 files changed, 7 insertions, 46 deletions
diff --git a/tools/llvmc2/CompilationGraph.h b/tools/llvmc2/CompilationGraph.h
index 6b2b290920..41731a3f89 100644
--- a/tools/llvmc2/CompilationGraph.h
+++ b/tools/llvmc2/CompilationGraph.h
@@ -16,13 +16,13 @@
#include "AutoGenerated.h"
#include "Tool.h"
-#include "StringSet.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/StringSet.h"
#include "llvm/System/Path.h"
#include <cassert>
@@ -30,7 +30,7 @@
namespace llvmc {
- typedef StringSet<> InputLanguagesSet;
+ typedef llvm::StringSet<> InputLanguagesSet;
/// Edge - Represents an edge of the compilation graph.
class Edge : public llvm::RefCountedBaseVPTR<Edge> {
diff --git a/tools/llvmc2/StringSet.h b/tools/llvmc2/StringSet.h
deleted file mode 100644
index d9556cc552..0000000000
--- a/tools/llvmc2/StringSet.h
+++ /dev/null
@@ -1,40 +0,0 @@
-//===--- StringSet.h - The LLVM Compiler Driver -----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open
-// Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// StringSet - A set-like wrapper for the StringMap.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TOOLS_LLVMC2_STRINGSET_H
-#define LLVM_TOOLS_LLVMC2_STRINGSET_H
-
-#include "llvm/ADT/StringMap.h"
-
-#include <cassert>
-
-namespace llvmc {
-
- /// StringSet - A wrapper for StringMap that provides set-like
- /// functionality. Only insert() and count() methods are used by my
- /// code.
- template <class AllocatorTy = llvm::MallocAllocator>
- class StringSet : public llvm::StringMap<char, AllocatorTy> {
- typedef llvm::StringMap<char, AllocatorTy> base;
- public:
- void insert (const std::string& InLang) {
- assert(!InLang.empty());
- const char* KeyStart = &InLang[0];
- const char* KeyEnd = KeyStart + InLang.size();
- base::insert(llvm::StringMapEntry<char>::
- Create(KeyStart, KeyEnd, base::getAllocator(), '+'));
- }
- };
-}
-
-#endif //LLVM_TOOLS_LLVMC2_STRINGSET_H
diff --git a/tools/llvmc2/Tool.h b/tools/llvmc2/Tool.h
index 3527817026..294c6fb9b3 100644
--- a/tools/llvmc2/Tool.h
+++ b/tools/llvmc2/Tool.h
@@ -15,9 +15,9 @@
#define LLVM_TOOLS_LLVMC2_TOOL_H
#include "Action.h"
-#include "StringSet.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
+#include "llvm/ADT/StringSet.h"
#include "llvm/System/Path.h"
#include <string>
@@ -26,6 +26,7 @@
namespace llvmc {
typedef std::vector<llvm::sys::Path> PathVector;
+ typedef llvm::StringSet<> InputLanguagesSet;
/// Tool - A class
class Tool : public llvm::RefCountedBaseVPTR<Tool> {
@@ -35,11 +36,11 @@ namespace llvmc {
virtual Action GenerateAction (const PathVector& inFiles,
const llvm::sys::Path& outFile,
- const StringSet<>& InLangs) const = 0;
+ const InputLanguagesSet& InLangs) const = 0;
virtual Action GenerateAction (const llvm::sys::Path& inFile,
const llvm::sys::Path& outFile,
- const StringSet<>& InLangs) const = 0;
+ const InputLanguagesSet& InLangs) const = 0;
virtual const char* Name() const = 0;
virtual const char* InputLanguage() const = 0;
@@ -58,7 +59,7 @@ namespace llvmc {
bool JoinListEmpty() const { return JoinList_.empty(); }
Action GenerateAction(const llvm::sys::Path& outFile,
- const StringSet<>& InLangs) const {
+ const InputLanguagesSet& InLangs) const {
return GenerateAction(JoinList_, outFile, InLangs);
}
// We shouldn't shadow base class's version of GenerateAction.