Don't complain about falling off the end of a function with an asm

block, if the function is supposed to return a value as we don't know
exactly what the asm code does.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91073 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mike Stump 2009-12-10 22:57:48 +00:00
Родитель 90742c1318
Коммит c9875bfa6f
2 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -1253,6 +1253,11 @@ Sema::ControlFlowKind Sema::CheckFallThrough(Stmt *Root) {
HasFakeEdge = true; HasFakeEdge = true;
continue; continue;
} }
if (isa<AsmStmt>(S)) {
HasFakeEdge = true;
HasLiveReturn = true;
continue;
}
bool NoReturnEdge = false; bool NoReturnEdge = false;
if (CallExpr *C = dyn_cast<CallExpr>(S)) { if (CallExpr *C = dyn_cast<CallExpr>(S)) {
Expr *CEE = C->getCallee()->IgnoreParenCasts(); Expr *CEE = C->getCallee()->IgnoreParenCasts();

Просмотреть файл

@ -222,3 +222,7 @@ void test32() {
void test33() { void test33() {
if (j) while (1) { } if (j) while (1) { }
} }
int test34() {
asm("nop");
}