aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2011-09-23 05:06:16 +0000
committerDavid Blaikie <dblaikie@gmail.com>2011-09-23 05:06:16 +0000
commitb219cfc4d75f0a03630b7c4509ef791b7e97b2c8 (patch)
tree2b708dc00bedcc6a6204d29c915ac7fce8fb028f /lib/CodeGen/CGDecl.cpp
parentc535d9730e11ca335790359bfbd4600be71c5410 (diff)
Switch assert(0/false) llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r--lib/CodeGen/CGDecl.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 46f3f6b177..b43ef4e5db 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -72,7 +72,7 @@ void CodeGenFunction::EmitDecl(const Decl &D) {
case Decl::FriendTemplate:
case Decl::Block:
case Decl::ClassScopeFunctionSpecialization:
- assert(0 && "Declaration should not be in declstmts!");
+ llvm_unreachable("Declaration should not be in declstmts!");
case Decl::Function: // void X();
case Decl::Record: // struct/union/class X;
case Decl::Enum: // enum X;
@@ -136,7 +136,7 @@ void CodeGenFunction::EmitVarDecl(const VarDecl &D) {
return CGM.getOpenCLRuntime().EmitWorkGroupLocalVarDecl(*this, D);
}
- assert(0 && "Unknown storage class");
+ llvm_unreachable("Unknown storage class");
}
static std::string GetStaticDeclName(CodeGenFunction &CGF, const VarDecl &D,
@@ -158,14 +158,14 @@ static std::string GetStaticDeclName(CodeGenFunction &CGF, const VarDecl &D,
ContextName = Name.getString();
}
else
- assert(0 && "Unknown context for block static var decl");
+ llvm_unreachable("Unknown context for block static var decl");
} else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(CGF.CurFuncDecl)) {
StringRef Name = CGM.getMangledName(FD);
ContextName = Name.str();
} else if (isa<ObjCMethodDecl>(CGF.CurFuncDecl))
ContextName = CGF.CurFn->getName();
else
- assert(0 && "Unknown context for static var decl");
+ llvm_unreachable("Unknown context for static var decl");
return ContextName + Separator + D.getNameAsString();
}