Skip to content

Commit a488e09

Browse files
author
Elliott Slaughter
committed
---
yaml --- r: 31422 b: refs/heads/dist-snap c: 987814f h: refs/heads/master v: v3
1 parent 47688c6 commit a488e09

File tree

6 files changed

+17
-2
lines changed

6 files changed

+17
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 0b3dba42cf62419518137ec17ce7630f0174f26c
10+
refs/heads/dist-snap: 987814f11e4614b8aa712eb19cff78fbbe0d34fa
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/rustc/driver/driver.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import io::{reader_util, writer_util};
1414
import getopts::{optopt, optmulti, optflag, optflagopt, opt_present};
1515
import back::{x86, x86_64};
1616
import std::map::hashmap;
17+
import lib::llvm::llvm;
1718

1819
enum pp_mode {ppm_normal, ppm_expanded, ppm_typed, ppm_identified,
1920
ppm_expanded_identified }
@@ -440,6 +441,9 @@ fn build_session_options(match: getopts::match,
440441
}
441442
debugging_opts |= this_bit;
442443
}
444+
if debugging_opts & session::debug_llvm != 0 {
445+
llvm::LLVMSetDebug(1);
446+
}
443447

444448
let output_type =
445449
if parse_only || no_trans {

branches/dist-snap/src/rustc/driver/session.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const borrowck_stats: uint = 1024u;
4040
const borrowck_note_pure: uint = 2048;
4141
const borrowck_note_loan: uint = 4096;
4242
const no_landing_pads: uint = 8192;
43+
const debug_llvm: uint = 16384;
4344

4445
fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
4546
~[(~"ppregions", ~"prettyprint regions with \
@@ -61,7 +62,8 @@ fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
6162
(~"borrowck-note-loan", ~"note where loans are req'd",
6263
borrowck_note_loan),
6364
(~"no-landing-pads", ~"omit landing pads for unwinding",
64-
no_landing_pads)
65+
no_landing_pads),
66+
(~"debug-llvm", ~"enable debug output from LLVM", debug_llvm)
6567
]
6668
}
6769

branches/dist-snap/src/rustc/lib/llvm.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,9 @@ extern mod llvm {
969969

970970
fn LLVMConstNamedStruct(S: TypeRef, ConstantVals: *ValueRef,
971971
Count: c_uint) -> ValueRef;
972+
973+
/** Enables LLVM debug output. */
974+
fn LLVMSetDebug(Enabled: c_int);
972975
}
973976

974977
fn SetInstructionCallConv(Instr: ValueRef, CC: CallConv) {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "llvm/Support/SourceMgr.h"
2828
#include "llvm/Target/TargetOptions.h"
2929
#include "llvm/Support/Host.h"
30+
#include "llvm/Support/Debug.h"
3031
#include "llvm-c/Core.h"
3132
#include "llvm-c/BitReader.h"
3233
#include "llvm-c/Object.h"
@@ -185,3 +186,7 @@ extern "C" LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,
185186
unwrap(target), unwrap(source),
186187
order));
187188
}
189+
190+
extern "C" void LLVMSetDebug(int Enabled) {
191+
DebugFlag = Enabled;
192+
}

branches/dist-snap/src/rustllvm/rustllvm.def.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ LLVMSetAlignment
528528
LLVMSetCleanup
529529
LLVMSetCurrentDebugLocation
530530
LLVMSetDataLayout
531+
LLVMSetDebug
531532
LLVMSetFunctionCallConv
532533
LLVMSetGC
533534
LLVMSetGlobalConstant

0 commit comments

Comments
 (0)