Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
dbba0ff8
Commit
dbba0ff8
authored
Jun 15, 2009
by
Roberto Raggi
Browse files
Removed the filename literals.
parent
1754aefd
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/CppDocument.cpp
View file @
dbba0ff8
...
...
@@ -110,8 +110,8 @@ Document::Document(const QString &fileName)
_control
->
setDiagnosticClient
(
new
DocumentDiagnosticClient
(
this
,
&
_diagnosticMessages
));
const
QByteArray
localFileName
=
fileName
.
toUtf8
();
StringLiteral
*
fileId
=
_control
->
findOrInsert
FileName
(
localFileName
.
constData
(),
localFileName
.
size
());
StringLiteral
*
fileId
=
_control
->
findOrInsert
StringLiteral
(
localFileName
.
constData
(),
localFileName
.
size
());
_translationUnit
=
new
TranslationUnit
(
_control
,
fileId
);
_translationUnit
->
setQtMocRunEnabled
(
true
);
_translationUnit
->
setObjCEnabled
(
true
);
...
...
src/shared/cplusplus/Control.cpp
View file @
dbba0ff8
...
...
@@ -449,7 +449,6 @@ public:
LiteralTable
<
Identifier
>
identifiers
;
LiteralTable
<
StringLiteral
>
stringLiterals
;
LiteralTable
<
NumericLiteral
>
numericLiterals
;
LiteralTable
<
StringLiteral
>
fileNames
;
// ### replace std::map with lookup tables. ASAP!
...
...
@@ -534,12 +533,6 @@ Control::NumericLiteralIterator Control::firstNumericLiteral() const
Control
::
NumericLiteralIterator
Control
::
lastNumericLiteral
()
const
{
return
d
->
numericLiterals
.
end
();
}
Control
::
FileNameIterator
Control
::
firstFileName
()
const
{
return
d
->
fileNames
.
begin
();
}
Control
::
FileNameIterator
Control
::
lastFileName
()
const
{
return
d
->
fileNames
.
end
();
}
StringLiteral
*
Control
::
findOrInsertStringLiteral
(
const
char
*
chars
,
unsigned
size
)
{
return
d
->
stringLiterals
.
findOrInsertLiteral
(
chars
,
size
);
}
...
...
@@ -558,21 +551,6 @@ NumericLiteral *Control::findOrInsertNumericLiteral(const char *chars)
return
findOrInsertNumericLiteral
(
chars
,
length
);
}
unsigned
Control
::
fileNameCount
()
const
{
return
d
->
fileNames
.
size
();
}
StringLiteral
*
Control
::
fileNameAt
(
unsigned
index
)
const
{
return
d
->
fileNames
.
at
(
index
);
}
StringLiteral
*
Control
::
findOrInsertFileName
(
const
char
*
chars
,
unsigned
size
)
{
return
d
->
fileNames
.
findOrInsertLiteral
(
chars
,
size
);
}
StringLiteral
*
Control
::
findOrInsertFileName
(
const
char
*
chars
)
{
unsigned
length
=
std
::
char_traits
<
char
>::
length
(
chars
);
return
findOrInsertFileName
(
chars
,
length
);
}
NameId
*
Control
::
nameId
(
Identifier
*
id
)
{
return
d
->
findOrInsertNameId
(
id
);
}
...
...
src/shared/cplusplus/Control.h
View file @
dbba0ff8
...
...
@@ -153,7 +153,6 @@ public:
typedef
const
Identifier
*
const
*
IdentifierIterator
;
typedef
const
StringLiteral
*
const
*
StringLiteralIterator
;
typedef
const
NumericLiteral
*
const
*
NumericLiteralIterator
;
typedef
const
StringLiteral
*
const
*
FileNameIterator
;
IdentifierIterator
firstIdentifier
()
const
;
IdentifierIterator
lastIdentifier
()
const
;
...
...
@@ -164,21 +163,12 @@ public:
NumericLiteralIterator
firstNumericLiteral
()
const
;
NumericLiteralIterator
lastNumericLiteral
()
const
;
FileNameIterator
firstFileName
()
const
;
FileNameIterator
lastFileName
()
const
;
StringLiteral
*
findOrInsertStringLiteral
(
const
char
*
chars
,
unsigned
size
);
StringLiteral
*
findOrInsertStringLiteral
(
const
char
*
chars
);
NumericLiteral
*
findOrInsertNumericLiteral
(
const
char
*
chars
,
unsigned
size
);
NumericLiteral
*
findOrInsertNumericLiteral
(
const
char
*
chars
);
StringLiteral
*
findOrInsertFileName
(
const
char
*
chars
,
unsigned
size
);
StringLiteral
*
findOrInsertFileName
(
const
char
*
chars
);
unsigned
fileNameCount
()
const
;
StringLiteral
*
fileNameAt
(
unsigned
index
)
const
;
private:
class
Data
;
friend
class
Data
;
...
...
src/shared/cplusplus/TranslationUnit.cpp
View file @
dbba0ff8
...
...
@@ -212,8 +212,8 @@ void TranslationUnit::tokenize()
unsigned
line
=
(
unsigned
)
strtoul
(
tk
.
spell
(),
0
,
0
);
lex
(
&
tk
);
if
(
!
tk
.
newline
&&
tk
.
is
(
T_STRING_LITERAL
))
{
StringLiteral
*
fileName
=
control
()
->
findOrInsert
FileName
(
tk
.
string
->
chars
(),
tk
.
string
->
size
());
StringLiteral
*
fileName
=
control
()
->
findOrInsert
StringLiteral
(
tk
.
string
->
chars
(),
tk
.
string
->
size
());
pushPreprocessorLine
(
offset
,
line
,
fileName
);
lex
(
&
tk
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment