25 files changed:
}
// Don't make placeholders with invalid type.
}
// Don't make placeholders with invalid type.
- if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty) &&
- Ty != Type::getLabelTy(F.getContext())) {
+ if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty) && !Ty->isLabelTy()) {
P.Error(Loc, "invalid use of a non-first-class type");
return 0;
}
P.Error(Loc, "invalid use of a non-first-class type");
return 0;
}
- if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty) &&
- Ty != Type::getLabelTy(F.getContext())) {
+ if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty) && !Ty->isLabelTy()) {
P.Error(Loc, "invalid use of a non-first-class type");
return 0;
}
P.Error(Loc, "invalid use of a non-first-class type");
return 0;
}
AttrListPtr PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
AttrListPtr PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
- if (PAL.paramHasAttr(1, Attribute::StructRet) &&
- RetType != Type::getVoidTy(Context))
+ if (PAL.paramHasAttr(1, Attribute::StructRet) && !RetType->isVoidTy())
return Error(RetTypeLoc, "functions with 'sret' argument must return void");
const FunctionType *FT =
return Error(RetTypeLoc, "functions with 'sret' argument must return void");
const FunctionType *FT =
const Type *Ty = getTypeByID(Record[i], false);
if (Ty->isMetadataTy())
Elts.push_back(MDValueList.getValueFwdRef(Record[i+1]));
const Type *Ty = getTypeByID(Record[i], false);
if (Ty->isMetadataTy())
Elts.push_back(MDValueList.getValueFwdRef(Record[i+1]));
- else if (Ty != Type::getVoidTy(Context))
+ else if (!Ty->isVoidTy())
Elts.push_back(ValueList.getValueFwdRef(Record[i+1], Ty));
else
Elts.push_back(NULL);
Elts.push_back(ValueList.getValueFwdRef(Record[i+1], Ty));
else
Elts.push_back(NULL);
}
// Non-void values get registered in the value table for future use.
}
// Non-void values get registered in the value table for future use.
- if (I && I->getType() != Type::getVoidTy(Context))
+ if (I && !I->getType()->isVoidTy())
ValueList.AssignValue(I, NextValueNo++);
}
ValueList.AssignValue(I, NextValueNo++);
}
// Add all of the instructions.
for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; ++I) {
// Add all of the instructions.
for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; ++I) {
- if (I->getType() != Type::getVoidTy(F.getContext()))
+ if (!I->getType()->isVoidTy())
case Intrinsic::setjmp: {
Value *V = ReplaceCallWith("setjmp", CI, CI->op_begin() + 1, CI->op_end(),
Type::getInt32Ty(Context));
case Intrinsic::setjmp: {
Value *V = ReplaceCallWith("setjmp", CI, CI->op_begin() + 1, CI->op_end(),
Type::getInt32Ty(Context));
- if (CI->getType() != Type::getVoidTy(Context))
+ if (!CI->getType()->isVoidTy())
CI->replaceAllUsesWith(V);
break;
}
case Intrinsic::sigsetjmp:
CI->replaceAllUsesWith(V);
break;
}
case Intrinsic::sigsetjmp:
- if (CI->getType() != Type::getVoidTy(Context))
+ if (!CI->getType()->isVoidTy())
CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
break;
CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
break;
}
case Intrinsic::flt_rounds:
// Lower to "round to the nearest"
}
case Intrinsic::flt_rounds:
// Lower to "round to the nearest"
- if (CI->getType() != Type::getVoidTy(Context))
+ if (!CI->getType()->isVoidTy())
CI->replaceAllUsesWith(ConstantInt::get(CI->getType(), 1));
break;
case Intrinsic::invariant_start:
CI->replaceAllUsesWith(ConstantInt::get(CI->getType(), 1));
break;
case Intrinsic::invariant_start:
return;
}
// Interpret void as zero return values.
return;
}
// Interpret void as zero return values.
- if (Ty == Type::getVoidTy(Ty->getContext()))
return;
// Base case: we can get an EVT for this LLVM IR type.
ValueVTs.push_back(TLI.getValueType(Ty));
return;
// Base case: we can get an EVT for this LLVM IR type.
ValueVTs.push_back(TLI.getValueType(Ty));
} else if (!HasChain) {
Result = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, getCurDebugLoc(),
VTs, &Ops[0], Ops.size());
} else if (!HasChain) {
Result = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, getCurDebugLoc(),
VTs, &Ops[0], Ops.size());
- } else if (I.getType() != Type::getVoidTy(*DAG.getContext())) {
+ } else if (!I.getType()->isVoidTy()) {
Result = DAG.getNode(ISD::INTRINSIC_W_CHAIN, getCurDebugLoc(),
VTs, &Ops[0], Ops.size());
} else {
Result = DAG.getNode(ISD::INTRINSIC_W_CHAIN, getCurDebugLoc(),
VTs, &Ops[0], Ops.size());
} else {
- if (I.getType() != Type::getVoidTy(*DAG.getContext())) {
+ if (!I.getType()->isVoidTy()) {
if (const VectorType *PTy = dyn_cast<VectorType>(I.getType())) {
EVT VT = TLI.getValueType(PTy);
Result = DAG.getNode(ISD::BIT_CONVERT, getCurDebugLoc(), VT, Result);
if (const VectorType *PTy = dyn_cast<VectorType>(I.getType())) {
EVT VT = TLI.getValueType(PTy);
Result = DAG.getNode(ISD::BIT_CONVERT, getCurDebugLoc(), VT, Result);
// The return value of the call is this value. As such, there is no
// corresponding argument.
// The return value of the call is this value. As such, there is no
// corresponding argument.
- assert(CS.getType() != Type::getVoidTy(*DAG.getContext()) &&
+ assert(!CS.getType()->isVoidTy() &&
"Bad inline asm!");
if (const StructType *STy = dyn_cast<StructType>(CS.getType())) {
OpVT = TLI.getValueType(STy->getElementType(ResNo));
"Bad inline asm!");
if (const StructType *STy = dyn_cast<StructType>(CS.getType())) {
OpVT = TLI.getValueType(STy->getElementType(ResNo));
OpInfo.CallOperandVal));
} else {
// This is the result value of the call.
OpInfo.CallOperandVal));
} else {
// This is the result value of the call.
- assert(CS.getType() != Type::getVoidTy(*DAG.getContext()) &&
- "Bad inline asm!");
+ assert(!CS.getType()->isVoidTy() && "Bad inline asm!");
// Concatenate this output onto the outputs list.
RetValRegs.append(OpInfo.AssignedRegs);
}
// Concatenate this output onto the outputs list.
RetValRegs.append(OpInfo.AssignedRegs);
}
- if (BI->getType() != Type::getVoidTy(*CurDAG->getContext())) {
+ if (!BI->getType()->isVoidTy()) {
unsigned &R = FuncInfo->ValueMap[BI];
if (!R)
R = FuncInfo->CreateRegForValue(BI);
unsigned &R = FuncInfo->ValueMap[BI];
if (!R)
R = FuncInfo->CreateRegForValue(BI);
// Check main() type
unsigned NumArgs = Fn->getFunctionType()->getNumParams();
const FunctionType *FTy = Fn->getFunctionType();
// Check main() type
unsigned NumArgs = Fn->getFunctionType()->getNumParams();
const FunctionType *FTy = Fn->getFunctionType();
- const Type* PPInt8Ty =
- PointerType::getUnqual(PointerType::getUnqual(
- Type::getInt8Ty(Fn->getContext())));
+ const Type* PPInt8Ty = Type::getInt8PtrTy(Fn->getContext())->getPointerTo();
switch (NumArgs) {
case 3:
if (FTy->getParamType(2) != PPInt8Ty) {
switch (NumArgs) {
case 3:
if (FTy->getParamType(2) != PPInt8Ty) {
// FALLS THROUGH
case 0:
if (!isa<IntegerType>(FTy->getReturnType()) &&
// FALLS THROUGH
case 0:
if (!isa<IntegerType>(FTy->getReturnType()) &&
- FTy->getReturnType() != Type::getVoidTy(FTy->getContext())) {
+ !FTy->getReturnType()->isVoidTy()) {
llvm_report_error("Invalid return type of main() supplied");
}
break;
llvm_report_error("Invalid return type of main() supplied");
}
break;
ExecutionContext &CallingSF = ECStack.back();
if (Instruction *I = CallingSF.Caller.getInstruction()) {
// Save result...
ExecutionContext &CallingSF = ECStack.back();
if (Instruction *I = CallingSF.Caller.getInstruction()) {
// Save result...
- if (CallingSF.Caller.getType() != Type::getVoidTy(RetTy->getContext()))
+ if (!CallingSF.Caller.getType()->isVoidTy())
SetValue(I, Result, CallingSF);
if (InvokeInst *II = dyn_cast<InvokeInst> (I))
SwitchToNewBasicBlock (II->getNormalDest (), CallingSF);
SetValue(I, Result, CallingSF);
if (InvokeInst *II = dyn_cast<InvokeInst> (I))
SwitchToNewBasicBlock (II->getNormalDest (), CallingSF);
// Handle some common cases first. These cases correspond to common `main'
// prototypes.
// Handle some common cases first. These cases correspond to common `main'
// prototypes.
- if (RetTy == Type::getInt32Ty(F->getContext()) ||
- RetTy == Type::getVoidTy(F->getContext())) {
+ if (RetTy == Type::getInt32Ty(F->getContext()) || RetTy->isVoidTy()) {
switch (ArgValues.size()) {
case 3:
if (FTy->getParamType(0) == Type::getInt32Ty(F->getContext()) &&
switch (ArgValues.size()) {
case 3:
if (FTy->getParamType(0) == Type::getInt32Ty(F->getContext()) &&
"", StubBB);
TheCall->setCallingConv(F->getCallingConv());
TheCall->setTailCall();
"", StubBB);
TheCall->setCallingConv(F->getCallingConv());
TheCall->setTailCall();
- if (TheCall->getType() != Type::getVoidTy(F->getContext()))
+ if (!TheCall->getType()->isVoidTy())
// Return result of the call.
ReturnInst::Create(F->getContext(), TheCall, StubBB);
else
// Return result of the call.
ReturnInst::Create(F->getContext(), TheCall, StubBB);
else
const PointerType *PFTy = dyn_cast<PointerType>(STy->getElementType(1));
if (!PFTy) return 0;
const FunctionType *FTy = dyn_cast<FunctionType>(PFTy->getElementType());
const PointerType *PFTy = dyn_cast<PointerType>(STy->getElementType(1));
if (!PFTy) return 0;
const FunctionType *FTy = dyn_cast<FunctionType>(PFTy->getElementType());
- if (!FTy || FTy->getReturnType() != Type::getVoidTy(M.getContext()) ||
+ if (!FTy || !FTy->getReturnType()->isVoidTy() ||
FTy->isVarArg() || FTy->getNumParams() != 0)
return 0;
FTy->isVarArg() || FTy->getNumParams() != 0)
return 0;
CallInst *CI = CallInst::Create(F, Args.begin(), Args.end(), "", BB);
CI->setTailCall();
CI->setCallingConv(F->getCallingConv());
CallInst *CI = CallInst::Create(F, Args.begin(), Args.end(), "", BB);
CI->setTailCall();
CI->setCallingConv(F->getCallingConv());
- if (NewG->getReturnType() == Type::getVoidTy(F->getContext())) {
+ if (NewG->getReturnType()->isVoidTy()) {
ReturnInst::Create(F->getContext(), BB);
} else if (CI->getType() != NewG->getReturnType()) {
Value *BCI = new BitCastInst(CI, NewG->getReturnType(), "", BB);
ReturnInst::Create(F->getContext(), BB);
} else if (CI->getType() != NewG->getReturnType()) {
Value *BCI = new BitCastInst(CI, NewG->getReturnType(), "", BB);
DEBUG(dbgs() << "SretPromotion: Looking at sret function "
<< F->getName() << "\n");
DEBUG(dbgs() << "SretPromotion: Looking at sret function "
<< F->getName() << "\n");
- assert(F->getReturnType() == Type::getVoidTy(F->getContext()) &&
- "Invalid function return type");
+ assert(F->getReturnType()->isVoidTy() && "Invalid function return type");
Function::arg_iterator AI = F->arg_begin();
const llvm::PointerType *FArgType = dyn_cast<PointerType>(AI->getType());
assert(FArgType && "Invalid sret parameter type");
Function::arg_iterator AI = F->arg_begin();
const llvm::PointerType *FArgType = dyn_cast<PointerType>(AI->getType());
assert(FArgType && "Invalid sret parameter type");
unsigned Num = STy->getNumElements();
for (unsigned i = 0; i < Num; i++) {
const Type *Ty = STy->getElementType(i);
unsigned Num = STy->getNumElements();
for (unsigned i = 0; i < Num; i++) {
const Type *Ty = STy->getElementType(i);
- if (!Ty->isSingleValueType() && Ty != Type::getVoidTy(STy->getContext()))
+ if (!Ty->isSingleValueType() && !Ty->isVoidTy())
return true;
}
return false;
return true;
}
return false;
// See if the value can be truncated to float and then reextended.
if (Value *V = FitsInFPType(CFP, APFloat::IEEEsingle))
return V;
// See if the value can be truncated to float and then reextended.
if (Value *V = FitsInFPType(CFP, APFloat::IEEEsingle))
return V;
- if (CFP->getType() == Type::getDoubleTy(V->getContext()))
+ if (CFP->getType()->isDoubleTy())
return V; // Won't shrink.
if (Value *V = FitsInFPType(CFP, APFloat::IEEEdouble))
return V;
return V; // Won't shrink.
if (Value *V = FitsInFPType(CFP, APFloat::IEEEdouble))
return V;
Value *RetVal = 0;
// Create a value to return... if the function doesn't return null...
Value *RetVal = 0;
// Create a value to return... if the function doesn't return null...
- if (BB->getParent()->getReturnType() != Type::getVoidTy(TI->getContext()))
+ if (!BB->getParent()->getReturnType()->isVoidTy())
RetVal = Constant::getNullValue(BB->getParent()->getReturnType());
// Create the return...
RetVal = Constant::getNullValue(BB->getParent()->getReturnType());
// Create the return...
// this should be rewritten as a `ret'
// Check if the function should return a value
// this should be rewritten as a `ret'
// Check if the function should return a value
- if (OldFnRetTy == Type::getVoidTy(Context)) {
+ if (OldFnRetTy->isVoidTy()) {
ReturnInst::Create(Context, 0, TheSwitch); // Return void
} else if (OldFnRetTy == TheSwitch->getCondition()->getType()) {
// return what we have
ReturnInst::Create(Context, 0, TheSwitch); // Return void
} else if (OldFnRetTy == TheSwitch->getCondition()->getType()) {
// return what we have
bool runOnFunction(Function &F) {
for (Function::arg_iterator AI = F.arg_begin(), AE = F.arg_end();
AI != AE; ++AI)
bool runOnFunction(Function &F) {
for (Function::arg_iterator AI = F.arg_begin(), AE = F.arg_end();
AI != AE; ++AI)
- if (!AI->hasName() && AI->getType() != Type::getVoidTy(F.getContext()))
+ if (!AI->hasName() && !AI->getType()->isVoidTy())
AI->setName("arg");
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
AI->setName("arg");
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
BB->setName("bb");
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
BB->setName("bb");
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- if (!I->hasName() && I->getType() != Type::getVoidTy(F.getContext()))
+ if (!I->hasName() && !I->getType()->isVoidTy())
I->setName("tmp");
}
return true;
I->setName("tmp");
}
return true;
// Insert a return instruction. This really should be a "barrier", as it
// is unreachable.
ReturnInst::Create(F.getContext(),
// Insert a return instruction. This really should be a "barrier", as it
// is unreachable.
ReturnInst::Create(F.getContext(),
- F.getReturnType() == Type::getVoidTy(F.getContext()) ?
+ F.getReturnType()->isVoidTy() ?
0 : Constant::getNullValue(F.getReturnType()), UI);
// Remove the unwind instruction now.
0 : Constant::getNullValue(F.getReturnType()), UI);
// Remove the unwind instruction now.
for (Function::iterator B = F.begin(), BE = F.end(); B != BE; ++B)
for (BasicBlock::iterator I = B->begin(), E = B->end(); I != E; ++I)
for (Function::iterator B = F.begin(), BE = F.end(); B != BE; ++B)
for (BasicBlock::iterator I = B->begin(), E = B->end(); I != E; ++I)
- if (I->getType() != Type::getVoidTy(F.getContext()))
+ if (!I->getType()->isVoidTy())
Insts.push_back(I);
ssi.createSSI(Insts);
Insts.push_back(I);
ssi.createSSI(Insts);
// Okay, it is safe to hoist the terminator.
Instruction *NT = I1->clone();
BIParent->getInstList().insert(BI, NT);
// Okay, it is safe to hoist the terminator.
Instruction *NT = I1->clone();
BIParent->getInstList().insert(BI, NT);
- if (NT->getType() != Type::getVoidTy(BB1->getContext())) {
+ if (!NT->getType()->isVoidTy()) {
I1->replaceAllUsesWith(NT);
I2->replaceAllUsesWith(NT);
NT->takeName(I1);
I1->replaceAllUsesWith(NT);
I2->replaceAllUsesWith(NT);
NT->takeName(I1);
"UnifiedReturnBlock", &F);
PHINode *PN = 0;
"UnifiedReturnBlock", &F);
PHINode *PN = 0;
- if (F.getReturnType() == Type::getVoidTy(F.getContext())) {
+ if (F.getReturnType()->isVoidTy()) {
ReturnInst::Create(F.getContext(), NULL, NewRetBlock);
} else {
// If the function doesn't return void... add a PHI node to the block...
ReturnInst::Create(F.getContext(), NULL, NewRetBlock);
} else {
// If the function doesn't return void... add a PHI node to the block...
// Create the arguments vector, all arguments start out unnamed.
const FunctionType *FT = getFunctionType();
for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i) {
// Create the arguments vector, all arguments start out unnamed.
const FunctionType *FT = getFunctionType();
for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i) {
- assert(FT->getParamType(i) != Type::getVoidTy(FT->getContext()) &&
+ assert(!FT->getParamType(i)->isVoidTy() &&
"Cannot have void typed arguments!");
ArgumentList.push_back(new Argument(FT->getParamType(i)));
}
"Cannot have void typed arguments!");
ArgumentList.push_back(new Argument(FT->getParamType(i)));
}
switch (NumOutputs) {
case 0:
switch (NumOutputs) {
case 0:
- if (Ty->getReturnType() != Type::getVoidTy(Ty->getContext())) return false;
+ if (!Ty->getReturnType()->isVoidTy()) return false;
break;
case 1:
if (isa<StructType>(Ty->getReturnType())) return false;
break;
case 1:
if (isa<StructType>(Ty->getReturnType())) return false;
MCall->setCallingConv(F->getCallingConv());
if (!F->doesNotAlias(0)) F->setDoesNotAlias(0);
}
MCall->setCallingConv(F->getCallingConv());
if (!F->doesNotAlias(0)) F->setDoesNotAlias(0);
}
- assert(MCall->getType() != Type::getVoidTy(BB->getContext()) &&
- "Malloc has void return type");
+ assert(!MCall->getType()->isVoidTy() && "Malloc has void return type");
: UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
getAISize(Ty->getContext(), ArraySize), InsertBefore) {
setAlignment(0);
: UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
getAISize(Ty->getContext(), ArraySize), InsertBefore) {
setAlignment(0);
- assert(Ty != Type::getVoidTy(Ty->getContext()) && "Cannot allocate void!");
+ assert(!Ty->isVoidTy() && "Cannot allocate void!");
: UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
getAISize(Ty->getContext(), ArraySize), InsertAtEnd) {
setAlignment(0);
: UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
getAISize(Ty->getContext(), ArraySize), InsertAtEnd) {
setAlignment(0);
- assert(Ty != Type::getVoidTy(Ty->getContext()) && "Cannot allocate void!");
+ assert(!Ty->isVoidTy() && "Cannot allocate void!");
: UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
getAISize(Ty->getContext(), 0), InsertBefore) {
setAlignment(0);
: UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
getAISize(Ty->getContext(), 0), InsertBefore) {
setAlignment(0);
- assert(Ty != Type::getVoidTy(Ty->getContext()) && "Cannot allocate void!");
+ assert(!Ty->isVoidTy() && "Cannot allocate void!");
: UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
getAISize(Ty->getContext(), 0), InsertAtEnd) {
setAlignment(0);
: UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
getAISize(Ty->getContext(), 0), InsertAtEnd) {
setAlignment(0);
- assert(Ty != Type::getVoidTy(Ty->getContext()) && "Cannot allocate void!");
+ assert(!Ty->isVoidTy() && "Cannot allocate void!");
: UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
getAISize(Ty->getContext(), ArraySize), InsertBefore) {
setAlignment(Align);
: UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
getAISize(Ty->getContext(), ArraySize), InsertBefore) {
setAlignment(Align);
- assert(Ty != Type::getVoidTy(Ty->getContext()) && "Cannot allocate void!");
+ assert(!Ty->isVoidTy() && "Cannot allocate void!");
: UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
getAISize(Ty->getContext(), ArraySize), InsertAtEnd) {
setAlignment(Align);
: UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
getAISize(Ty->getContext(), ArraySize), InsertAtEnd) {
setAlignment(Align);
- assert(Ty != Type::getVoidTy(Ty->getContext()) && "Cannot allocate void!");
+ assert(!Ty->isVoidTy() && "Cannot allocate void!");
SubclassOptionalData(0), SubclassData(0), VTy(checkType(ty)),
UseList(0), Name(0) {
if (isa<CallInst>(this) || isa<InvokeInst>(this))
SubclassOptionalData(0), SubclassData(0), VTy(checkType(ty)),
UseList(0), Name(0) {
if (isa<CallInst>(this) || isa<InvokeInst>(this))
- assert((VTy->isFirstClassType() ||
- VTy == Type::getVoidTy(ty->getContext()) ||
+ assert((VTy->isFirstClassType() || VTy->isVoidTy() ||
isa<OpaqueType>(ty) || VTy->getTypeID() == Type::StructTyID) &&
"invalid CallInst type!");
else if (!isa<Constant>(this) && !isa<BasicBlock>(this))
isa<OpaqueType>(ty) || VTy->getTypeID() == Type::StructTyID) &&
"invalid CallInst type!");
else if (!isa<Constant>(this) && !isa<BasicBlock>(this))
- assert((VTy->isFirstClassType() ||
- VTy == Type::getVoidTy(ty->getContext()) ||
- isa<OpaqueType>(ty)) &&
+ assert((VTy->isFirstClassType() || VTy->isVoidTy() ||
+ isa<OpaqueType>(ty)) &&
"Cannot create non-first-class values except for constants!");
}
"Cannot create non-first-class values except for constants!");
}
if (getName() == StringRef(NameStr, NameLen))
return;
if (getName() == StringRef(NameStr, NameLen))
return;
- assert(getType() != Type::getVoidTy(getContext()) &&
- "Cannot assign a name to void values!");
+ assert(!getType()->isVoidTy() && "Cannot assign a name to void values!");
// Get the symbol table to update for this object.
ValueSymbolTable *ST;
// Get the symbol table to update for this object.
ValueSymbolTable *ST;