diff options
| -rw-r--r-- | clang/lib/CodeGen/CGBuiltin.cpp | 2 | ||||
| -rw-r--r-- | clang/test/CodeGen/builtin-ms-noop.cpp | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index cf124caec19..ad36b1c78e9 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -1321,6 +1321,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, llvm::StringRef Str = cast<StringLiteral>(AnnotationStrExpr)->getString(); return RValue::get(EmitAnnotationCall(F, AnnVal, Str, E->getExprLoc())); } + case Builtin::BI__noop: + return RValue::get(0); } // If this is an alias for a lib function (e.g. __builtin_sin), emit diff --git a/clang/test/CodeGen/builtin-ms-noop.cpp b/clang/test/CodeGen/builtin-ms-noop.cpp new file mode 100644 index 00000000000..42c25016b13 --- /dev/null +++ b/clang/test/CodeGen/builtin-ms-noop.cpp @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -triple i686-pc-win32 -emit-llvm %s -o - | FileCheck %s + +class A { + public: + ~A() {} +}; + +void f() { +// CHECK: @_Z1fv +// CHECK-NOT: call void @_ZN1AD1Ev +// CHECK: ret void + __noop(A()); +}; + |

