Add "explicit" to ctors where appropriate.

llvm-svn: 185517
This commit is contained in:
Rui Ueyama 2013-07-03 07:32:40 +00:00
parent afa4844d94
commit 6c7ac57235
3 changed files with 6 additions and 5 deletions

View File

@ -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;
}

View File

@ -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 {

View File

@ -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.