diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-08-15 09:23:42 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-08-15 10:35:47 +0200 |
commit | 3ccd69b53688d6855d0136873876ed315d99b571 (patch) | |
tree | 6cf9a2308f671b080df72569e580b7af5cb72ae3 /src/qml/compiler/qv4codegen.cpp | |
parent | a9346f9b43f0657dc97957e922e5764702c9c511 (diff) |
Store the file name per compilation unit, not per compiled function
Change-Id: Id699897b241a9ff6495689e5685092d311acb8c2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 969b35831e..3e1cfc23cc 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -490,10 +490,11 @@ V4IR::Function *Codegen::operator()(const QString &fileName, { assert(node); - _fileName = fileName; _module = module; _env = 0; + _module->setFileName(fileName); + ScanFunctions scan(this, sourceCode); scan(node); @@ -510,8 +511,8 @@ V4IR::Function *Codegen::operator()(const QString &fileName, AST::FunctionExpression *ast, V4IR::Module *module) { - _fileName = fileName; _module = module; + _module->setFileName(fileName); _env = 0; ScanFunctions scan(this, sourceCode); @@ -1808,7 +1809,6 @@ V4IR::Function *Codegen::defineFunction(const QString &name, AST::Node *ast, enterEnvironment(ast); V4IR::Function *function = _module->newFunction(name, _function); - function->sourceFile = _fileName; V4IR::BasicBlock *entryBlock = function->newBasicBlock(groupStartBlock()); V4IR::BasicBlock *exitBlock = function->newBasicBlock(groupStartBlock(), V4IR::Function::DontInsertBlock); @@ -2581,7 +2581,7 @@ void Codegen::throwSyntaxErrorOnEvalOrArgumentsInStrictMode(V4IR::Expr *expr, co void Codegen::throwSyntaxError(const SourceLocation &loc, const QString &detail) { QV4::DiagnosticMessage *msg = new QV4::DiagnosticMessage; - msg->fileName = _fileName; + msg->fileName = _module->fileName; msg->offset = loc.begin(); msg->startLine = loc.startLine; msg->startColumn = loc.startColumn; @@ -2597,7 +2597,7 @@ void Codegen::throwSyntaxError(const SourceLocation &loc, const QString &detail) void Codegen::throwReferenceError(const SourceLocation &loc, const QString &detail) { if (_context) - _context->throwReferenceError(QV4::Value::fromString(_context, detail), _fileName, loc.startLine); + _context->throwReferenceError(QV4::Value::fromString(_context, detail), _module->fileName, loc.startLine); else if (_errorHandler) throwSyntaxError(loc, detail); else |