mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
Escape the name of the module since it comes from the file name and may include
invalid characters like backslashes on Windows. Patch by James Abbatiello! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74265 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fc0fc3aedb
commit
b8b7347c10
@ -1834,7 +1834,9 @@ namespace {
|
||||
const std::string& mName) {
|
||||
nl(Out) << "Module* " << fname << "() {";
|
||||
nl(Out,1) << "// Module Construction";
|
||||
nl(Out) << "Module* mod = new Module(\"" << mName << "\");";
|
||||
nl(Out) << "Module* mod = new Module(\"";
|
||||
printEscapedString(mName);
|
||||
Out << "\");";
|
||||
if (!TheModule->getTargetTriple().empty()) {
|
||||
nl(Out) << "mod->setDataLayout(\"" << TheModule->getDataLayout() << "\");";
|
||||
}
|
||||
@ -1867,7 +1869,9 @@ namespace {
|
||||
void CppWriter::printContents(const std::string& fname,
|
||||
const std::string& mName) {
|
||||
Out << "\nModule* " << fname << "(Module *mod) {\n";
|
||||
Out << "\nmod->setModuleIdentifier(\"" << mName << "\");\n";
|
||||
Out << "\nmod->setModuleIdentifier(\"";
|
||||
printEscapedString(mName);
|
||||
Out << "\");\n";
|
||||
printModuleBody();
|
||||
Out << "\nreturn mod;\n";
|
||||
Out << "\n}\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user