diff --git a/tools/llvmc2/CompilationGraph.cpp b/tools/llvmc2/CompilationGraph.cpp index 73664028cad..1b507114874 100644 --- a/tools/llvmc2/CompilationGraph.cpp +++ b/tools/llvmc2/CompilationGraph.cpp @@ -50,8 +50,7 @@ namespace { MaxEdge = E; MaxWeight = EW; SingleMax = true; - } - else if (EW == MaxWeight) { + } else if (EW == MaxWeight) { SingleMax = false; } } diff --git a/tools/llvmc2/CompilationGraph.h b/tools/llvmc2/CompilationGraph.h index 57deef30a5c..132deb8822f 100644 --- a/tools/llvmc2/CompilationGraph.h +++ b/tools/llvmc2/CompilationGraph.h @@ -20,16 +20,30 @@ #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/iterator" -#include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringMap.h" #include "llvm/System/Path.h" +#include #include namespace llvmc { - typedef llvm::SmallSet InputLanguagesSet; + // A wrapper for StringMap that provides set-like functionality. + // Only insert() and count() methods are used by my code. + template + class StringSet : public llvm::StringMap { + typedef llvm::StringMap 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:: + Create(KeyStart, KeyEnd, base::getAllocator(), '+')); + } + }; + typedef StringSet<> InputLanguagesSet; // An edge of the compilation graph. class Edge : public llvm::RefCountedBaseVPTR { diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp index 5a7bf67c0a0..d9d9fda8c84 100644 --- a/utils/TableGen/LLVMCConfigurationEmitter.cpp +++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp @@ -948,8 +948,7 @@ bool EmitEdgePropertyTest1Arg(const std::string& PropName, throw OptName + ": incorrect option type!"; O << OptDesc.GenVariableName(); return true; - } - else if (PropName == "if_input_languages_contain") { + } else if (PropName == "if_input_languages_contain") { O << "InLangs.count(\"" << OptName << "\") != 0"; return true; }