Commit ac3dedc2 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Switch some more things to DenseMap

parent 7fd78399
......@@ -15,6 +15,8 @@
#ifndef PYSTON_ANALYSIS_SCOPINGANALYSIS_H
#define PYSTON_ANALYSIS_SCOPINGANALYSIS_H
#include "llvm/ADT/DenseMap.h"
#include "core/common.h"
#include "core/stringpool.h"
......@@ -146,14 +148,14 @@ public:
class ScopingAnalysis {
public:
struct ScopeNameUsage;
typedef std::unordered_map<AST*, ScopeNameUsage*> NameUsageMap;
typedef llvm::DenseMap<AST*, ScopeNameUsage*> NameUsageMap;
private:
std::unordered_map<AST*, ScopeInfo*> scopes;
llvm::DenseMap<AST*, ScopeInfo*> scopes;
AST_Module* parent_module;
InternedStringPool* interned_strings;
std::unordered_map<AST*, AST*> scope_replacements;
llvm::DenseMap<AST*, AST*> scope_replacements;
ScopeInfo* analyzeSubtree(AST* node);
void processNameUsages(NameUsageMap* usages);
......
......@@ -186,8 +186,9 @@ void Rewriter::ConstLoader::moveImmediate(uint64_t val, assembler::Register dst_
assembler::Register Rewriter::ConstLoader::findConst(uint64_t val, bool& found_value) {
assert(rewriter->phase_emitting);
if (constToVar.count(val) > 0) {
RewriterVar* var = constToVar[val];
auto it = constToVar.find(val);
if (it != constToVar.end()) {
RewriterVar* var = it->second;
for (Location l : var->locations) {
if (l.type == Location::Register) {
found_value = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment