"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:
Nico Weber
2012-10-13 22:30:41 +00:00
parent cc51c2f2dc
commit 636fc09960
2 changed files with 16 additions and 0 deletions

View File

@@ -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

View 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());
};