Skip to content

Commit 3554b1b

Browse files
committed
---
yaml --- r: 208714 b: refs/heads/snap-stage3 c: 40570eb h: refs/heads/master v: v3
1 parent e1d775f commit 3554b1b

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 38a97becdf3e6a6157f6f7ec2d98ade8d8edc193
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 2d5e5777fd94fcad0bf259e31982477e42bd5bf8
4+
refs/heads/snap-stage3: 40570eb49eb1cb688637cb58d14cdb9664ea1039
55
refs/heads/try: 7b4ef47b7805a402d756fb8157101f64880a522f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/librustc_llvm/lib.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ pub use self::CallConv::*;
5555
pub use self::Visibility::*;
5656
pub use self::DiagnosticSeverity::*;
5757
pub use self::Linkage::*;
58+
pub use self::DLLStorageClassTypes::*;
5859

5960
use std::ffi::CString;
6061
use std::cell::RefCell;
@@ -123,6 +124,15 @@ pub enum DiagnosticSeverity {
123124
Note,
124125
}
125126

127+
128+
#[repr(C)]
129+
#[derive(Copy, Clone)]
130+
pub enum DLLStorageClassTypes {
131+
DefaultStorageClass = 0,
132+
DLLImportStorageClass = 1,
133+
DLLExportStorageClass = 2,
134+
}
135+
126136
bitflags! {
127137
flags Attribute : u32 {
128138
const ZExt = 1 << 0,
@@ -2075,7 +2085,8 @@ extern {
20752085
pub fn LLVMRustArchiveIteratorFree(AIR: ArchiveIteratorRef);
20762086
pub fn LLVMRustDestroyArchive(AR: ArchiveRef);
20772087

2078-
pub fn LLVMRustSetDLLExportStorageClass(V: ValueRef);
2088+
pub fn LLVMRustSetDLLStorageClass(V: ValueRef,
2089+
C: DLLStorageClassTypes);
20792090

20802091
pub fn LLVMRustGetSectionName(SI: SectionIteratorRef,
20812092
data: *mut *const c_char) -> c_int;
@@ -2125,6 +2136,12 @@ pub fn SetLinkage(global: ValueRef, link: Linkage) {
21252136
}
21262137
}
21272138

2139+
pub fn SetDLLStorageClass(global: ValueRef, class: DLLStorageClassTypes) {
2140+
unsafe {
2141+
LLVMRustSetDLLStorageClass(global, class);
2142+
}
2143+
}
2144+
21282145
pub fn SetUnnamedAddr(global: ValueRef, unnamed: bool) {
21292146
unsafe {
21302147
LLVMSetUnnamedAddr(global, unnamed as Bool);

branches/snap-stage3/src/rustllvm/RustWrapper.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,9 +837,10 @@ LLVMRustArchiveChildData(Archive::Child *child, size_t *size) {
837837
}
838838

839839
extern "C" void
840-
LLVMRustSetDLLExportStorageClass(LLVMValueRef Value) {
840+
LLVMRustSetDLLStorageClass(LLVMValueRef Value,
841+
GlobalValue::DLLStorageClassTypes Class) {
841842
GlobalValue *V = unwrap<GlobalValue>(Value);
842-
V->setDLLStorageClass(GlobalValue::DLLExportStorageClass);
843+
V->setDLLStorageClass(Class);
843844
}
844845

845846
// Note that the two following functions look quite similar to the

0 commit comments

Comments
 (0)