Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
m417z
kdlibcpp
Commits
b4c87cee
Commit
b4c87cee
authored
Apr 27, 2018
by
Mikhail I. Izmestev
Browse files
Revert "Merge branch 'fields_cache' into 'dev-1.0'"
This reverts merge request
!6
parent
bb8a2859
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
34 deletions
+15
-34
kdlib/source/clang/clang.cpp
kdlib/source/clang/clang.cpp
+1
-1
kdlib/source/clang/clang.h
kdlib/source/clang/clang.h
+1
-1
kdlib/source/customtypes.cpp
kdlib/source/customtypes.cpp
+1
-1
kdlib/source/net/nettype.h
kdlib/source/net/nettype.h
+1
-1
kdlib/source/typeinfo.cpp
kdlib/source/typeinfo.cpp
+0
-25
kdlib/source/typeinfoimp.h
kdlib/source/typeinfoimp.h
+11
-5
No files found.
kdlib/source/clang/clang.cpp
View file @
b4c87cee
...
...
@@ -208,7 +208,7 @@ TypeInfoPtr TypeFieldClangField::getTypeInfo()
///////////////////////////////////////////////////////////////////////////////
TypeInfoClangStruct
::
TypeInfoClangStruct
(
const
std
::
wstring
&
name
,
ClangASTSessionPtr
&
session
,
clang
::
RecordDecl
*
decl
)
:
TypeInfoFields
(
name
,
L""
),
TypeInfoFields
(
name
),
m_astSession
(
session
),
m_decl
(
decl
)
{
...
...
kdlib/source/clang/clang.h
View file @
b4c87cee
...
...
@@ -279,7 +279,7 @@ class TypeInfoClangEnum : public TypeInfoFields
public:
TypeInfoClangEnum
(
ClangASTSessionPtr
&
session
,
clang
::
EnumDecl
*
decl
)
:
TypeInfoFields
(
strToWStr
(
decl
->
getNameAsString
())
,
L""
),
TypeInfoFields
(
strToWStr
(
decl
->
getNameAsString
())),
m_astSession
(
session
),
m_decl
(
decl
)
{}
...
...
kdlib/source/customtypes.cpp
View file @
b4c87cee
...
...
@@ -14,7 +14,7 @@ class CustomBase : public TypeInfoFields {
protected:
CustomBase
(
const
std
::
wstring
&
name
,
size_t
align
)
:
TypeInfoFields
(
name
,
L""
)
TypeInfoFields
(
name
)
{
m_align
=
align
?
align
:
ptrSize
();
m_size
=
0
;
...
...
kdlib/source/net/nettype.h
View file @
b4c87cee
...
...
@@ -322,7 +322,7 @@ public:
private:
NetTypeClass
(
COR_TYPEID
&
typeId
,
MetaDataProviderPtr
&
metaProvider
,
const
std
::
wstring
&
name
,
mdTypeDef
token
)
:
TypeInfoFields
(
name
,
L""
),
TypeInfoFields
(
name
),
m_typeId
(
typeId
),
m_metaProvider
(
metaProvider
),
m_name
(
name
),
...
...
kdlib/source/typeinfo.cpp
View file @
b4c87cee
...
...
@@ -1064,31 +1064,6 @@ size_t TypeInfoFields::getAlignReq()
return
alignReq
;
}
typedef
std
::
map
<
std
::
pair
<
std
::
wstring
,
std
::
wstring
>
,
FieldCollection
>
TypeInfoFieldsCache
;
static
TypeInfoFieldsCache
fieldsCache
;
void
TypeInfoFields
::
checkFields
()
{
if
(
!
m_fieldsGot
)
{
if
(
!
m_scopeName
.
empty
())
{
TypeInfoFieldsCache
::
key_type
cacheKey
(
m_scopeName
,
m_name
);
TypeInfoFieldsCache
::
iterator
fields
=
fieldsCache
.
find
(
cacheKey
);
if
(
fields
!=
fieldsCache
.
end
())
m_fields
=
fields
->
second
;
else
{
getFields
();
fieldsCache
.
insert
(
std
::
make_pair
(
cacheKey
,
m_fields
));
}
}
else
getFields
();
m_fieldsGot
=
true
;
}
}
///////////////////////////////////////////////////////////////////////////////
void
TypeInfoUdt
::
getVirtualDisplacement
(
const
std
::
wstring
&
fieldName
,
MEMOFFSET_32
&
virtualBasePtr
,
size_t
&
virtualDispIndex
,
size_t
&
virtualDispSize
)
...
...
kdlib/source/typeinfoimp.h
View file @
b4c87cee
...
...
@@ -348,17 +348,15 @@ protected:
protected:
TypeInfoFields
(
const
std
::
wstring
&
name
,
const
std
::
wstring
&
scopeName
)
:
TypeInfoFields
(
const
std
::
wstring
&
name
)
:
m_fields
(
name
),
m_name
(
name
),
m_scopeName
(
scopeName
),
m_fieldsGot
(
false
)
{}
FieldCollection
m_fields
;
std
::
wstring
m_name
;
std
::
wstring
m_scopeName
;
virtual
void
getFields
()
=
0
;
...
...
@@ -366,7 +364,15 @@ private:
bool
m_fieldsGot
;
void
checkFields
();
void
checkFields
()
{
if
(
!
m_fieldsGot
)
{
getFields
();
m_fieldsGot
=
true
;
}
}
};
///////////////////////////////////////////////////////////////////////////////
...
...
@@ -375,7 +381,7 @@ class SymbolFields : public TypeInfoFields
{
public:
SymbolFields
(
SymbolPtr
&
symbol
)
:
TypeInfoFields
(
symbol
->
getName
()
,
symbol
->
getScopeName
()
),
TypeInfoFields
(
symbol
->
getName
()
),
m_symbol
(
symbol
)
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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