Changeset 68521 in webkit


Ignore:
Timestamp:
Sep 28, 2010 9:01:47 AM (14 years ago)
Author:
abecsi@webkit.org
Message:

2010-09-28 Andras Becsi <abecsi@webkit.org>

Reviewed by Csaba Osztrogonác.

Undefined reference errors when linking due to gperf and inlining.
webkit.org/b/29244

EFL CMake changes by Leandro Pereira <leandro@profusion.mobi>

Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
to access the functionality provided. This resulted in debug build failure with newer gcc versions
because of a behaviour change of gcc, which disables C style inlining in debug mode.
The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
in their own compilation unit.
The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
for multiple inclusions of generated C files to access these functions.

  • WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::createPlugin):

2010-09-28 Andras Becsi <abecsi@webkit.org>

Reviewed by Csaba Osztrogonác.

Undefined reference errors when linking due to gperf and inlining.
webkit.org/b/29244

EFL CMake changes by Leandro Pereira <leandro@profusion.mobi>

Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
to access the functionality provided. This resulted in debug build failure with newer gcc versions
because of a behaviour change of gcc, which disables C style inlining in debug mode.
The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
in their own compilation unit.
The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
for multiple inclusions of generated C files to access these functions.

No new tests needed.

  • CMakeLists.txt:
  • WebCore.gyp/WebCore.gyp:
  • WebCore.pri:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • css/CSSParser.cpp:
  • css/makeprop.pl:
  • css/makevalues.pl:
  • html/DocTypeStrings.gperf:
  • html/HTMLDocument.cpp:
  • make-hash-tools.pl:
  • platform/ColorData.gperf:
  • platform/graphics/Color.cpp:

2010-09-28 Andras Becsi <abecsi@webkit.org>

Reviewed by Csaba Osztrogonác.

Undefined reference errors when linking due to gperf and inlining.
webkit.org/b/29244

EFL CMake changes by Leandro Pereira <leandro@profusion.mobi>

Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
to access the functionality provided. This resulted in debug build failure with newer gcc versions
because of a behaviour change of gcc, which disables C style inlining in debug mode.
The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
in their own compilation unit.
The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
for multiple inclusions of generated C files to access these functions.

  • cmake/WebKitMacros.cmake:
Location:
trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r68405 r68521  
     12010-09-28  Andras Becsi  <abecsi@webkit.org>
     2
     3        Reviewed by Csaba Osztrogonác.
     4
     5        Undefined reference errors when linking due to gperf and inlining.
     6        webkit.org/b/29244
     7
     8        EFL CMake changes by Leandro Pereira <leandro@profusion.mobi>
     9
     10        Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
     11        Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
     12        to access the functionality provided. This resulted in debug build failure with newer gcc versions
     13        because of a behaviour change of gcc, which disables C style inlining in debug mode.
     14        The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
     15        in their own compilation unit.
     16        The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
     17        for multiple inclusions of generated C files to access these functions.
     18
     19        * cmake/WebKitMacros.cmake:
     20
    1212010-09-27  Philippe Normand  <pnormand@igalia.com>
    222
  • trunk/WebCore/CMakeLists.txt

    r68440 r68521  
    537537
    538538SET(WebCore_SOURCES
     539    ${DERIVED_SOURCES_DIR}/DocTypeStrings.cpp
     540    ${DERIVED_SOURCES_DIR}/CSSValueKeywords.cpp
     541    ${DERIVED_SOURCES_DIR}/CSSPropertyNames.cpp
     542    ${DERIVED_SOURCES_DIR}/ColorData.cpp
    539543    ${DERIVED_SOURCES_DIR}/HTMLEntityTable.cpp
    540544    ${DERIVED_SOURCES_DIR}/UserAgentStyleSheetsData.cpp
     
    19101914GENERATE_ENTITIES(${WEBCORE_DIR}/html/parser/HTMLEntityNames.in ${DERIVED_SOURCES_DIR}/HTMLEntityTable.cpp ${WEBCORE_DIR}/html/parser/create-html-entity-table)
    19111915
    1912 
    1913 GENERATE_GPERF(${WEBCORE_DIR}/platform/ColorData.gperf ${DERIVED_SOURCES_DIR}/ColorData.cpp findColor "")
     1916MAKE_HASH_TOOLS(${WEBCORE_DIR}/platform/ColorData)
    19141917ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/platform/graphics/Color.cpp ColorData.cpp)
    19151918
    1916 
    1917 GENERATE_GPERF(${WEBCORE_DIR}/html/DocTypeStrings.gperf ${DERIVED_SOURCES_DIR}/DocTypeStrings.cpp findDoctypeEntry "-F,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards")
     1919MAKE_HASH_TOOLS(${WEBCORE_DIR}/html/DocTypeStrings)
    19181920ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLDocument.cpp DocTypeStrings.cpp)
    19191921
     
    19351937
    19361938
     1939ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/HashTools.h DocTypeStrings.cpp CSSValueKeywords.cpp CSSPropertyNames.cpp ColorData.cpp)
    19371940ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/CSSGrammar.cpp CSSValueKeywords.h)
    19381941ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/CSSGrammar.cpp CSSPropertyNames.h)
  • trunk/WebCore/ChangeLog

    r68513 r68521  
     12010-09-28  Andras Becsi  <abecsi@webkit.org>
     2
     3        Reviewed by Csaba Osztrogonác.
     4
     5        Undefined reference errors when linking due to gperf and inlining.
     6        webkit.org/b/29244
     7
     8        EFL CMake changes by Leandro Pereira <leandro@profusion.mobi>
     9
     10        Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
     11        Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
     12        to access the functionality provided. This resulted in debug build failure with newer gcc versions
     13        because of a behaviour change of gcc, which disables C style inlining in debug mode.
     14        The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
     15        in their own compilation unit.
     16        The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
     17        for multiple inclusions of generated C files to access these functions.
     18
     19        No new tests needed.
     20
     21        * CMakeLists.txt:
     22        * WebCore.gyp/WebCore.gyp:
     23        * WebCore.pri:
     24        * WebCore.vcproj/WebCore.vcproj:
     25        * WebCore.xcodeproj/project.pbxproj:
     26        * css/CSSParser.cpp:
     27        * css/makeprop.pl:
     28        * css/makevalues.pl:
     29        * html/DocTypeStrings.gperf:
     30        * html/HTMLDocument.cpp:
     31        * make-hash-tools.pl:
     32        * platform/ColorData.gperf:
     33        * platform/graphics/Color.cpp:
     34
    1352010-09-28  Andreas Kling  <andreas.kling@nokia.com>
    236
  • trunk/WebCore/WebCore.gyp/WebCore.gyp

    r67922 r68521  
    647647            '<(RULE_INPUT_PATH)',
    648648          ],
    649           'process_outputs_as_sources': 0,
    650649        },
    651650        # Rule to build generated JavaScript (V8) bindings from .idl source.
     
    743742        # in webcore_files.
    744743        '<@(derived_sources_aggregate_files)',
     744
     745        # Additional .cpp files for HashTools.h
     746        '<(SHARED_INTERMEDIATE_DIR)/webkit/DocTypeStrings.cpp',
     747        '<(SHARED_INTERMEDIATE_DIR)/webkit/ColorData.cpp',
     748        '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.cpp',
     749        '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.cpp',
    745750
    746751        # Additional .cpp files from webcore_bindings_sources actions.
  • trunk/WebCore/WebCore.pri

    r68440 r68521  
    548548cssprops.input = WALDOCSSPROPS
    549549cssprops.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES} > $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.in && cd $$WC_GENERATED_SOURCES_DIR && perl $$cssprops.wkScript && $(DEL_FILE) ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.gperf
    550 cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES}
     550cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES} $$cssprops.wkScript
    551551addExtraCompiler(cssprops)
    552552
     
    556556cssvalues.input = WALDOCSSVALUES
    557557cssvalues.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $$EXTRACSSVALUES > $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.in && cd $$WC_GENERATED_SOURCES_DIR && perl $$cssvalues.wkScript && $(DEL_FILE) ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.gperf
    558 cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES}
     558cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES} $$cssvalues.wkScript
    559559cssvalues.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.h
    560560addExtraCompiler(cssvalues)
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r68440 r68521  
    546546                        </File>
    547547                        <File
     548                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\HashTools.h"
     549                                >
     550                        </File>
     551                        <File
     552                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\DocTypeStrings.cpp"
     553                                >
     554                        </File>
     555                        <File
     556                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\CSSValueKeywords.cpp"
     557                                >
     558                        </File>
     559                        <File
     560                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\CSSPropertyNames.cpp"
     561                                >
     562                        </File>
     563                        <File
     564                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\ColorData.cpp"
     565                                >
     566                        </File>
     567                        <File
    548568                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\InspectorBackendDispatcher.cpp"
    549569                                >
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r68500 r68521  
    496496                1AB7FC870A8B92EC00D9D37B /* XPathVariableReference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7FC660A8B92EC00D9D37B /* XPathVariableReference.cpp */; };
    497497                1AB7FC880A8B92EC00D9D37B /* XPathVariableReference.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7FC670A8B92EC00D9D37B /* XPathVariableReference.h */; };
     498                1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FB1198307D009D59D6 /* ColorData.cpp */; };
     499                1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */; };
     500                1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA0391198374900710BC5 /* CSSValueKeywords.cpp */; };
     501                1ABA76CC11D20E5B004C201C /* DocTypeStrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FA1198304D009D59D6 /* DocTypeStrings.cpp */; };
    498502                1ABFE7530CD968D000FE4834 /* SQLTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ABFE7520CD968D000FE4834 /* SQLTransaction.cpp */; };
    499503                1AC2260C0DB69F190089B669 /* JSDOMApplicationCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC2260A0DB69F190089B669 /* JSDOMApplicationCache.cpp */; };
     
    2090320907                        buildActionMask = 2147483647;
    2090420908                        files = (
     20909                                1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */,
     20910                                1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */,
     20911                                1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */,
     20912                                1ABA76CC11D20E5B004C201C /* DocTypeStrings.cpp in Sources */,
    2090520913                                B5B5DC69119BB3D5002A8790 /* AbstractDatabase.cpp in Sources */,
    2090620914                                41E1B1D00FF5986900576B3B /* AbstractWorker.cpp in Sources */,
  • trunk/WebCore/css/CSSParser.cpp

    r67882 r68521  
    6363#include "FontFamilyValue.h"
    6464#include "FontValue.h"
     65#include "HashTools.h"
    6566#include "MediaList.h"
    6667#include "MediaQueryExp.h"
     
    8990using namespace std;
    9091using namespace WTF;
    91 
    92 #include "CSSPropertyNames.cpp"
    93 #include "CSSValueKeywords.cpp"
    9492
    9593namespace WebCore {
  • trunk/WebCore/css/makeprop.pl

    r65942 r68521  
    4242%}
    4343%struct-type
    44 struct Property {
    45     const char* name;
    46     int id;
    47 };
    48 %language=ANSI-C
     44struct Property;
     45%omit-struct-type
     46%language=C++
    4947%readonly-tables
    5048%global-table
    5149%compare-strncmp
    52 %define lookup-function-name findProperty
     50%define class-name CSSPropertyNamesHash
     51%define lookup-function-name findPropertyImpl
    5352%define hash-function-name propery_hash_function
    5453%define word-array-name property_wordlist
     
    7271#ifndef CSSPropertyNames_h
    7372#define CSSPropertyNames_h
     73
     74#include <string.h>
     75
     76namespace WebCore {
    7477
    7578enum CSSPropertyID {
     
    106109const char* getPropertyName(CSSPropertyID);
    107110
     111} // namespace WebCore
     112
    108113#endif // CSSPropertyNames_h
    109114
     
    112117close HEADER;
    113118
    114 system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNames.cpp") == 0 || die "calling gperf failed: $?";
     119system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNamesHash.h") == 0 || die "calling gperf failed: $?";
    115120
    116 open C, ">>CSSPropertyNames.cpp" || die "Could not open CSSPropertyNames.cpp for writing";
     121open C, ">>CSSPropertyNamesHash.h" || die "Could not open CSSPropertyNamesHash.h for writing";
    117122print C << "EOF";
     123
     124EOF
     125
     126close C;
     127
     128my $propertyNamesImpl = "CSSPropertyNames.cpp";
     129
     130open PROPERTYNAMES, ">$propertyNamesImpl" || die "Could not open $propertyNamesImpl for writing";
     131print PROPERTYNAMES << "EOF";
     132/* This file is automatically generated by make-hash-tools.pl, do not edit */
     133
     134
     135#include "CSSPropertyNames.h"
     136#include "HashTools.h"
     137
     138namespace WebCore {
     139#include "CSSPropertyNamesHash.h"
     140
     141const Property* findProperty (register const char* str, register unsigned int len)
     142{
     143    return CSSPropertyNamesHash::findPropertyImpl(str, len);
     144}
    118145
    119146const char* getPropertyName(CSSPropertyID id)
     
    126153    return propertyNameStrings[index];
    127154}
     155
     156} // namespace WebCore
     157
    128158EOF
    129159
    130 close C;
     160close PROPERTYNAMES;
    131161
  • trunk/WebCore/css/makevalues.pl

    r61091 r68521  
    4343%}
    4444%struct-type
    45 struct Value {
    46     const char* name;
    47     int id;
    48 };
    49 %language=ANSI-C
     45struct Value;
     46%omit-struct-type
     47%language=C++
    5048%readonly-tables
    5149%compare-strncmp
    52 %define lookup-function-name findValue
     50%define class-name CSSValueKeywordsHash
     51%define lookup-function-name findValueImpl
    5352%define hash-function-name value_hash_function
    5453%define word-array-name value_word_list
     
    7372#define CSSValueKeywords_h
    7473
     74#include <string.h>
     75
     76namespace WebCore {
     77
    7578const int CSSValueInvalid = 0;
    7679EOF
     
    9396const char* getValueName(unsigned short id);
    9497
     98} // namespace WebCore
     99
    95100#endif // CSSValueKeywords_h
     101
    96102EOF
    97103close HEADER;
    98104
    99 system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywords.cpp") == 0 || die "calling gperf failed: $?";
     105system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywordsHash.h") == 0 || die "calling gperf failed: $?";
    100106
    101 open C, ">>CSSValueKeywords.cpp" || die "Could not open CSSValueKeywords.cpp for writing";
     107open C, ">>CSSValueKeywordsHash.h" || die "Could not open CSSValueKeywordsHash.h for writing";
    102108print C  "static const char * const valueList[] = {\n";
    103109print C  "\"\",\n";
     
    108114    0
    109115};
     116
     117EOF
     118
     119close C;
     120
     121my $valueKeywordsImpl = "CSSValueKeywords.cpp";
     122
     123open VALUEKEYWORDS, ">$valueKeywordsImpl" || die "Could not open $valueKeywordsImpl for writing";
     124print VALUEKEYWORDS << "EOF";
     125/* This file is automatically generated by make-hash-tools.pl, do not edit */
     126
     127#include "CSSValueKeywords.h"
     128#include "HashTools.h"
     129
     130namespace WebCore {
     131#include "CSSValueKeywordsHash.h"
     132
     133const Value* findValue (register const char* str, register unsigned int len)
     134{
     135    return CSSValueKeywordsHash::findValueImpl(str, len);
     136}
     137
    110138const char* getValueName(unsigned short id)
    111139{
     
    114142    return valueList[id];
    115143}
     144
     145} // namespace WebCore
     146
    116147EOF
    117148
    118 close C;
     149close VALUEKEYWORDS;
     150
  • trunk/WebCore/html/DocTypeStrings.gperf

    r61091 r68521  
    11%struct-type
    2 struct PubIDInfo {
    3     enum eMode {
    4         eQuirks,         
    5         eQuirks3,       
    6         eAlmostStandards
    7     };
    8 
    9     const char* name;
    10     eMode mode_if_no_sysid;
    11     eMode mode_if_sysid;
    12 }
    13 %language=ANSI-C
     2struct PubIDInfo;
     3%omit-struct-type
     4%language=C++
    145%readonly-tables
    156%global-table
    167%compare-strncmp
     8%define class-name DocTypeStringsHash
    179%define initializer-suffix ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards
    18 %define lookup-function-name findDoctypeEntry
     10%define lookup-function-name findDoctypeEntryImpl
    1911%define hash-function-name doctype_hash_function
    2012%includes
  • trunk/WebCore/html/HTMLDocument.cpp

    r67512 r68521  
    6565#include "FrameTree.h"
    6666#include "FrameView.h"
     67#include "HashTools.h"
    6768#include "HTMLDocumentParser.h"
    6869#include "HTMLBodyElement.h"
     
    7475#include "Settings.h"
    7576#include <wtf/text/CString.h>
    76 
    77 #include "DocTypeStrings.cpp"
    7877
    7978namespace WebCore {
  • trunk/WebCore/make-hash-tools.pl

    r65351 r68521  
    2828my $option = basename($ARGV[0],".gperf");
    2929
     30my $hashToolsHeader = "$outdir/HashTools.h";
     31
     32sub createHashToolsHeader() {
     33
     34open HEADER, ">$hashToolsHeader" || die "Could not open $hashToolsHeader for writing";
     35print HEADER << "EOF";
     36/* This file is automatically generated by make-hash-tools.pl, do not edit */
     37
     38#ifndef HashTools_h
     39#define HashTools_h
     40
     41#include "wtf/Platform.h"
     42
     43namespace WebCore {
     44
     45struct PubIDInfo {
     46    enum eMode {
     47        eQuirks,
     48        eQuirks3,
     49        eAlmostStandards
     50    };
     51
     52    const char* name;
     53    eMode mode_if_no_sysid;
     54    eMode mode_if_sysid;
     55};
     56
     57struct NamedColor {
     58    const char* name;
     59    int RGBValue;
     60};
     61
     62struct Property {
     63    const char* name;
     64    int id;
     65};
     66
     67struct Value {
     68    const char* name;
     69    int id;
     70};
     71
     72const PubIDInfo* findDoctypeEntry(register const char* str, register unsigned int len);
     73const NamedColor* findColor(register const char* str, register unsigned int len);
     74const Property* findProperty(register const char* str, register unsigned int len);
     75const Value* findValue(register const char* str, register unsigned int len);
     76}
     77
     78#endif // HashTools_h
     79
     80EOF
     81close HEADER;
     82
     83}
     84
    3085switch ($option) {
    3186
    3287case "DocTypeStrings" {
    3388
    34     my $docTypeStringsGenerated    = "$outdir/DocTypeStrings.cpp";
     89    createHashToolsHeader();
     90
     91    my $docTypeStringsImpl         = "$outdir/DocTypeStrings.cpp";
     92    my $docTypeStringsGenerated    = "$outdir/DocTypeStringsHash.h";
    3593    my $docTypeStringsGperf        = $ARGV[0];
    3694    shift;
     95
     96    open DOCTYPESTRINGS, ">$docTypeStringsImpl" || die "Could not open $docTypeStringsImpl for writing";
     97    print DOCTYPESTRINGS << "EOF";
     98/* This file is automatically generated by make-hash-tools.pl, do not edit */
     99
     100#include "HashTools.h"
     101
     102namespace WebCore {
     103#include "DocTypeStringsHash.h"
     104
     105const PubIDInfo* findDoctypeEntry (register const char* str, register unsigned int len)
     106{
     107    return DocTypeStringsHash::findDoctypeEntryImpl(str, len);
     108}
     109
     110}
     111
     112EOF
     113    close DOCTYPESTRINGS;
    37114
    38115    system("gperf --key-positions=\"*\" -s 2 $docTypeStringsGperf > $docTypeStringsGenerated") == 0 || die "calling gperf failed: $?";
     
    42119case "ColorData" {
    43120
    44     my $colorDataGenerated   = "$outdir/ColorData.cpp";
    45     my $colorDataGperf       = $ARGV[0];
     121    my $colorDataImpl              = "$outdir/ColorData.cpp";
     122    my $colorDataGenerated         = "$outdir/ColorDataHash.h";
     123    my $colorDataGperf             = $ARGV[0];
    46124    shift;
     125
     126    open COLORDATA, ">$colorDataImpl" || die "Could not open $colorDataImpl for writing";
     127    print COLORDATA << "EOF";
     128/* This file is automatically generated by make-hash-tools.pl, do not edit */
     129
     130#include "HashTools.h"
     131
     132namespace WebCore {
     133#include "ColorDataHash.h"
     134
     135const struct NamedColor* findColor (register const char* str, register unsigned int len)
     136{
     137    return ColorDataHash::findColorImpl(str, len);
     138}
     139
     140}
     141
     142EOF
     143    close COLORDATA;
    47144
    48145    system("gperf --key-positions=\"*\" -D -s 2 $colorDataGperf > $colorDataGenerated") == 0 || die "calling gperf failed: $?";
  • trunk/WebCore/platform/ColorData.gperf

    r61091 r68521  
    11%struct-type
    2 struct NamedColor {
    3     const char *name;
    4     int RGBValue;
    5 };
    6 %language=ANSI-C
     2struct NamedColor;
     3%omit-struct-type
     4%language=C++
    75%readonly-tables
    86%global-table
    97%compare-strncmp
    10 %define lookup-function-name findColor
     8%define class-name ColorDataHash
     9%define lookup-function-name findColorImpl
    1110%define hash-function-name colordata_hash_function
    1211%includes
  • trunk/WebCore/platform/graphics/Color.cpp

    r63126 r68521  
    2727#include "Color.h"
    2828
     29#include "HashTools.h"
    2930#include "PlatformString.h"
    3031#include <math.h>
    3132#include <wtf/Assertions.h>
    3233#include <wtf/MathExtras.h>
    33 
    34 #include "ColorData.cpp"
    3534
    3635using namespace std;
  • trunk/WebKit/qt/ChangeLog

    r68517 r68521  
     12010-09-28  Andras Becsi  <abecsi@webkit.org>
     2
     3        Reviewed by Csaba Osztrogonác.
     4
     5        Undefined reference errors when linking due to gperf and inlining.
     6        webkit.org/b/29244
     7
     8        EFL CMake changes by Leandro Pereira <leandro@profusion.mobi>
     9
     10        Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
     11        Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
     12        to access the functionality provided. This resulted in debug build failure with newer gcc versions
     13        because of a behaviour change of gcc, which disables C style inlining in debug mode.
     14        The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
     15        in their own compilation unit.
     16        The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
     17        for multiple inclusions of generated C files to access these functions.
     18
     19        * WebCoreSupport/FrameLoaderClientQt.cpp:
     20        (WebCore::FrameLoaderClientQt::createPlugin):
     21
    1222010-09-28  Benjamin Poulain  <benjamin.poulain@nokia.com>
    223
  • trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp

    r68517 r68521  
    14521452                CSSPropertyID property = qstyleSheetProperties[i];
    14531453
    1454                 styleSheet += QString::fromLatin1(::getPropertyName(property));
     1454                styleSheet += QString::fromLatin1(getPropertyName(property));
    14551455                styleSheet += QLatin1Char(':');
    14561456                styleSheet += computedStyle(element)->getPropertyValue(property);
  • trunk/cmake/WebKitMacros.cmake

    r66319 r68521  
    8585ENDMACRO ()
    8686
     87MACRO(MAKE_HASH_TOOLS _source)
     88    GET_FILENAME_COMPONENT(_name ${_source} NAME_WE)
    8789
    88 MACRO (GENERATE_GPERF _input _output _func _opts)
     90    IF (${_source} STREQUAL "DocTypeStrings")
     91        SET(_hash_tools_h "${DERIVED_SOURCES_DIR}/HashTools.h")
     92    ELSE ()
     93        SET(_hash_tools_h "")
     94    ENDIF ()
     95
    8996    ADD_CUSTOM_COMMAND(
    90         OUTPUT ${_output}
    91         MAIN_DEPENDENCY ${_input}
    92         COMMAND ${GPERF_EXECUTABLE} -CDEGIot -L ANSI-C --key-positions=* -s 2 -N ${_func} ${_opts} < ${_input} > ${_output}
     97        OUTPUT ${DERIVED_SOURCES_DIR}/${_name}.cpp ${_hash_tools_h}
     98        MAIN_DEPENDENCY ${_source}.gperf
     99        COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/make-hash-tools.pl ${DERIVED_SOURCES_DIR} ${_source}.gperf
    93100        VERBATIM)
    94 ENDMACRO ()
    95101
     102    UNSET(_name)
     103    UNSET(_hash_tools_h)
     104ENDMACRO()
    96105
    97106MACRO (WEBKIT_WRAP_SOURCELIST _input)
Note: See TracChangeset for help on using the changeset viewer.