[llvm] r254878 - Create llvm.global_ctors in the new format.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 6 08:18:25 PST 2015
Author: rafael
Date: Sun Dec 6 10:18:25 2015
New Revision: 254878
URL: http://llvm.org/viewvc/llvm-project?rev=254878&view=rev
Log:
Create llvm.global_ctors in the new format.
Modified:
llvm/trunk/lib/Transforms/Utils/ModuleUtils.cpp
llvm/trunk/test/Instrumentation/SanitizerCoverage/coverage.ll
Modified: llvm/trunk/lib/Transforms/Utils/ModuleUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ModuleUtils.cpp?rev=254878&r1=254877&r2=254878&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/ModuleUtils.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/ModuleUtils.cpp Sun Dec 6 10:18:25 2015
@@ -43,9 +43,9 @@ static void appendToGlobalArray(const ch
}
GVCtor->eraseFromParent();
} else {
- // Use a simple two-field struct if there isn't one already.
+ // Use the new three-field struct if there isn't one already.
EltTy = StructType::get(IRB.getInt32Ty(), PointerType::getUnqual(FnTy),
- nullptr);
+ IRB.getInt8PtrTy(), nullptr);
}
// Build a 2 or 3 field global_ctor entry. We don't take a comdat key.
Modified: llvm/trunk/test/Instrumentation/SanitizerCoverage/coverage.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Instrumentation/SanitizerCoverage/coverage.ll?rev=254878&r1=254877&r2=254878&view=diff
==============================================================================
--- llvm/trunk/test/Instrumentation/SanitizerCoverage/coverage.ll (original)
+++ llvm/trunk/test/Instrumentation/SanitizerCoverage/coverage.ll Sun Dec 6 10:18:25 2015
@@ -29,8 +29,8 @@ entry:
}
; CHECK0-NOT: @llvm.global_ctors = {{.*}}{ i32 2, void ()* @sancov.module_ctor }
-; CHECK1: @llvm.global_ctors = {{.*}}{ i32 2, void ()* @sancov.module_ctor }
-; CHECK2: @llvm.global_ctors = {{.*}}{ i32 2, void ()* @sancov.module_ctor }
+; CHECK1: @llvm.global_ctors = {{.*}}{ i32 2, void ()* @sancov.module_ctor, i8* null }
+; CHECK2: @llvm.global_ctors = {{.*}}{ i32 2, void ()* @sancov.module_ctor, i8* null }
; CHECK0-NOT: call void @__sanitizer_cov(
; CHECK0-NOT: call void @__sanitizer_cov_module_init(
More information about the llvm-commits
mailing list