[lld] r185517 - Add "explicit" to ctors where appropriate.
Rui Ueyama
ruiu at google.com
Wed Jul 3 00:32:40 PDT 2013
Author: ruiu
Date: Wed Jul 3 02:32:40 2013
New Revision: 185517
URL: http://llvm.org/viewvc/llvm-project?rev=185517&view=rev
Log:
Add "explicit" to ctors where appropriate.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h
lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
Modified: lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h?rev=185517&r1=185516&r2=185517&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h Wed Jul 3 02:32:40 2013
@@ -30,7 +30,7 @@ using llvm::object::coff_symbol;
/// to be fixed up so that the address points to atom Y's address.
class COFFReference LLVM_FINAL : public Reference {
public:
- COFFReference(Kind kind) : _target(nullptr), _offsetInAtom(0) {
+ explicit COFFReference(Kind kind) : _target(nullptr), _offsetInAtom(0) {
_kind = kind;
}
Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp?rev=185517&r1=185516&r2=185517&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp Wed Jul 3 02:32:40 2013
@@ -351,7 +351,8 @@ private:
class ReaderCOFF : public Reader {
public:
- ReaderCOFF(const TargetInfo &ti) : Reader(ti), _readerArchive(ti, *this) {}
+ explicit ReaderCOFF(const TargetInfo &ti)
+ : Reader(ti), _readerArchive(ti, *this) {}
error_code parseFile(std::unique_ptr<MemoryBuffer> &mb,
std::vector<std::unique_ptr<File> > &result) const {
Modified: lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp?rev=185517&r1=185516&r2=185517&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp Wed Jul 3 02:32:40 2013
@@ -67,7 +67,7 @@ public:
kindSection
};
- Chunk(Kind kind) : _kind(kind), _size(0), _align(1) {}
+ explicit Chunk(Kind kind) : _kind(kind), _size(0), _align(1) {}
virtual ~Chunk() {};
virtual void write(uint8_t *fileBuffer) = 0;
@@ -131,7 +131,7 @@ private:
/// A PEHeaderChunk represents PE header including COFF header.
class PEHeaderChunk : public HeaderChunk {
public:
- PEHeaderChunk(const PECOFFTargetInfo &targetInfo) : HeaderChunk() {
+ explicit PEHeaderChunk(const PECOFFTargetInfo &targetInfo) : HeaderChunk() {
// Set the size of the chunk and initialize the header with null bytes.
_size = sizeof(llvm::COFF::PEMagic) + sizeof(_coffHeader)
+ sizeof(_peHeader);
@@ -585,7 +585,7 @@ private:
}
public:
- ExecutableWriter(const PECOFFTargetInfo &targetInfo)
+ explicit ExecutableWriter(const PECOFFTargetInfo &targetInfo)
: _PECOFFTargetInfo(targetInfo) {}
// Create all chunks that consist of the output file.
More information about the llvm-commits
mailing list