зеркало из https://github.com/microsoft/clang-1.git
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:
Родитель
90742c1318
Коммит
c9875bfa6f
|
@ -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");
|
||||||
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче