forked from OSchip/llvm-project
Since we miscompile many cases when declaring a variable with a reference type, make them unsupported for now.
llvm-svn: 72034
This commit is contained in:
parent
8dd2947696
commit
9b02760923
|
@ -126,6 +126,11 @@ void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D) {
|
|||
if (D.getType()->isVariablyModifiedType())
|
||||
EmitVLASize(D.getType());
|
||||
|
||||
if (D.getType()->isReferenceType()) {
|
||||
CGM.ErrorUnsupported(&D, "static declaration with reference type");
|
||||
return;
|
||||
}
|
||||
|
||||
if (D.getInit()) {
|
||||
llvm::Constant *Init = CGM.EmitConstantExpr(D.getInit(), D.getType(), this);
|
||||
|
||||
|
@ -324,6 +329,11 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) {
|
|||
DI->EmitDeclareOfAutoVariable(&D, DeclPtr, Builder);
|
||||
}
|
||||
|
||||
if (D.getType()->isReferenceType()) {
|
||||
CGM.ErrorUnsupported(&D, "declaration with reference type");
|
||||
return;
|
||||
}
|
||||
|
||||
// If this local has an initializer, emit it now.
|
||||
if (const Expr *Init = D.getInit()) {
|
||||
llvm::Value *Loc = DeclPtr;
|
||||
|
|
Loading…
Reference in New Issue