mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-20 00:43:48 +00:00
Make some improvements suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13765 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
293a55f9f0
commit
3751bd607b
@ -1,4 +1,4 @@
|
|||||||
//===-- SlotCalculator.cpp - Calculate what slots values land in ----------===//
|
//===-- SlotTable.cpp - Abstract data type for slot numbers ---------------===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
@ -7,16 +7,15 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file implements a utility class for keeping track of slot numbers for
|
// This file implements an abstract data type for keeping track of slot numbers
|
||||||
// bytecode and assembly writing.
|
// for bytecode and assembly writing or any other purpose.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/Internal/SlotTable.h"
|
|
||||||
#include "llvm/Type.h"
|
|
||||||
#include "llvm/Value.h"
|
|
||||||
#include "llvm/GlobalValue.h"
|
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
|
#include "llvm/Type.h"
|
||||||
|
#include "llvm/GlobalValue.h"
|
||||||
|
#include "llvm/Internal/SlotTable.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
@ -80,9 +79,11 @@ SlotTable::SlotNum SlotTable::insert( const Value* Val, PlaneNum plane ) {
|
|||||||
return DestSlot;
|
return DestSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
// insert - insert a type into a specific plane
|
// insert - insert a type
|
||||||
SlotTable::SlotNum SlotTable::insert( const Type* Typ ) {
|
SlotTable::SlotNum SlotTable::insert( const Type* Typ ) {
|
||||||
// Insert node into table and map
|
// Insert node into table and map making sure that
|
||||||
|
// the same type isn't inserted twice.
|
||||||
|
assert(tMap.find(Typ) == tMap.end() && "Can't insert a Type multiple times");
|
||||||
SlotNum DestSlot = tMap[Typ] = tPlane.size();
|
SlotNum DestSlot = tMap[Typ] = tPlane.size();
|
||||||
tPlane.push_back(Typ);
|
tPlane.push_back(Typ);
|
||||||
return DestSlot;
|
return DestSlot;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//===-- SlotCalculator.cpp - Calculate what slots values land in ----------===//
|
//===-- SlotTable.cpp - Abstract data type for slot numbers ---------------===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
@ -7,16 +7,15 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file implements a utility class for keeping track of slot numbers for
|
// This file implements an abstract data type for keeping track of slot numbers
|
||||||
// bytecode and assembly writing.
|
// for bytecode and assembly writing or any other purpose.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/Internal/SlotTable.h"
|
|
||||||
#include "llvm/Type.h"
|
|
||||||
#include "llvm/Value.h"
|
|
||||||
#include "llvm/GlobalValue.h"
|
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
|
#include "llvm/Type.h"
|
||||||
|
#include "llvm/GlobalValue.h"
|
||||||
|
#include "llvm/Internal/SlotTable.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
@ -80,9 +79,11 @@ SlotTable::SlotNum SlotTable::insert( const Value* Val, PlaneNum plane ) {
|
|||||||
return DestSlot;
|
return DestSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
// insert - insert a type into a specific plane
|
// insert - insert a type
|
||||||
SlotTable::SlotNum SlotTable::insert( const Type* Typ ) {
|
SlotTable::SlotNum SlotTable::insert( const Type* Typ ) {
|
||||||
// Insert node into table and map
|
// Insert node into table and map making sure that
|
||||||
|
// the same type isn't inserted twice.
|
||||||
|
assert(tMap.find(Typ) == tMap.end() && "Can't insert a Type multiple times");
|
||||||
SlotNum DestSlot = tMap[Typ] = tPlane.size();
|
SlotNum DestSlot = tMap[Typ] = tPlane.size();
|
||||||
tPlane.push_back(Typ);
|
tPlane.push_back(Typ);
|
||||||
return DestSlot;
|
return DestSlot;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user