00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <iostream>
00023
00024 #include <stdlib.h>
00025 #include <string.h>
00026
00027
00028
00029
00030
00031 #include "XAIFStrings.h"
00032
00033
00034
00035 using std::cerr;
00036 using std::endl;
00037
00038
00039
00040 XAIFStringRepository XAIFStrings;
00041
00042
00043
00044
00045 const char* XAIFStringRepository::c_strTbl[] = {
00046
00047
00048
00049 "annotation",
00050 "vertex_id",
00051 "edge_id",
00052 "scope_id",
00053 "symbol_id",
00054
00055 "active",
00056 "deriv",
00057
00058 "source",
00059 "target",
00060
00061
00062
00063
00064 "prefix",
00065
00066
00067
00068 "xaif:CallGraph",
00069
00070
00071
00072 "xaif:ScopeHierarchy",
00073 "xaif:Scope",
00074 "xaif:SymbolTable",
00075
00076
00077 "xaif:Symbol",
00078 "kind",
00079 "type",
00080 "feType",
00081 "shape",
00082 "temp",
00083
00084
00085 "xaif:DimensionBounds",
00086 "lower",
00087 "upper",
00088
00089
00090
00091
00092 "xaif:ControlFlowGraph",
00093 "xaif:ReplacementList",
00094
00095 "xaif:ArgumentList",
00096 "xaif:ArgumentSymbolReference",
00097 "intent",
00098
00099 "xaif:Replacement",
00100 "placeholder",
00101
00102 "xaif:ControlFlowEdge",
00103 "has_condition_value",
00104 "condition_value",
00105
00106
00107 "xaif:BasicBlock",
00108 "xaif:Entry",
00109 "xaif:Exit",
00110 "xaif:Branch",
00111 "xaif:ForLoop",
00112 "xaif:PreLoop",
00113 "xaif:PostLoop",
00114
00115 "xaif:EndBranch",
00116 "xaif:EndLoop",
00117
00118 "xaif:Initialization",
00119 "xaif:Condition",
00120 "xaif:Update",
00121
00122
00123 "xaif:Assignment",
00124 "xaif:SubroutineCall",
00125 "xaif:InlinableSubroutineCall",
00126 "xaif:Marker",
00127
00128 "xaif:AssignmentLHS",
00129 "xaif:AssignmentRHS",
00130
00131 "xaif:Argument",
00132
00133 "subroutine_name",
00134
00135
00136 "xaif:VariableReference",
00137 "xaif:Constant",
00138 "xaif:Intrinsic",
00139 "xaif:FunctionCall",
00140 "xaif:BooleanOperation",
00141
00142 "xaif:ExpressionEdge",
00143
00144 "name",
00145 "value",
00146 "position",
00147
00148
00149 "xaif:SymbolReference",
00150 "xaif:ArrayElementReference",
00151
00152 "xaif:IndexTriplet",
00153 "xaif:Index",
00154 "xaif:Bound",
00155 "xaif:Stride",
00156
00157 "xaif:VariableReferenceEdge",
00158
00159
00160 "xaif:DerivativePropagator",
00161
00162 "xaif:SetDeriv",
00163 "xaif:SetNegDeriv",
00164 "xaif:IncDeriv",
00165 "xaif:DecDeriv",
00166 "xaif:ZeroDeriv",
00167 "xaif:Sax",
00168 "xaif:Saxpy",
00169
00170 "xaif:Tgt",
00171 "xaif:Src",
00172 "xaif:AX",
00173 "xaif:A",
00174 "xaif:X",
00175 "xaif:Y",
00176
00177
00178
00179
00180 "{SymTab_Id#",
00181 "{Sym_Id#",
00182 "{PU_Id#",
00183 "{WHIRL_Id#",
00184
00185 "{StmtGoto#",
00186 "{StmtLabel#",
00187 "{StmtReturn#",
00188
00189 "{IntrinsicKey#",
00190 "{PregId#",
00191
00192 "}"
00193 };
00194
00195
00196
00197 XAIFStringRepository::XAIFStringRepository()
00198 {
00199 x_strTbl = new XMLCh*[NUM_STRINGS];
00200 for (int i = 0; i < NUM_STRINGS; ++i) {
00201 x_strTbl[i] = NULL;
00202 }
00203 }
00204
00205 void
00206 XAIFStringRepository::XMLInitialize()
00207 {
00208 for (int i = 0; i < NUM_STRINGS; ++i) {
00209 const char* str = c_strTbl[i];
00210 unsigned int len = strlen(str);
00211
00212 x_strTbl[i] = new XMLCh[len + 1];
00213 XMLString::transcode(str, x_strTbl[i], len);
00214 }
00215 }
00216
00217 XAIFStringRepository::~XAIFStringRepository()
00218 {
00219 for (int i = 0; i < NUM_STRINGS; ++i) {
00220 delete[] x_strTbl[i];
00221 }
00222 delete[] x_strTbl;
00223 }