mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
Code reorg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50722 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
58
tools/llvmc2/Action.cpp
Normal file
58
tools/llvmc2/Action.cpp
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
//===--- Tools.h - The LLVM Compiler Driver ---------------------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open
|
||||||
|
// Source License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
//
|
||||||
|
// Action class - implementation and auxiliary functions.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "Action.h"
|
||||||
|
|
||||||
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/System/Program.h"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
|
using namespace llvm;
|
||||||
|
|
||||||
|
extern cl::opt<bool> VerboseMode;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
int ExecuteProgram(const std::string& name,
|
||||||
|
const std::vector<std::string>& args) {
|
||||||
|
sys::Path prog = sys::Program::FindProgramByName(name);
|
||||||
|
|
||||||
|
if (prog.isEmpty())
|
||||||
|
throw std::runtime_error("Can't find program '" + name + "'");
|
||||||
|
if (!prog.canExecute())
|
||||||
|
throw std::runtime_error("Program '" + name + "' is not executable.");
|
||||||
|
|
||||||
|
// Invoke the program
|
||||||
|
std::vector<const char*> argv((args.size()+2));
|
||||||
|
argv[0] = name.c_str();
|
||||||
|
for (unsigned i = 1; i <= args.size(); ++i)
|
||||||
|
argv[i] = args[i-1].c_str();
|
||||||
|
argv[args.size()+1] = 0; // null terminate list.
|
||||||
|
|
||||||
|
return sys::Program::ExecuteAndWait(prog, &argv[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void print_string (const std::string& str) {
|
||||||
|
std::cerr << str << ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int llvmcc::Action::Execute() {
|
||||||
|
if (VerboseMode) {
|
||||||
|
std::cerr << Command_ << " ";
|
||||||
|
std::for_each(Args_.begin(), Args_.end(), print_string);
|
||||||
|
std::cerr << '\n';
|
||||||
|
}
|
||||||
|
return ExecuteProgram(Command_, Args_);
|
||||||
|
}
|
36
tools/llvmc2/Action.h
Normal file
36
tools/llvmc2/Action.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
//===--- Tools.h - The LLVM Compiler Driver ---------------------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open
|
||||||
|
// Source License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
//
|
||||||
|
// Action - encapsulates a single shell command.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#ifndef LLVM_TOOLS_LLVMC2_ACTION_H
|
||||||
|
#define LLVM_TOOLS_LLVMC2_ACTION_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace llvmcc {
|
||||||
|
|
||||||
|
class Action {
|
||||||
|
std::string Command_;
|
||||||
|
std::vector<std::string> Args_;
|
||||||
|
public:
|
||||||
|
Action (std::string const& C,
|
||||||
|
std::vector<std::string> const& A)
|
||||||
|
: Command_(C), Args_(A)
|
||||||
|
{}
|
||||||
|
|
||||||
|
int Execute();
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // LLVM_TOOLS_LLVMC2_ACTION_H
|
@ -7,22 +7,20 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// Auto-generated tool descriptions.
|
// Auto-generated tool descriptions - implementation.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "Tools.h"
|
#include "AutoGenerated.h"
|
||||||
#include "Core.h"
|
#include "CompilationGraph.h"
|
||||||
|
#include "Tool.h"
|
||||||
|
|
||||||
#include "llvm/ADT/IntrusiveRefCntPtr.h"
|
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
using namespace llvmcc;
|
using namespace llvmcc;
|
||||||
|
|
||||||
// Include the auto-generated file
|
// The auto-generated file
|
||||||
#include "Tools.inc"
|
#include "AutoGenerated.inc"
|
@ -1,4 +1,4 @@
|
|||||||
//===--- Tools.h - The LLVM Compiler Driver ---------------------*- C++ -*-===//
|
//===--- Tools.cpp - The LLVM Compiler Driver -------------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
@ -7,20 +7,24 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// Auto-generated tool descriptions.
|
// Auto-generated tool descriptions - public interface.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#ifndef LLVM_TOOLS_LLVMCC_TOOLS_H
|
#ifndef LLVM_TOOLS_LLVMC2_AUTOGENERATED_H
|
||||||
#define LLVM_TOOLS_LLVMCC_TOOLS_H
|
#define LLVM_TOOLS_LLVMC2_AUTOGENERATED_H
|
||||||
|
|
||||||
#include "Core.h"
|
#include "llvm/ADT/StringMap.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace llvmcc {
|
namespace llvmcc {
|
||||||
|
|
||||||
|
typedef llvm::StringMap<std::string> LanguageMap;
|
||||||
|
class CompilationGraph;
|
||||||
|
|
||||||
void PopulateLanguageMap(LanguageMap& language_map);
|
void PopulateLanguageMap(LanguageMap& language_map);
|
||||||
void PopulateCompilationGraph(CompilationGraph& tools);
|
void PopulateCompilationGraph(CompilationGraph& tools);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //LLVM_TOOLS_LLVMCC_TOOLS_H
|
#endif // LLVM_TOOLS_LLVMC2_AUTOGENERATED_H
|
@ -1,4 +1,4 @@
|
|||||||
//===--- Core.cpp - The LLVM Compiler Driver --------------------*- C++ -*-===//
|
//===--- CompilationGraph.cpp - The LLVM Compiler Driver --------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
@ -7,42 +7,21 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// Core driver abstractions.
|
// Compilation graph - implementation.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "Core.h"
|
#include "CompilationGraph.h"
|
||||||
#include "Utility.h"
|
|
||||||
|
|
||||||
#include "llvm/ADT/STLExtras.h"
|
|
||||||
#include "llvm/ADT/StringExtras.h"
|
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/ADT/STLExtras.h"
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <iostream>
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
using namespace llvmcc;
|
|
||||||
|
|
||||||
extern cl::list<std::string> InputFilenames;
|
extern cl::list<std::string> InputFilenames;
|
||||||
extern cl::opt<std::string> OutputFilename;
|
extern cl::opt<std::string> OutputFilename;
|
||||||
extern cl::opt<bool> VerboseMode;
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
void print_string (const std::string& str) {
|
|
||||||
std::cerr << str << ' ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int llvmcc::Action::Execute() {
|
|
||||||
if (VerboseMode) {
|
|
||||||
std::cerr << Command_ << " ";
|
|
||||||
std::for_each(Args_.begin(), Args_.end(), print_string);
|
|
||||||
std::cerr << '\n';
|
|
||||||
}
|
|
||||||
return ExecuteProgram(Command_, Args_);
|
|
||||||
}
|
|
||||||
|
|
||||||
int llvmcc::CompilationGraph::Build (const sys::Path& tempDir) const {
|
int llvmcc::CompilationGraph::Build (const sys::Path& tempDir) const {
|
||||||
sys::Path In(InputFilenames.at(0)), Out;
|
sys::Path In(InputFilenames.at(0)), Out;
|
||||||
@ -107,9 +86,3 @@ int llvmcc::CompilationGraph::Build (const sys::Path& tempDir) const {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void llvmcc::Tool::UnpackValues (const std::string& from,
|
|
||||||
std::vector<std::string>& to) const {
|
|
||||||
SplitString(from, to, ",");
|
|
||||||
}
|
|
||||||
|
|
36
tools/llvmc2/CompilationGraph.h
Normal file
36
tools/llvmc2/CompilationGraph.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
//===--- CompilationGraph.h - The LLVM Compiler Driver ----------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open
|
||||||
|
// Source License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
//
|
||||||
|
// Compilation graph - definition.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#ifndef LLVM_TOOLS_LLVMC2_COMPILATION_GRAPH_H
|
||||||
|
#define LLVM_TOOLS_LLVMC2_COMPILATION_GRAPH_H
|
||||||
|
|
||||||
|
#include "AutoGenerated.h"
|
||||||
|
#include "Tool.h"
|
||||||
|
|
||||||
|
#include "llvm/ADT/StringMap.h"
|
||||||
|
#include "llvm/System/Path.h"
|
||||||
|
|
||||||
|
namespace llvmcc {
|
||||||
|
|
||||||
|
typedef std::vector<llvm::IntrusiveRefCntPtr<Tool> > ToolChain;
|
||||||
|
typedef llvm::StringMap<ToolChain> ToolChainMap;
|
||||||
|
|
||||||
|
struct CompilationGraph {
|
||||||
|
ToolChainMap ToolChains;
|
||||||
|
LanguageMap ExtsToLangs;
|
||||||
|
|
||||||
|
int Build(llvm::sys::Path const& tempDir) const;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // LLVM_TOOLS_LLVMC2_COMPILATION_GRAPH_H
|
@ -8,7 +8,7 @@
|
|||||||
##===----------------------------------------------------------------------===##
|
##===----------------------------------------------------------------------===##
|
||||||
LEVEL = ../..
|
LEVEL = ../..
|
||||||
TOOLNAME = llvmc2
|
TOOLNAME = llvmc2
|
||||||
BUILT_SOURCES = Tools.inc
|
BUILT_SOURCES = AutoGenerated.inc
|
||||||
LINK_COMPONENTS = support system
|
LINK_COMPONENTS = support system
|
||||||
REQUIRES_EH := 1
|
REQUIRES_EH := 1
|
||||||
|
|
||||||
@ -23,10 +23,10 @@ endif
|
|||||||
|
|
||||||
# TOFIX: integrate this part into Makefile.rules?
|
# TOFIX: integrate this part into Makefile.rules?
|
||||||
# The degree of horrorshowness in that file is too much for me atm.
|
# The degree of horrorshowness in that file is too much for me atm.
|
||||||
$(ObjDir)/Tools.inc.tmp: $(TOOLS_SOURCE) $(ObjDir)/.dir
|
$(ObjDir)/AutoGenerated.inc.tmp: $(TOOLS_SOURCE) $(ObjDir)/.dir
|
||||||
$(Echo) "Building LLVMCC configuration library with tblgen"
|
$(Echo) "Building LLVMCC configuration library with tblgen"
|
||||||
$(Verb) $(TableGen) -gen-llvmcc -o $(call SYSPATH, $@) $<
|
$(Verb) $(TableGen) -gen-llvmcc -o $(call SYSPATH, $@) $<
|
||||||
|
|
||||||
Tools.inc : $(ObjDir)/Tools.inc.tmp
|
AutoGenerated.inc : $(ObjDir)/AutoGenerated.inc.tmp
|
||||||
$(Verb) $(CMP) -s $@ $< || $(CP) $< $@
|
$(Verb) $(CMP) -s $@ $< || $(CP) $< $@
|
||||||
|
|
||||||
|
21
tools/llvmc2/Tool.cpp
Normal file
21
tools/llvmc2/Tool.cpp
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
//===--- Tools.cpp - The LLVM Compiler Driver -------------------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open
|
||||||
|
// Source License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
//
|
||||||
|
// Tool abstract base class - implementation of the auxiliary functions.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "Tool.h"
|
||||||
|
|
||||||
|
#include "llvm/ADT/StringExtras.h"
|
||||||
|
|
||||||
|
void llvmcc::Tool::UnpackValues (const std::string& from,
|
||||||
|
std::vector<std::string>& to) {
|
||||||
|
llvm::SplitString(from, to, ",");
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
//===--- Core.h - The LLVM Compiler Driver ----------------------*- C++ -*-===//
|
//===--- Tools.h - The LLVM Compiler Driver ---------------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
@ -7,41 +7,24 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// Core driver abstractions.
|
// Tool abstract base class - an interface to tool descriptions.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#ifndef LLVM_TOOLS_LLVMCC_CORE_H
|
#ifndef LLVM_TOOLS_LLVMC2_TOOL_H
|
||||||
#define LLVM_TOOLS_LLVMCC_CORE_H
|
#define LLVM_TOOLS_LLVMC2_TOOL_H
|
||||||
|
|
||||||
#include "Utility.h"
|
#include "Action.h"
|
||||||
|
|
||||||
#include "llvm/ADT/IntrusiveRefCntPtr.h"
|
#include "llvm/ADT/IntrusiveRefCntPtr.h"
|
||||||
#include "llvm/ADT/StringMap.h"
|
|
||||||
#include "llvm/System/Path.h"
|
#include "llvm/System/Path.h"
|
||||||
|
|
||||||
#include <stdexcept>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
// Core functionality
|
|
||||||
|
|
||||||
namespace llvmcc {
|
namespace llvmcc {
|
||||||
|
|
||||||
typedef std::vector<llvm::sys::Path> PathVector;
|
typedef std::vector<llvm::sys::Path> PathVector;
|
||||||
typedef llvm::StringMap<std::string> LanguageMap;
|
|
||||||
|
|
||||||
class Action {
|
|
||||||
std::string Command_;
|
|
||||||
std::vector<std::string> Args_;
|
|
||||||
public:
|
|
||||||
Action (std::string const& C,
|
|
||||||
std::vector<std::string> const& A)
|
|
||||||
: Command_(C), Args_(A)
|
|
||||||
{}
|
|
||||||
|
|
||||||
int Execute();
|
|
||||||
};
|
|
||||||
|
|
||||||
class Tool : public llvm::RefCountedBaseVPTR<Tool> {
|
class Tool : public llvm::RefCountedBaseVPTR<Tool> {
|
||||||
public:
|
public:
|
||||||
@ -62,22 +45,13 @@ namespace llvmcc {
|
|||||||
// Helper function that is called by the auto-generated code
|
// Helper function that is called by the auto-generated code
|
||||||
// Splits strings of the form ",-foo,-bar,-baz"
|
// Splits strings of the form ",-foo,-bar,-baz"
|
||||||
// TOFIX: find a better name
|
// TOFIX: find a better name
|
||||||
void UnpackValues (std::string const& from,
|
static void UnpackValues (std::string const& from,
|
||||||
std::vector<std::string>& to) const;
|
std::vector<std::string>& to);
|
||||||
|
|
||||||
virtual ~Tool()
|
virtual ~Tool()
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector<llvm::IntrusiveRefCntPtr<Tool> > ToolChain;
|
|
||||||
typedef llvm::StringMap<ToolChain> ToolChainMap;
|
|
||||||
|
|
||||||
struct CompilationGraph {
|
|
||||||
ToolChainMap ToolChains;
|
|
||||||
LanguageMap ExtsToLangs;
|
|
||||||
|
|
||||||
int Build(llvm::sys::Path const& tempDir) const;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // LLVM_TOOLS_LLVMCC_CORE_H
|
#endif //LLVM_TOOLS_LLVMC2_TOOL_H
|
@ -1,39 +0,0 @@
|
|||||||
//===--- Utility.cpp - The LLVM Compiler Driver -----------------*- C++ -*-===//
|
|
||||||
//
|
|
||||||
// The LLVM Compiler Infrastructure
|
|
||||||
//
|
|
||||||
// This file is distributed under the University of Illinois Open
|
|
||||||
// Source License. See LICENSE.TXT for details.
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
//
|
|
||||||
// Various helper and utility functions - implementation.
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
|
|
||||||
#include "Utility.h"
|
|
||||||
|
|
||||||
#include "llvm/System/Program.h"
|
|
||||||
|
|
||||||
#include <stdexcept>
|
|
||||||
|
|
||||||
using namespace llvm;
|
|
||||||
|
|
||||||
int llvmcc::ExecuteProgram(const std::string& name,
|
|
||||||
const std::vector<std::string>& args) {
|
|
||||||
sys::Path prog = sys::Program::FindProgramByName(name);
|
|
||||||
|
|
||||||
if (prog.isEmpty())
|
|
||||||
throw std::runtime_error("Can't find program '" + name + "'");
|
|
||||||
if (!prog.canExecute())
|
|
||||||
throw std::runtime_error("Program '" + name + "' is not executable.");
|
|
||||||
|
|
||||||
// Invoke the program
|
|
||||||
std::vector<const char*> argv((args.size()+2));
|
|
||||||
argv[0] = name.c_str();
|
|
||||||
for (unsigned i = 1; i <= args.size(); ++i)
|
|
||||||
argv[i] = args[i-1].c_str();
|
|
||||||
argv[args.size()+1] = 0; // null terminate list.
|
|
||||||
|
|
||||||
return sys::Program::ExecuteAndWait(prog, &argv[0]);
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
//===--- Utility.h - The LLVM Compiler Driver -------------------*- C++ -*-===//
|
|
||||||
//
|
|
||||||
// The LLVM Compiler Infrastructure
|
|
||||||
//
|
|
||||||
// This file is distributed under the University of Illinois Open
|
|
||||||
// Source License. See LICENSE.TXT for details.
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
//
|
|
||||||
// Various helper and utility functions.
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
|
|
||||||
#ifndef LLVM_TOOLS_LLVMCC_UTILITY_H
|
|
||||||
#define LLVM_TOOLS_LLVMCC_UTILITY_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace llvmcc {
|
|
||||||
|
|
||||||
int ExecuteProgram (const std::string& name,
|
|
||||||
const std::vector<std::string>& arguments);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // LLVM_TOOLS_LLVMCC_UTILITY_H
|
|
@ -14,9 +14,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "Core.h"
|
#include "CompilationGraph.h"
|
||||||
#include "Utility.h"
|
#include "Tool.h"
|
||||||
#include "Tools.h"
|
|
||||||
|
|
||||||
#include "llvm/System/Path.h"
|
#include "llvm/System/Path.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
@ -25,11 +24,11 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using namespace llvm;
|
namespace cl = llvm::cl;
|
||||||
|
namespace sys = llvm::sys;
|
||||||
using namespace llvmcc;
|
using namespace llvmcc;
|
||||||
|
|
||||||
// These variables are also used in Core.cpp,
|
// External linkage here is intentional.
|
||||||
// so they should have external linkage.
|
|
||||||
cl::list<std::string> InputFilenames(cl::Positional,
|
cl::list<std::string> InputFilenames(cl::Positional,
|
||||||
cl::desc("<input file>"), cl::OneOrMore);
|
cl::desc("<input file>"), cl::OneOrMore);
|
||||||
cl::opt<std::string> OutputFilename("o", cl::desc("Output file name"),
|
cl::opt<std::string> OutputFilename("o", cl::desc("Output file name"),
|
@ -623,10 +623,10 @@ void EmitOptionPropertyHandlingCode (const ToolProperties& P,
|
|||||||
<< "::iterator B = " << D.GenVariableName() << ".begin(),\n"
|
<< "::iterator B = " << D.GenVariableName() << ".begin(),\n"
|
||||||
<< Indent3 << "E = " << D.GenVariableName()
|
<< Indent3 << "E = " << D.GenVariableName()
|
||||||
<< ".end(); B != E; ++B)\n"
|
<< ".end(); B != E; ++B)\n"
|
||||||
<< Indent4 << "UnpackValues(*B, vec);\n";
|
<< Indent4 << "Tool::UnpackValues(*B, vec);\n";
|
||||||
}
|
}
|
||||||
else if (D.Type == OptionType::Prefix || D.Type == OptionType::Parameter){
|
else if (D.Type == OptionType::Prefix || D.Type == OptionType::Parameter){
|
||||||
O << Indent3 << "UnpackValues("
|
O << Indent3 << "Tool::UnpackValues("
|
||||||
<< D.GenVariableName() << ", vec);\n";
|
<< D.GenVariableName() << ", vec);\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user