diff options
author | Eric Christopher <echristo@gmail.com> | 2013-08-07 01:18:24 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-08-07 01:18:24 +0000 |
commit | 028f3478a510ef0855abc891237882b3c6123671 (patch) | |
tree | a57a24357b080e003524cf951b7a08d23bd02c7a /lib/CodeGen | |
parent | 31a4f1f1ea393d02f690c34afada455c1bd0a1b7 (diff) | |
download | external_llvm-028f3478a510ef0855abc891237882b3c6123671.zip external_llvm-028f3478a510ef0855abc891237882b3c6123671.tar.gz external_llvm-028f3478a510ef0855abc891237882b3c6123671.tar.bz2 |
Move somewhat messy conditional out of line.
No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187843 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 1b9105d..859805c 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1092,6 +1092,14 @@ static bool isContainedInAnonNamespace(DIE *Die) { return false; } +/// Test if the current CU language is C++ and that we have +/// a named type that is not contained in an anonymous namespace. +static bool shouldAddODRHash(CompileUnit *CU, DIE *Die) { + return (CU->getLanguage() == dwarf::DW_LANG_C_plus_plus && + getDIEStringAttr(Die, dwarf::DW_AT_name) != "" && + !isContainedInAnonNamespace(Die)); +} + void DwarfDebug::finalizeModuleInfo() { // Collect info for variables that were optimized out. collectDeadVariables(); @@ -1113,13 +1121,9 @@ void DwarfDebug::finalizeModuleInfo() { for (unsigned i = 0, e = TypeUnits.size(); i != e; ++i) { MD5 Hash; DIE *Die = TypeUnits[i]; - // If we've requested ODR hashes, the current language is C++, the type is - // named, and the type isn't located inside a C++ anonymous namespace then - // add the ODR signature attribute now. - if (GenerateODRHash && - CUMap.begin()->second->getLanguage() == dwarf::DW_LANG_C_plus_plus && - (getDIEStringAttr(Die, dwarf::DW_AT_name) != "") && - !isContainedInAnonNamespace(Die)) + // If we've requested ODR hashes and it's applicable for an ODR hash then + // add the ODR signature now. + if (GenerateODRHash && shouldAddODRHash(CUMap.begin()->second, Die)) addDIEODRSignature(Hash, CUMap.begin()->second, Die); } |