From effe83657d4a26ab1f3132152dae212e54e66a04 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Tue, 23 Oct 2012 21:29:20 +0000 Subject: [PATCH] gold/ * fileread.cc (Input_file::Input_file): New constructor. * fileread.h (class Input_file): Add new constructor. --- gold/ChangeLog | 5 +++++ gold/fileread.cc | 10 ++++++++++ gold/fileread.h | 3 +++ 3 files changed, 18 insertions(+) diff --git a/gold/ChangeLog b/gold/ChangeLog index 52e19daa746..4ea4b271a1b 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2012-10-23 Cary Coutant + + * fileread.cc (Input_file::Input_file): New constructor. + * fileread.h (class Input_file): Add new constructor. + 2012-10-18 Alan Modra PR gold/14727 diff --git a/gold/fileread.cc b/gold/fileread.cc index c5dc320c34e..3fd35af48ee 100644 --- a/gold/fileread.cc +++ b/gold/fileread.cc @@ -856,6 +856,16 @@ File_view::~File_view() // Class Input_file. +// Create a file given just the filename. + +Input_file::Input_file(const char* name) + : found_name_(), file_(), is_in_sysroot_(false), format_(FORMAT_NONE) +{ + this->input_argument_ = + new Input_file_argument(name, Input_file_argument::INPUT_FILE_TYPE_FILE, + "", false, Position_dependent_options()); +} + // Create a file for testing. Input_file::Input_file(const Task* task, const char* name, diff --git a/gold/fileread.h b/gold/fileread.h index 02c7a641e18..08a4583943c 100644 --- a/gold/fileread.h +++ b/gold/fileread.h @@ -493,6 +493,9 @@ class Input_file is_in_sysroot_(false), format_(FORMAT_NONE) { } + // Create an input file given just a filename. + Input_file(const char* name); + // Create an input file with the contents already provided. This is // only used for testing. With this path, don't call the open // method. -- 2.30.2