Skip to content

Commit ee9a739

Browse files
committed
Stop "using namespace llvm"
This avoids ambiguities between llvm and swift types with the same name.
1 parent ddf90c1 commit ee9a739

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

include/swift/SILOptimizer/Analysis/ClassHierarchyAnalysis.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#include "llvm/ADT/DenseMap.h"
2222
#include "llvm/Support/Debug.h"
2323

24-
using namespace llvm;
25-
2624
namespace swift {
2725

2826
class SILModule;
@@ -32,7 +30,8 @@ class ClassHierarchyAnalysis : public SILAnalysis {
3230
typedef SmallVector<ClassDecl *, 8> ClassList;
3331
typedef SmallPtrSet<ClassDecl *, 32> ClassSet;
3432
typedef SmallVector<NominalTypeDecl *, 8> NominalTypeList;
35-
typedef DenseMap<ProtocolDecl *, NominalTypeList> ProtocolImplementations;
33+
typedef llvm::DenseMap<ProtocolDecl *, NominalTypeList>
34+
ProtocolImplementations;
3635

3736
ClassHierarchyAnalysis(SILModule *Mod)
3837
: SILAnalysis(AnalysisKind::ClassHierarchy), M(Mod) {
@@ -101,10 +100,10 @@ class ClassHierarchyAnalysis : public SILAnalysis {
101100
SILModule *M;
102101

103102
/// A cache that maps a class to all of its known direct subclasses.
104-
DenseMap<ClassDecl*, ClassList> DirectSubclassesCache;
103+
llvm::DenseMap<ClassDecl*, ClassList> DirectSubclassesCache;
105104

106105
/// A cache that maps a class to all of its known indirect subclasses.
107-
DenseMap<ClassDecl*, ClassList> IndirectSubclassesCache;
106+
llvm::DenseMap<ClassDecl*, ClassList> IndirectSubclassesCache;
108107

109108
/// A cache that maps a protocol to all of its known implementations.
110109
ProtocolImplementations ProtocolImplementationsCache;

lib/SILOptimizer/IPO/PerformanceInliner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ namespace {
286286

287287

288288
void ConstantTracker::trackInst(SILInstruction *inst) {
289-
if (auto *LI = dyn_cast<swift::LoadInst>(inst)) {
289+
if (auto *LI = dyn_cast<LoadInst>(inst)) {
290290
SILValue baseAddr = scanProjections(LI->getOperand());
291291
if (SILInstruction *loadLink = getMemoryContent(baseAddr))
292292
links[LI] = loadLink;

0 commit comments

Comments
 (0)