Skip to content

Commit b82536a

Browse files
committed
---
yaml --- r: 214529 b: refs/heads/beta c: 40570eb h: refs/heads/master i: 214527: ce914f8 v: v3
1 parent 68af05d commit b82536a

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
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 2d5e5777fd94fcad0bf259e31982477e42bd5bf8
26+
refs/heads/beta: 40570eb49eb1cb688637cb58d14cdb9664ea1039
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 8c0aa6d64ebab528f7eb182812007155d6044972
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

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