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
c2f23175
Commit
c2f23175
authored
May 10, 2010
by
Roberto Raggi
Browse files
Check for valid translation units.
parent
9190fce7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/shared/cplusplus/Symbol.cpp
View file @
c2f23175
...
...
@@ -209,18 +209,17 @@ void Symbol::setDeprecated(bool isDeprecated)
void
Symbol
::
setSourceLocation
(
unsigned
sourceLocation
,
TranslationUnit
*
translationUnit
)
{
_sourceLocation
=
sourceLocation
;
unsigned
offset
=
0
;
if
(
!
_sourceLocation
)
{
_isGenerated
=
false
;
}
else
{
if
(
translationUnit
)
{
const
Token
&
tk
=
translationUnit
->
tokenAt
(
sourceLocation
);
_isGenerated
=
tk
.
f
.
generated
;
offset
=
tk
.
offset
;
translationUnit
->
getPosition
(
tk
.
offset
,
&
_line
,
&
_column
,
&
_fileId
);
}
else
{
_isGenerated
=
false
;
_line
=
0
;
_column
=
0
;
_fileId
=
0
;
}
translationUnit
->
getPosition
(
offset
,
&
_line
,
&
_column
,
&
_fileId
);
}
unsigned
Symbol
::
line
()
const
...
...
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