diff options
| -rw-r--r-- | clang/lib/CodeGen/CGBuiltin.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index e70ade3869b..38707122a5f 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -1600,8 +1600,14 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, const char *Name = getContext().BuiltinInfo.GetName(BuiltinID); Intrinsic::ID IntrinsicID = Intrinsic::not_intrinsic; if (const char *Prefix = - llvm::Triple::getArchTypePrefix(getTarget().getTriple().getArch())) + llvm::Triple::getArchTypePrefix(getTarget().getTriple().getArch())) { IntrinsicID = Intrinsic::getIntrinsicForGCCBuiltin(Prefix, Name); + // NOTE we dont need to perform a compatibility flag check here since the + // intrinsics are declared in Builtins*.def via LANGBUILTIN which filter the + // MS builtins via ALL_MS_LANGUAGES and are filtered earlier. + if (IntrinsicID == Intrinsic::not_intrinsic) + IntrinsicID = Intrinsic::getIntrinsicForMSBuiltin(Prefix, Name); + } if (IntrinsicID != Intrinsic::not_intrinsic) { SmallVector<Value*, 16> Args; |

