mirror of
https://github.com/intel/llvm.git
synced 2026-01-23 07:58:23 +08:00
"Implement" codegen support for __noop().
Eli discovered that __noop's sema behavior also needs some love. I filed PR14081 for that and intend to improve it. llvm-svn: 165886
This commit is contained in:
@@ -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
|
||||
|
||||
14
clang/test/CodeGen/builtin-ms-noop.cpp
Normal file
14
clang/test/CodeGen/builtin-ms-noop.cpp
Normal file
@@ -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());
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user