diff options
| author | Alexey Samsonov <samsonov@google.com> | 2014-05-15 21:24:32 +0000 |
|---|---|---|
| committer | Alexey Samsonov <samsonov@google.com> | 2014-05-15 21:24:32 +0000 |
| commit | dce67348a8fd518d9f605f7a137059065f13ed77 (patch) | |
| tree | cc2522db0bfca588c908429e186fef57250550d3 /llvm/tools/llvm-symbolizer | |
| parent | 900d46ff39de8a4d28cbcbcd864a650f778c5214 (diff) | |
| download | bcm5719-llvm-dce67348a8fd518d9f605f7a137059065f13ed77.tar.gz bcm5719-llvm-dce67348a8fd518d9f605f7a137059065f13ed77.zip | |
[DWARF parser] Use enums instead of bitfields in DILineInfoSpecifier.
It is more appropriate than the current situation, when one flag
(AbsoluteFilePath) is relevant only if another flag is set.
This refactoring would also simplify fetching the short function name
(stored in DW_AT_name) instead of a linkage name returned currently.
No functionality change.
llvm-svn: 208921
Diffstat (limited to 'llvm/tools/llvm-symbolizer')
| -rw-r--r-- | llvm/tools/llvm-symbolizer/LLVMSymbolize.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/tools/llvm-symbolizer/LLVMSymbolize.cpp b/llvm/tools/llvm-symbolizer/LLVMSymbolize.cpp index 4a9bbe5e822..7018ebed731 100644 --- a/llvm/tools/llvm-symbolizer/LLVMSymbolize.cpp +++ b/llvm/tools/llvm-symbolizer/LLVMSymbolize.cpp @@ -35,13 +35,12 @@ static bool error(error_code ec) { return true; } -static uint32_t -getDILineInfoSpecifierFlags(const LLVMSymbolizer::Options &Opts) { - uint32_t Flags = llvm::DILineInfoSpecifier::FileLineInfo | - llvm::DILineInfoSpecifier::AbsoluteFilePath; - if (Opts.PrintFunctions) - Flags |= llvm::DILineInfoSpecifier::FunctionName; - return Flags; +static DILineInfoSpecifier +getDILineInfoSpecifier(const LLVMSymbolizer::Options &Opts) { + return DILineInfoSpecifier( + DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, + Opts.PrintFunctions ? DILineInfoSpecifier::FunctionNameKind::LinkageName + : DILineInfoSpecifier::FunctionNameKind::None); } ModuleInfo::ModuleInfo(ObjectFile *Obj, DIContext *DICtx) @@ -115,7 +114,7 @@ DILineInfo ModuleInfo::symbolizeCode( DILineInfo LineInfo; if (DebugInfoContext) { LineInfo = DebugInfoContext->getLineInfoForAddress( - ModuleOffset, getDILineInfoSpecifierFlags(Opts)); + ModuleOffset, getDILineInfoSpecifier(Opts)); } // Override function name from symbol table if necessary. if (Opts.PrintFunctions && Opts.UseSymbolTable) { @@ -134,7 +133,7 @@ DIInliningInfo ModuleInfo::symbolizeInlinedCode( DIInliningInfo InlinedContext; if (DebugInfoContext) { InlinedContext = DebugInfoContext->getInliningInfoForAddress( - ModuleOffset, getDILineInfoSpecifierFlags(Opts)); + ModuleOffset, getDILineInfoSpecifier(Opts)); } // Make sure there is at least one frame in context. if (InlinedContext.getNumberOfFrames() == 0) { |

