[lld] r281670 - Create PDB.h and move code to remove unnecessary #includes.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 15 15:24:52 PDT 2016
Author: ruiu
Date: Thu Sep 15 17:24:51 2016
New Revision: 281670
URL: http://llvm.org/viewvc/llvm-project?rev=281670&view=rev
Log:
Create PDB.h and move code to remove unnecessary #includes.
Added:
lld/trunk/COFF/PDB.h
Modified:
lld/trunk/COFF/Driver.cpp
lld/trunk/COFF/Driver.h
lld/trunk/COFF/InputFiles.cpp
lld/trunk/COFF/InputFiles.h
lld/trunk/COFF/PDB.cpp
Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=281670&r1=281669&r2=281670&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Thu Sep 15 17:24:51 2016
@@ -7,10 +7,11 @@
//
//===----------------------------------------------------------------------===//
-#include "Config.h"
#include "Driver.h"
+#include "Config.h"
#include "Error.h"
#include "InputFiles.h"
+#include "PDB.h"
#include "SymbolTable.h"
#include "Symbols.h"
#include "Writer.h"
Modified: lld/trunk/COFF/Driver.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.h?rev=281670&r1=281669&r2=281670&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.h (original)
+++ lld/trunk/COFF/Driver.h Thu Sep 15 17:24:51 2016
@@ -164,8 +164,6 @@ void checkFailIfMismatch(StringRef Arg);
std::unique_ptr<MemoryBuffer>
convertResToCOFF(const std::vector<MemoryBufferRef> &MBs);
-void createPDB(StringRef Path);
-
// Create enum with OPT_xxx values for each option in Options.td
enum {
OPT_INVALID = 0,
Modified: lld/trunk/COFF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.cpp?rev=281670&r1=281669&r2=281670&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.cpp (original)
+++ lld/trunk/COFF/InputFiles.cpp Thu Sep 15 17:24:51 2016
@@ -32,6 +32,7 @@
#include <system_error>
#include <utility>
+using namespace llvm;
using namespace llvm::COFF;
using namespace llvm::object;
using namespace llvm::support::endian;
@@ -62,6 +63,8 @@ std::string InputFile::getShortName() {
return StringRef(Res).lower();
}
+ArchiveFile::ArchiveFile(MemoryBufferRef M) : InputFile(ArchiveKind, M) {}
+
void ArchiveFile::parse() {
// Parse a MemoryBufferRef as an archive file.
File = check(Archive::create(MB), getShortName());
@@ -106,6 +109,8 @@ MemoryBufferRef ArchiveFile::getMember(c
return MB;
}
+MutableArrayRef<Lazy> ArchiveFile::getLazySymbols() { return LazySymbols; }
+
void ObjectFile::parse() {
// Parse a memory buffer as a COFF file.
std::unique_ptr<Binary> Bin =
Modified: lld/trunk/COFF/InputFiles.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.h?rev=281670&r1=281669&r2=281670&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.h (original)
+++ lld/trunk/COFF/InputFiles.h Thu Sep 15 17:24:51 2016
@@ -91,7 +91,7 @@ private:
// .lib or .a file.
class ArchiveFile : public InputFile {
public:
- explicit ArchiveFile(MemoryBufferRef M) : InputFile(ArchiveKind, M) {}
+ explicit ArchiveFile(MemoryBufferRef M);
static bool classof(const InputFile *F) { return F->kind() == ArchiveKind; }
void parse() override;
@@ -100,7 +100,7 @@ public:
// (So that we don't instantiate same members more than once.)
MemoryBufferRef getMember(const Archive::Symbol *Sym);
- llvm::MutableArrayRef<Lazy> getLazySymbols() { return LazySymbols; }
+ llvm::MutableArrayRef<Lazy> getLazySymbols();
// All symbols returned by ArchiveFiles are of Lazy type.
std::vector<SymbolBody *> &getSymbols() override {
Modified: lld/trunk/COFF/PDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/PDB.cpp?rev=281670&r1=281669&r2=281670&view=diff
==============================================================================
--- lld/trunk/COFF/PDB.cpp (original)
+++ lld/trunk/COFF/PDB.cpp Thu Sep 15 17:24:51 2016
@@ -7,21 +7,21 @@
//
//===----------------------------------------------------------------------===//
-#include "Driver.h"
+#include "PDB.h"
#include "Error.h"
-#include "Symbols.h"
#include "llvm/DebugInfo/MSF/MSFCommon.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/FileOutputBuffer.h"
#include <memory>
+using namespace lld;
using namespace llvm;
using namespace llvm::support;
using namespace llvm::support::endian;
const int BlockSize = 4096;
-void lld::coff::createPDB(StringRef Path) {
+void coff::createPDB(StringRef Path) {
// Create a file.
size_t FileSize = BlockSize * 3;
ErrorOr<std::unique_ptr<FileOutputBuffer>> BufferOrErr =
Added: lld/trunk/COFF/PDB.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/PDB.h?rev=281670&view=auto
==============================================================================
--- lld/trunk/COFF/PDB.h (added)
+++ lld/trunk/COFF/PDB.h Thu Sep 15 17:24:51 2016
@@ -0,0 +1,21 @@
+//===- PDB.h ----------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Linker
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLD_COFF_PDB_H
+#define LLD_COFF_PDB_H
+
+#include "llvm/ADT/StringRef.h"
+
+namespace lld {
+namespace coff {
+void createPDB(llvm::StringRef Path);
+}
+}
+
+#endif
More information about the llvm-commits
mailing list