Avoid generation of dead code in a few more situations.
- Emit variable declarations as "simple", we want to avoid forcing the creation of a dummy basic block, but still need to make the variable available for later use. - With that, we can now skip IRgen for other unreachable statements (which don't define a label). - Anders, I added two fixmes on calls to EmitVLASize, can you check them? llvm-svn: 76361
This commit is contained in:
@@ -450,19 +450,19 @@ void CodeGenFunction::EmitIndirectSwitches() {
|
||||
}
|
||||
}
|
||||
|
||||
llvm::Value *CodeGenFunction::GetVLASize(const VariableArrayType *VAT)
|
||||
{
|
||||
llvm::Value *CodeGenFunction::GetVLASize(const VariableArrayType *VAT) {
|
||||
llvm::Value *&SizeEntry = VLASizeMap[VAT];
|
||||
|
||||
assert(SizeEntry && "Did not emit size for type");
|
||||
return SizeEntry;
|
||||
}
|
||||
|
||||
llvm::Value *CodeGenFunction::EmitVLASize(QualType Ty)
|
||||
{
|
||||
llvm::Value *CodeGenFunction::EmitVLASize(QualType Ty) {
|
||||
assert(Ty->isVariablyModifiedType() &&
|
||||
"Must pass variably modified type to EmitVLASizes!");
|
||||
|
||||
EnsureInsertPoint();
|
||||
|
||||
if (const VariableArrayType *VAT = getContext().getAsVariableArrayType(Ty)) {
|
||||
llvm::Value *&SizeEntry = VLASizeMap[VAT];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user