use a more efficient check for 'is metadata'
llvm-svn: 134599
This commit is contained in:
parent
1d4313b261
commit
cdfcc2dee6
|
@ -44,9 +44,9 @@ class BitcodeReaderValueList {
|
||||||
/// number that holds the resolved value.
|
/// number that holds the resolved value.
|
||||||
typedef std::vector<std::pair<Constant*, unsigned> > ResolveConstantsTy;
|
typedef std::vector<std::pair<Constant*, unsigned> > ResolveConstantsTy;
|
||||||
ResolveConstantsTy ResolveConstants;
|
ResolveConstantsTy ResolveConstants;
|
||||||
LLVMContext& Context;
|
LLVMContext &Context;
|
||||||
public:
|
public:
|
||||||
BitcodeReaderValueList(LLVMContext& C) : Context(C) {}
|
BitcodeReaderValueList(LLVMContext &C) : Context(C) {}
|
||||||
~BitcodeReaderValueList() {
|
~BitcodeReaderValueList() {
|
||||||
assert(ResolveConstants.empty() && "Constants not resolved?");
|
assert(ResolveConstants.empty() && "Constants not resolved?");
|
||||||
}
|
}
|
||||||
|
@ -212,10 +212,9 @@ public:
|
||||||
private:
|
private:
|
||||||
const Type *getTypeByID(unsigned ID, bool isTypeTable = false);
|
const Type *getTypeByID(unsigned ID, bool isTypeTable = false);
|
||||||
Value *getFnValueByID(unsigned ID, const Type *Ty) {
|
Value *getFnValueByID(unsigned ID, const Type *Ty) {
|
||||||
if (Ty == Type::getMetadataTy(Context))
|
if (Ty->isMetadataTy())
|
||||||
return MDValueList.getValueFwdRef(ID);
|
return MDValueList.getValueFwdRef(ID);
|
||||||
else
|
return ValueList.getValueFwdRef(ID, Ty);
|
||||||
return ValueList.getValueFwdRef(ID, Ty);
|
|
||||||
}
|
}
|
||||||
BasicBlock *getBasicBlock(unsigned ID) const {
|
BasicBlock *getBasicBlock(unsigned ID) const {
|
||||||
if (ID >= FunctionBBs.size()) return 0; // Invalid ID
|
if (ID >= FunctionBBs.size()) return 0; // Invalid ID
|
||||||
|
|
Loading…
Reference in New Issue