diff options
| author | Nicola Zaghen <nicola.zaghen@imgtec.com> | 2018-05-15 13:36:20 +0000 |
|---|---|---|
| committer | Nicola Zaghen <nicola.zaghen@imgtec.com> | 2018-05-15 13:36:20 +0000 |
| commit | e7245b429b942946ed3cb8f422b22e3de6d00a3c (patch) | |
| tree | 742ccba1753aa082ed42138d043a0b70baec8ddb /lld/lib | |
| parent | 3538b39ed55e8bcce9a15f6144d605b6843c1cd0 (diff) | |
| download | bcm5719-llvm-e7245b429b942946ed3cb8f422b22e3de6d00a3c.tar.gz bcm5719-llvm-e7245b429b942946ed3cb8f422b22e3de6d00a3c.zip | |
[lld] Update uses of DEBUG macro to LLVM_DEBUG.
The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM
Differential Revision: https://reviews.llvm.org/D44977
llvm-svn: 332351
Diffstat (limited to 'lld/lib')
| -rw-r--r-- | lld/lib/Driver/DarwinLdDriver.cpp | 2 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp | 43 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/LayoutPass.cpp | 31 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp | 4 |
4 files changed, 42 insertions, 38 deletions
diff --git a/lld/lib/Driver/DarwinLdDriver.cpp b/lld/lib/Driver/DarwinLdDriver.cpp index a019e9c3280..e016a3dfee1 100644 --- a/lld/lib/Driver/DarwinLdDriver.cpp +++ b/lld/lib/Driver/DarwinLdDriver.cpp @@ -1068,7 +1068,7 @@ bool parse(llvm::ArrayRef<const char *> args, MachOLinkingContext &ctx, } // Parse the LLVM options before we process files in case the file handling - // makes use of things like DEBUG(). + // makes use of things like LLVM_DEBUG(). parseLLVMOptions(ctx); // Handle input files and sectcreate. diff --git a/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp b/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp index 1e210409237..fa0aaa103ee 100644 --- a/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp +++ b/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp @@ -282,7 +282,7 @@ public: private: llvm::Error perform(SimpleFile &mergedFile) override { - DEBUG(llvm::dbgs() << "MachO Compact Unwind pass\n"); + LLVM_DEBUG(llvm::dbgs() << "MachO Compact Unwind pass\n"); std::map<const Atom *, CompactUnwindEntry> unwindLocs; std::map<const Atom *, const Atom *> dwarfFrames; @@ -319,7 +319,7 @@ private: // Finally, we can start creating pages based on these entries. - DEBUG(llvm::dbgs() << " Splitting entries into pages\n"); + LLVM_DEBUG(llvm::dbgs() << " Splitting entries into pages\n"); // FIXME: we split the entries into pages naively: lots of 4k pages followed // by a small one. ld64 tried to minimize space and align them to real 4k // boundaries. That might be worth doing, or perhaps we could perform some @@ -336,11 +336,13 @@ private: pages.back().entries = remainingInfos.slice(0, entriesInPage); remainingInfos = remainingInfos.slice(entriesInPage); - DEBUG(llvm::dbgs() - << " Page from " << pages.back().entries[0].rangeStart->name() - << " to " << pages.back().entries.back().rangeStart->name() << " + " - << llvm::format("0x%x", pages.back().entries.back().rangeLength) - << " has " << entriesInPage << " entries\n"); + LLVM_DEBUG(llvm::dbgs() + << " Page from " + << pages.back().entries[0].rangeStart->name() << " to " + << pages.back().entries.back().rangeStart->name() << " + " + << llvm::format("0x%x", + pages.back().entries.back().rangeLength) + << " has " << entriesInPage << " entries\n"); } while (!remainingInfos.empty()); auto *unwind = new (_file.allocator()) @@ -360,7 +362,7 @@ private: const SimpleFile &mergedFile, std::map<const Atom *, CompactUnwindEntry> &unwindLocs, std::vector<const Atom *> &personalities, uint32_t &numLSDAs) { - DEBUG(llvm::dbgs() << " Collecting __compact_unwind entries\n"); + LLVM_DEBUG(llvm::dbgs() << " Collecting __compact_unwind entries\n"); for (const DefinedAtom *atom : mergedFile.defined()) { if (atom->contentType() != DefinedAtom::typeCompactUnwindInfo) @@ -369,14 +371,15 @@ private: auto unwindEntry = extractCompactUnwindEntry(atom); unwindLocs.insert(std::make_pair(unwindEntry.rangeStart, unwindEntry)); - DEBUG(llvm::dbgs() << " Entry for " << unwindEntry.rangeStart->name() - << ", encoding=" - << llvm::format("0x%08x", unwindEntry.encoding)); + LLVM_DEBUG(llvm::dbgs() << " Entry for " + << unwindEntry.rangeStart->name() << ", encoding=" + << llvm::format("0x%08x", unwindEntry.encoding)); if (unwindEntry.personalityFunction) - DEBUG(llvm::dbgs() << ", personality=" - << unwindEntry.personalityFunction->name() - << ", lsdaLoc=" << unwindEntry.lsdaLocation->name()); - DEBUG(llvm::dbgs() << '\n'); + LLVM_DEBUG(llvm::dbgs() + << ", personality=" + << unwindEntry.personalityFunction->name() + << ", lsdaLoc=" << unwindEntry.lsdaLocation->name()); + LLVM_DEBUG(llvm::dbgs() << '\n'); // Count number of LSDAs we see, since we need to know how big the index // will be while laying out the section. @@ -454,7 +457,7 @@ private: const std::map<const Atom *, const Atom *> &dwarfFrames) { std::vector<CompactUnwindEntry> unwindInfos; - DEBUG(llvm::dbgs() << " Creating __unwind_info entries\n"); + LLVM_DEBUG(llvm::dbgs() << " Creating __unwind_info entries\n"); // The final order in the __unwind_info section must be derived from the // order of typeCode atoms, since that's how they'll be put into the object // file eventually (yuck!). @@ -465,10 +468,10 @@ private: unwindInfos.push_back(finalizeUnwindInfoEntryForAtom( atom, unwindLocs, personalities, dwarfFrames)); - DEBUG(llvm::dbgs() << " Entry for " << atom->name() - << ", final encoding=" - << llvm::format("0x%08x", unwindInfos.back().encoding) - << '\n'); + LLVM_DEBUG(llvm::dbgs() + << " Entry for " << atom->name() << ", final encoding=" + << llvm::format("0x%08x", unwindInfos.back().encoding) + << '\n'); } return unwindInfos; diff --git a/lld/lib/ReaderWriter/MachO/LayoutPass.cpp b/lld/lib/ReaderWriter/MachO/LayoutPass.cpp index 7bca07eb16d..9058e4f562e 100644 --- a/lld/lib/ReaderWriter/MachO/LayoutPass.cpp +++ b/lld/lib/ReaderWriter/MachO/LayoutPass.cpp @@ -191,7 +191,7 @@ static bool compareAtomsSub(const LayoutPass::SortKey &lc, // Sort atoms by their ordinal overrides only if they fall in the same // chain. if (leftRoot == rightRoot) { - DEBUG(reason = formatReason("override", lc._override, rc._override)); + LLVM_DEBUG(reason = formatReason("override", lc._override, rc._override)); return lc._override < rc._override; } @@ -200,8 +200,8 @@ static bool compareAtomsSub(const LayoutPass::SortKey &lc, DefinedAtom::ContentPermissions rightPerms = rightRoot->permissions(); if (leftPerms != rightPerms) { - DEBUG(reason = - formatReason("contentPerms", (int)leftPerms, (int)rightPerms)); + LLVM_DEBUG( + reason = formatReason("contentPerms", (int)leftPerms, (int)rightPerms)); return leftPerms < rightPerms; } @@ -210,7 +210,8 @@ static bool compareAtomsSub(const LayoutPass::SortKey &lc, DefinedAtom::ContentType rightType = rightRoot->contentType(); if (leftType != rightType) { - DEBUG(reason = formatReason("contentType", (int)leftType, (int)rightType)); + LLVM_DEBUG(reason = + formatReason("contentType", (int)leftType, (int)rightType)); return leftType < rightType; } @@ -226,8 +227,8 @@ static bool compareAtomsSub(const LayoutPass::SortKey &lc, const File *rightFile = &rightRoot->file(); if (leftFile != rightFile) { - DEBUG(reason = formatReason(".o order", (int)leftFile->ordinal(), - (int)rightFile->ordinal())); + LLVM_DEBUG(reason = formatReason(".o order", (int)leftFile->ordinal(), + (int)rightFile->ordinal())); return leftFile->ordinal() < rightFile->ordinal(); } @@ -236,8 +237,8 @@ static bool compareAtomsSub(const LayoutPass::SortKey &lc, uint64_t rightOrdinal = rightRoot->ordinal(); if (leftOrdinal != rightOrdinal) { - DEBUG(reason = formatReason("ordinal", (int)leftRoot->ordinal(), - (int)rightRoot->ordinal())); + LLVM_DEBUG(reason = formatReason("ordinal", (int)leftRoot->ordinal(), + (int)rightRoot->ordinal())); return leftOrdinal < rightOrdinal; } @@ -251,7 +252,7 @@ static bool compareAtoms(const LayoutPass::SortKey &lc, LayoutPass::SortOverride customSorter) { std::string reason; bool result = compareAtomsSub(lc, rc, customSorter, reason); - DEBUG({ + LLVM_DEBUG({ StringRef comp = result ? "<" : ">="; llvm::dbgs() << "Layout: '" << lc._atom.get()->name() << "' " << comp << " '" @@ -441,7 +442,7 @@ void LayoutPass::undecorate(File::AtomRange<DefinedAtom> &atomRange, /// Perform the actual pass llvm::Error LayoutPass::perform(SimpleFile &mergedFile) { - DEBUG(llvm::dbgs() << "******** Laying out atoms:\n"); + LLVM_DEBUG(llvm::dbgs() << "******** Laying out atoms:\n"); // sort the atoms ScopedTask task(getDefaultDomain(), "LayoutPass"); File::AtomRange<DefinedAtom> atomRange = mergedFile.defined(); @@ -450,12 +451,12 @@ llvm::Error LayoutPass::perform(SimpleFile &mergedFile) { buildFollowOnTable(atomRange); // Check the structure of followon graph if running in debug mode. - DEBUG(checkFollowonChain(atomRange)); + LLVM_DEBUG(checkFollowonChain(atomRange)); // Build override maps buildOrdinalOverrideMap(atomRange); - DEBUG({ + LLVM_DEBUG({ llvm::dbgs() << "unsorted atoms:\n"; printDefinedAtoms(atomRange); }); @@ -465,15 +466,15 @@ llvm::Error LayoutPass::perform(SimpleFile &mergedFile) { [&](const LayoutPass::SortKey &l, const LayoutPass::SortKey &r) -> bool { return compareAtoms(l, r, _customSorter); }); - DEBUG(checkTransitivity(vec, _customSorter)); + LLVM_DEBUG(checkTransitivity(vec, _customSorter)); undecorate(atomRange, vec); - DEBUG({ + LLVM_DEBUG({ llvm::dbgs() << "sorted atoms:\n"; printDefinedAtoms(atomRange); }); - DEBUG(llvm::dbgs() << "******** Finished laying out atoms\n"); + LLVM_DEBUG(llvm::dbgs() << "******** Finished laying out atoms\n"); return llvm::Error::success(); } diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp index 4617d2341ad..473de894894 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp @@ -1431,8 +1431,8 @@ llvm::Error normalizedObjectToAtoms(MachOFile *file, const NormalizedFile &normalizedFile, bool copyRefs) { - DEBUG(llvm::dbgs() << "******** Normalizing file to atoms: " - << file->path() << "\n"); + LLVM_DEBUG(llvm::dbgs() << "******** Normalizing file to atoms: " + << file->path() << "\n"); bool scatterable = ((normalizedFile.flags & MH_SUBSECTIONS_VIA_SYMBOLS) != 0); // Create atoms from each section. |

