rnk updated this revision to Diff 196553. rnk added a comment. Herald added a project: clang.
- rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55229/new/ https://reviews.llvm.org/D55229 Files: clang/lib/CodeGen/CodeGenModule.cpp clang/test/CodeGen/ms-symbol-linkage.cpp clang/test/CodeGenCXX/runtime-dllstorage.cpp clang/test/CodeGenObjC/gnu-init.m clang/test/CodeGenObjCXX/msabi-stret.mm Index: clang/test/CodeGenObjCXX/msabi-stret.mm =================================================================== --- clang/test/CodeGenObjCXX/msabi-stret.mm +++ clang/test/CodeGenObjCXX/msabi-stret.mm @@ -13,6 +13,5 @@ return [I m:S()]; } -// CHECK: declare dllimport void @objc_msgSend_stret(i8*, i8*, ...) +// CHECK: declare dso_local void @objc_msgSend_stret(i8*, i8*, ...) // CHECK-NOT: declare dllimport void @objc_msgSend(i8*, i8*, ...) - Index: clang/test/CodeGenObjC/gnu-init.m =================================================================== --- clang/test/CodeGenObjC/gnu-init.m +++ clang/test/CodeGenObjC/gnu-init.m @@ -100,6 +100,6 @@ // Check our load function is in a comdat. // CHECK-WIN: define linkonce_odr hidden void @.objcv2_load_function() comdat { -// Make sure we have dllimport on the load function -// CHECK-WIN: declare dllimport void @__objc_load +// Make sure we do not have dllimport on the load function +// CHECK-WIN: declare dso_local void @__objc_load Index: clang/test/CodeGenCXX/runtime-dllstorage.cpp =================================================================== --- clang/test/CodeGenCXX/runtime-dllstorage.cpp +++ clang/test/CodeGenCXX/runtime-dllstorage.cpp @@ -108,7 +108,7 @@ // CHECK-MS-DAG: @_Init_thread_epoch = external thread_local global i32 // CHECK-MS-DAG: declare dso_local i32 @__tlregdtor(void ()*) // CHECK-MS-DAG: declare dso_local i32 @atexit(void ()*) -// CHECK-MS-DYNAMIC-DAG: declare dllimport {{.*}} void @_CxxThrowException +// CHECK-MS-DYNAMIC-DAG: declare {{.*}} void @_CxxThrowException // CHECK-MS-STATIC-DAG: declare {{.*}} void @_CxxThrowException // CHECK-MS-DAG: declare dso_local noalias i8* @"??2@YAPAXI@Z" // CHECK-MS-DAG: declare dso_local void @_Init_thread_header(i32*) Index: clang/test/CodeGen/ms-symbol-linkage.cpp =================================================================== --- /dev/null +++ clang/test/CodeGen/ms-symbol-linkage.cpp @@ -0,0 +1,20 @@ +// RUN: %clangxx -target aarch64-windows \ +// RUN: -fcxx-exceptions -c -o - %s \ +// RUN: | llvm-objdump -syms - 2>&1 | FileCheck %s + +void foo1() { throw 1; } +// CHECK-LABEL: foo1 +// CHECK-NOT: __imp__CxxThrowException + +void bar(); +void foo2() noexcept(true) { bar(); } +// CHECK-LABEL: foo2 +// CHECK-NOT: __imp___std_terminate + +struct A {}; +struct B { virtual void f(); }; +struct C : A, virtual B {}; +struct T {}; +T *foo3() { return dynamic_cast<T *>((C *)0); } +// CHECK-LABEL: foo3 +// CHECK-NOT: __imp___RTDynamicCast Index: clang/lib/CodeGen/CodeGenModule.cpp =================================================================== --- clang/lib/CodeGen/CodeGenModule.cpp +++ clang/lib/CodeGen/CodeGenModule.cpp @@ -3002,7 +3002,8 @@ if (!Local && getTriple().isOSBinFormatCOFF() && !getCodeGenOpts().LTOVisibilityPublicStd && - !getTriple().isWindowsGNUEnvironment()) { + !getTriple().isWindowsGNUEnvironment() && + !getTriple().isWindowsMSVCEnvironment()) { const FunctionDecl *FD = GetRuntimeFunctionDecl(Context, Name); if (!FD || FD->hasAttr<DLLImportAttr>()) { F->setDLLStorageClass(llvm::GlobalValue::DLLImportStorageClass);
Index: clang/test/CodeGenObjCXX/msabi-stret.mm =================================================================== --- clang/test/CodeGenObjCXX/msabi-stret.mm +++ clang/test/CodeGenObjCXX/msabi-stret.mm @@ -13,6 +13,5 @@ return [I m:S()]; } -// CHECK: declare dllimport void @objc_msgSend_stret(i8*, i8*, ...) +// CHECK: declare dso_local void @objc_msgSend_stret(i8*, i8*, ...) // CHECK-NOT: declare dllimport void @objc_msgSend(i8*, i8*, ...) - Index: clang/test/CodeGenObjC/gnu-init.m =================================================================== --- clang/test/CodeGenObjC/gnu-init.m +++ clang/test/CodeGenObjC/gnu-init.m @@ -100,6 +100,6 @@ // Check our load function is in a comdat. // CHECK-WIN: define linkonce_odr hidden void @.objcv2_load_function() comdat { -// Make sure we have dllimport on the load function -// CHECK-WIN: declare dllimport void @__objc_load +// Make sure we do not have dllimport on the load function +// CHECK-WIN: declare dso_local void @__objc_load Index: clang/test/CodeGenCXX/runtime-dllstorage.cpp =================================================================== --- clang/test/CodeGenCXX/runtime-dllstorage.cpp +++ clang/test/CodeGenCXX/runtime-dllstorage.cpp @@ -108,7 +108,7 @@ // CHECK-MS-DAG: @_Init_thread_epoch = external thread_local global i32 // CHECK-MS-DAG: declare dso_local i32 @__tlregdtor(void ()*) // CHECK-MS-DAG: declare dso_local i32 @atexit(void ()*) -// CHECK-MS-DYNAMIC-DAG: declare dllimport {{.*}} void @_CxxThrowException +// CHECK-MS-DYNAMIC-DAG: declare {{.*}} void @_CxxThrowException // CHECK-MS-STATIC-DAG: declare {{.*}} void @_CxxThrowException // CHECK-MS-DAG: declare dso_local noalias i8* @"??2@YAPAXI@Z" // CHECK-MS-DAG: declare dso_local void @_Init_thread_header(i32*) Index: clang/test/CodeGen/ms-symbol-linkage.cpp =================================================================== --- /dev/null +++ clang/test/CodeGen/ms-symbol-linkage.cpp @@ -0,0 +1,20 @@ +// RUN: %clangxx -target aarch64-windows \ +// RUN: -fcxx-exceptions -c -o - %s \ +// RUN: | llvm-objdump -syms - 2>&1 | FileCheck %s + +void foo1() { throw 1; } +// CHECK-LABEL: foo1 +// CHECK-NOT: __imp__CxxThrowException + +void bar(); +void foo2() noexcept(true) { bar(); } +// CHECK-LABEL: foo2 +// CHECK-NOT: __imp___std_terminate + +struct A {}; +struct B { virtual void f(); }; +struct C : A, virtual B {}; +struct T {}; +T *foo3() { return dynamic_cast<T *>((C *)0); } +// CHECK-LABEL: foo3 +// CHECK-NOT: __imp___RTDynamicCast Index: clang/lib/CodeGen/CodeGenModule.cpp =================================================================== --- clang/lib/CodeGen/CodeGenModule.cpp +++ clang/lib/CodeGen/CodeGenModule.cpp @@ -3002,7 +3002,8 @@ if (!Local && getTriple().isOSBinFormatCOFF() && !getCodeGenOpts().LTOVisibilityPublicStd && - !getTriple().isWindowsGNUEnvironment()) { + !getTriple().isWindowsGNUEnvironment() && + !getTriple().isWindowsMSVCEnvironment()) { const FunctionDecl *FD = GetRuntimeFunctionDecl(Context, Name); if (!FD || FD->hasAttr<DLLImportAttr>()) { F->setDLLStorageClass(llvm::GlobalValue::DLLImportStorageClass);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits