diff options
| author | bors <bors@rust-lang.org> | 2017-02-09 17:09:50 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-02-09 17:09:50 +0000 |
| commit | 405327635419e22a956dfe8f7caf4817c8ae5e93 (patch) | |
| tree | ff15270c6e603dc05e997510737a9c8ac488cc6c /src/rustllvm/RustWrapper.cpp | |
| parent | e7fc53b8f0595d9b5be6a3b64d29d3cfed7c7199 (diff) | |
| parent | b037c5211b9ba496252af5a0369b48649f91ccc8 (diff) | |
| download | rust-405327635419e22a956dfe8f7caf4817c8ae5e93.tar.gz rust-405327635419e22a956dfe8f7caf4817c8ae5e93.zip | |
Auto merge of #38109 - tromey:main-subprogram, r=michaelwoerister
Emit DW_AT_main_subprogram This changes rustc to emit DW_AT_main_subprogram on the "main" program. This lets gdb suitably stop at the user's main in response to "start" (rather than the library's main, which is what happens currently). Fixes #32620 r? michaelwoerister
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
| -rw-r--r-- | src/rustllvm/RustWrapper.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp index f3b52b71b99..27233a8b075 100644 --- a/src/rustllvm/RustWrapper.cpp +++ b/src/rustllvm/RustWrapper.cpp @@ -352,6 +352,7 @@ enum class LLVMRustDIFlags : uint32_t { FlagStaticMember = (1 << 12), FlagLValueReference = (1 << 13), FlagRValueReference = (1 << 14), + FlagMainSubprogram = (1 << 21), // Do not add values that are not supported by the minimum LLVM // version we support! }; @@ -438,6 +439,11 @@ static unsigned fromRust(LLVMRustDIFlags Flags) { if (isSet(Flags & LLVMRustDIFlags::FlagRValueReference)) { Result |= DINode::DIFlags::FlagRValueReference; } +#if LLVM_RUSTLLVM || LLVM_VERSION_GE(4, 0) + if (isSet(Flags & LLVMRustDIFlags::FlagMainSubprogram)) { + Result |= DINode::DIFlags::FlagMainSubprogram; + } +#endif return Result; } |
