Skip to content

Commit 6c548d8

Browse files
committed
---
yaml --- r: 225065 b: refs/heads/stable c: 40570eb h: refs/heads/master i: 225063: 27ffb30 v: v3
1 parent b759ba9 commit 6c548d8

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
@@ -29,6 +29,6 @@ refs/heads/tmp: e5d90d98402475b6e154ce216f9efcb80da1a747
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: 1fe32ca12c51afcd761d9962f51a74ff0d07a591
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 2d5e5777fd94fcad0bf259e31982477e42bd5bf8
32+
refs/heads/stable: 40570eb49eb1cb688637cb58d14cdb9664ea1039
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b

branches/stable/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/stable/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)