mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-24 11:36:10 +00:00
llvmc: Do not mention plugins in the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111826 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6bb156a681
commit
c712edc785
@ -1,4 +1,4 @@
|
|||||||
##===- tools/llvmc/plugins/Hello/Makefile ------------------*- Makefile -*-===##
|
##===- tools/llvmc/examples/Hello/Makefile -----------------*- Makefile -*-===##
|
||||||
#
|
#
|
||||||
# The LLVM Compiler Infrastructure
|
# The LLVM Compiler Infrastructure
|
||||||
#
|
#
|
||||||
|
@ -1094,9 +1094,7 @@ void FillInToolToLang (const ToolDescriptions& ToolDescs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// TypecheckGraph - Check that names for output and input languages
|
/// TypecheckGraph - Check that names for output and input languages
|
||||||
/// on all edges do match. This doesn't do much when the information
|
/// on all edges do match.
|
||||||
/// about the whole graph is not available (i.e. when compiling most
|
|
||||||
/// plugins).
|
|
||||||
void TypecheckGraph (const RecordVector& EdgeVector,
|
void TypecheckGraph (const RecordVector& EdgeVector,
|
||||||
const ToolDescriptions& ToolDescs) {
|
const ToolDescriptions& ToolDescs) {
|
||||||
StringMap<StringSet<> > ToolToInLang;
|
StringMap<StringSet<> > ToolToInLang;
|
||||||
@ -2628,9 +2626,7 @@ void EmitPopulateLanguageMap (const RecordKeeper& Records, raw_ostream& O)
|
|||||||
// TODO: change this to getAllDerivedDefinitions.
|
// TODO: change this to getAllDerivedDefinitions.
|
||||||
const Record* LangMapRecord = Records.getDef("LanguageMap");
|
const Record* LangMapRecord = Records.getDef("LanguageMap");
|
||||||
|
|
||||||
// It is allowed for a plugin to have no language map.
|
|
||||||
if (LangMapRecord) {
|
if (LangMapRecord) {
|
||||||
|
|
||||||
ListInit* LangsToSuffixesList = LangMapRecord->getValueAsListInit("map");
|
ListInit* LangsToSuffixesList = LangMapRecord->getValueAsListInit("map");
|
||||||
if (!LangsToSuffixesList)
|
if (!LangsToSuffixesList)
|
||||||
throw "Error in the language map definition!";
|
throw "Error in the language map definition!";
|
||||||
@ -2964,12 +2960,12 @@ void EmitIncludes(raw_ostream& O) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// PluginData - Holds all information about a plugin.
|
/// DriverData - Holds all information about the driver.
|
||||||
struct PluginData {
|
struct DriverData {
|
||||||
OptionDescriptions OptDescs;
|
OptionDescriptions OptDescs;
|
||||||
bool HasSink;
|
|
||||||
ToolDescriptions ToolDescs;
|
ToolDescriptions ToolDescs;
|
||||||
RecordVector Edges;
|
RecordVector Edges;
|
||||||
|
bool HasSink;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// HasSink - Go through the list of tool descriptions and check if
|
/// HasSink - Go through the list of tool descriptions and check if
|
||||||
@ -2983,9 +2979,9 @@ bool HasSink(const ToolDescriptions& ToolDescs) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CollectPluginData - Collect compilation graph edges, tool properties and
|
/// CollectDriverData - Collect compilation graph edges, tool properties and
|
||||||
/// option properties from the parse tree.
|
/// option properties from the parse tree.
|
||||||
void CollectPluginData (const RecordKeeper& Records, PluginData& Data) {
|
void CollectDriverData (const RecordKeeper& Records, DriverData& Data) {
|
||||||
// Collect option properties.
|
// Collect option properties.
|
||||||
const RecordVector& OptionLists =
|
const RecordVector& OptionLists =
|
||||||
Records.getAllDerivedDefinitions("OptionList");
|
Records.getAllDerivedDefinitions("OptionList");
|
||||||
@ -3004,8 +3000,8 @@ void CollectPluginData (const RecordKeeper& Records, PluginData& Data) {
|
|||||||
Data.Edges);
|
Data.Edges);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CheckPluginData - Perform some sanity checks on the collected data.
|
/// CheckDriverData - Perform some sanity checks on the collected data.
|
||||||
void CheckPluginData(PluginData& Data) {
|
void CheckDriverData(DriverData& Data) {
|
||||||
// Filter out all tools not mentioned in the compilation graph.
|
// Filter out all tools not mentioned in the compilation graph.
|
||||||
FilterNotInGraph(Data.Edges, Data.ToolDescs);
|
FilterNotInGraph(Data.Edges, Data.ToolDescs);
|
||||||
|
|
||||||
@ -3017,7 +3013,7 @@ void CheckPluginData(PluginData& Data) {
|
|||||||
CheckForSuperfluousOptions(Data.Edges, Data.ToolDescs, Data.OptDescs);
|
CheckForSuperfluousOptions(Data.Edges, Data.ToolDescs, Data.OptDescs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitPluginCode(const PluginData& Data, raw_ostream& O) {
|
void EmitDriverCode(const DriverData& Data, raw_ostream& O) {
|
||||||
// Emit file header.
|
// Emit file header.
|
||||||
EmitIncludes(O);
|
EmitIncludes(O);
|
||||||
|
|
||||||
@ -3072,13 +3068,13 @@ void EmitPluginCode(const PluginData& Data, raw_ostream& O) {
|
|||||||
/// run - The back-end entry point.
|
/// run - The back-end entry point.
|
||||||
void LLVMCConfigurationEmitter::run (raw_ostream &O) {
|
void LLVMCConfigurationEmitter::run (raw_ostream &O) {
|
||||||
try {
|
try {
|
||||||
PluginData Data;
|
DriverData Data;
|
||||||
|
|
||||||
CollectPluginData(Records, Data);
|
CollectDriverData(Records, Data);
|
||||||
CheckPluginData(Data);
|
CheckDriverData(Data);
|
||||||
|
|
||||||
this->EmitSourceFileHeader("LLVMC Configuration Library", O);
|
this->EmitSourceFileHeader("llvmc-based driver: auto-generated code", O);
|
||||||
EmitPluginCode(Data, O);
|
EmitDriverCode(Data, O);
|
||||||
|
|
||||||
} catch (std::exception& Error) {
|
} catch (std::exception& Error) {
|
||||||
throw Error.what() + std::string(" - usually this means a syntax error.");
|
throw Error.what() + std::string(" - usually this means a syntax error.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user