blob: 98b9771736b656bd1e6c5b163a9767de4e6abb8c [file] [log] [blame]
Zonr Changc383a502010-10-12 01:52:08 +08001/*
Stephen Hines0a813a32012-08-03 16:52:40 -07002 * Copyright 2010-2012, The Android Open Source Project
Zonr Changc383a502010-10-12 01:52:08 +08003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Zonr Chang3a9ca1f2010-10-06 17:52:56 +080017#include "slang_rs.h"
18
Shih-wei Liaob81c6a42010-10-10 14:15:00 -070019#include <cstring>
Stephen Hinese639eb52010-11-08 19:27:20 -080020#include <list>
Stephen Hines2e35b132011-07-22 02:50:19 -070021#include <sstream>
Stephen Hinese639eb52010-11-08 19:27:20 -080022#include <string>
23#include <utility>
24#include <vector>
Stephen Hinesfcda2352010-10-19 16:49:32 -070025
Loganbe274822011-02-16 22:02:54 +080026#include "clang/Basic/SourceLocation.h"
27
Zonr Changcf6af6a2010-10-12 12:38:51 +080028#include "clang/Frontend/FrontendDiagnostic.h"
29
Zonr Chang3a9ca1f2010-10-06 17:52:56 +080030#include "clang/Sema/SemaDiagnostic.h"
31
Loganbe274822011-02-16 22:02:54 +080032#include "llvm/Support/Path.h"
Stephen Hinese639eb52010-11-08 19:27:20 -080033
Raphael8d5a2f62011-02-08 00:15:05 -080034#include "os_sep.h"
Zonr Chang3a9ca1f2010-10-06 17:52:56 +080035#include "slang_rs_backend.h"
36#include "slang_rs_context.h"
Zonr Chang641558f2010-10-12 21:07:06 +080037#include "slang_rs_export_type.h"
Zonr Chang3a9ca1f2010-10-06 17:52:56 +080038
Jason Sams1b6a0882012-03-12 15:07:58 -070039#include "slang_rs_reflection_cpp.h"
40
Stephen Hinese639eb52010-11-08 19:27:20 -080041namespace slang {
Zonr Chang3a9ca1f2010-10-06 17:52:56 +080042
Stephen Hines11274a72012-09-26 19:14:20 -070043#define FS_SUFFIX "fs"
44
Zonr Chang3c250c52010-10-07 12:19:23 +080045#define RS_HEADER_SUFFIX "rsh"
46
Stephen Hines2d35edd2011-08-09 11:33:27 -070047/* RS_HEADER_ENTRY(name) */
Zonr Chang3c250c52010-10-07 12:19:23 +080048#define ENUM_RS_HEADER() \
Stephen Hines2d35edd2011-08-09 11:33:27 -070049 RS_HEADER_ENTRY(rs_allocation) \
50 RS_HEADER_ENTRY(rs_atomic) \
51 RS_HEADER_ENTRY(rs_cl) \
52 RS_HEADER_ENTRY(rs_core) \
53 RS_HEADER_ENTRY(rs_debug) \
Alex Sakhartchouk4eb4b382012-03-21 09:58:39 -070054 RS_HEADER_ENTRY(rs_element) \
Stephen Hines2d35edd2011-08-09 11:33:27 -070055 RS_HEADER_ENTRY(rs_graphics) \
56 RS_HEADER_ENTRY(rs_math) \
Alex Sakhartchouk4eb4b382012-03-21 09:58:39 -070057 RS_HEADER_ENTRY(rs_mesh) \
Stephen Hines2d35edd2011-08-09 11:33:27 -070058 RS_HEADER_ENTRY(rs_matrix) \
59 RS_HEADER_ENTRY(rs_object) \
Alex Sakhartchouk4eb4b382012-03-21 09:58:39 -070060 RS_HEADER_ENTRY(rs_program) \
Stephen Hines2d35edd2011-08-09 11:33:27 -070061 RS_HEADER_ENTRY(rs_quaternion) \
Alex Sakhartchouk4eb4b382012-03-21 09:58:39 -070062 RS_HEADER_ENTRY(rs_sampler) \
Stephen Hines2d35edd2011-08-09 11:33:27 -070063 RS_HEADER_ENTRY(rs_time) \
64 RS_HEADER_ENTRY(rs_types) \
65
Stephen Hines11274a72012-09-26 19:14:20 -070066// Returns true if \p Filename ends in ".fs".
67bool SlangRS::isFilterscript(const char *Filename) {
68 const char *c = strrchr(Filename, '.');
69 if (c && !strncmp(FS_SUFFIX, c + 1, strlen(FS_SUFFIX) + 1)) {
70 return true;
71 } else {
72 return false;
73 }
74}
Zonr Chang3c250c52010-10-07 12:19:23 +080075
Zonr Changcf6af6a2010-10-12 12:38:51 +080076bool SlangRS::reflectToJava(const std::string &OutputPathBase,
77 const std::string &OutputPackageName,
Stephen Hines0a813a32012-08-03 16:52:40 -070078 const std::string &RSPackageName,
Zonr Changcf6af6a2010-10-12 12:38:51 +080079 std::string *RealPackageName) {
80 return mRSContext->reflectToJava(OutputPathBase,
81 OutputPackageName,
Stephen Hines0a813a32012-08-03 16:52:40 -070082 RSPackageName,
Zonr Changcf6af6a2010-10-12 12:38:51 +080083 getInputFileName(),
84 getOutputFileName(),
85 RealPackageName);
86}
87
88bool SlangRS::generateBitcodeAccessor(const std::string &OutputPathBase,
89 const std::string &PackageName) {
90 RSSlangReflectUtils::BitCodeAccessorContext BCAccessorContext;
91
92 BCAccessorContext.rsFileName = getInputFileName().c_str();
93 BCAccessorContext.bcFileName = getOutputFileName().c_str();
94 BCAccessorContext.reflectPath = OutputPathBase.c_str();
95 BCAccessorContext.packageName = PackageName.c_str();
96 BCAccessorContext.bcStorage = BCST_JAVA_CODE; // Must be BCST_JAVA_CODE
97
98 return RSSlangReflectUtils::GenerateBitCodeAccessor(BCAccessorContext);
99}
100
Zonr Change86245a2010-10-12 21:42:13 +0800101bool SlangRS::checkODR(const char *CurInputFile) {
Zonr Chang641558f2010-10-12 21:07:06 +0800102 for (RSContext::ExportableList::iterator I = mRSContext->exportable_begin(),
103 E = mRSContext->exportable_end();
104 I != E;
105 I++) {
Stephen Hinesa858cb62011-01-17 12:17:51 -0800106 RSExportable *RSE = *I;
107 if (RSE->getKind() != RSExportable::EX_TYPE)
Zonr Chang641558f2010-10-12 21:07:06 +0800108 continue;
109
Stephen Hinesa858cb62011-01-17 12:17:51 -0800110 RSExportType *ET = static_cast<RSExportType *>(RSE);
Zonr Chang641558f2010-10-12 21:07:06 +0800111 if (ET->getClass() != RSExportType::ExportClassRecord)
112 continue;
113
114 RSExportRecordType *ERT = static_cast<RSExportRecordType *>(ET);
115
116 // Artificial record types (create by us not by user in the source) always
117 // conforms the ODR.
118 if (ERT->isArtificial())
119 continue;
120
121 // Key to lookup ERT in ReflectedDefinitions
122 llvm::StringRef RDKey(ERT->getName());
123 ReflectedDefinitionListTy::const_iterator RD =
124 ReflectedDefinitions.find(RDKey);
125
126 if (RD != ReflectedDefinitions.end()) {
127 const RSExportRecordType *Reflected = RD->getValue().first;
128 // There's a record (struct) with the same name reflected before. Enforce
129 // ODR checking - the Reflected must hold *exactly* the same "definition"
130 // as the one defined previously. We say two record types A and B have the
131 // same definition iff:
132 //
133 // struct A { struct B {
134 // Type(a1) a1, Type(b1) b1,
135 // Type(a2) a2, Type(b1) b2,
136 // ... ...
137 // Type(aN) aN Type(b3) b3,
138 // }; }
139 // Cond. #1. They have same number of fields, i.e., N = M;
140 // Cond. #2. for (i := 1 to N)
141 // Type(ai) = Type(bi) must hold;
142 // Cond. #3. for (i := 1 to N)
143 // Name(ai) = Name(bi) must hold;
144 //
145 // where,
146 // Type(F) = the type of field F and
147 // Name(F) = the field name.
148
149 bool PassODR = false;
150 // Cond. #1 and Cond. #2
151 if (Reflected->equals(ERT)) {
152 // Cond #3.
153 RSExportRecordType::const_field_iterator AI = Reflected->fields_begin(),
154 BI = ERT->fields_begin();
155
156 for (unsigned i = 0, e = Reflected->getFields().size(); i != e; i++) {
157 if ((*AI)->getName() != (*BI)->getName())
158 break;
159 AI++;
160 BI++;
161 }
162 PassODR = (AI == (Reflected->fields_end()));
163 }
164
165 if (!PassODR) {
166 getDiagnostics().Report(mDiagErrorODR) << Reflected->getName()
167 << getInputFileName()
168 << RD->getValue().second;
169 return false;
170 }
171 } else {
172 llvm::StringMapEntry<ReflectedDefinitionTy> *ME =
173 llvm::StringMapEntry<ReflectedDefinitionTy>::Create(RDKey.begin(),
174 RDKey.end());
Zonr Change86245a2010-10-12 21:42:13 +0800175 ME->setValue(std::make_pair(ERT, CurInputFile));
Zonr Chang641558f2010-10-12 21:07:06 +0800176
177 if (!ReflectedDefinitions.insert(ME))
178 delete ME;
179
180 // Take the ownership of ERT such that it won't be freed in ~RSContext().
181 ERT->keep();
182 }
Zonr Chang641558f2010-10-12 21:07:06 +0800183 }
184 return true;
185}
Zonr Changcf6af6a2010-10-12 12:38:51 +0800186
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800187void SlangRS::initDiagnostic() {
Logan Chien9207a2e2011-10-21 15:39:28 +0800188 clang::DiagnosticsEngine &DiagEngine = getDiagnostics();
Zonr Changcf6af6a2010-10-12 12:38:51 +0800189
Logan Chien9207a2e2011-10-21 15:39:28 +0800190 if (DiagEngine.setDiagnosticGroupMapping("implicit-function-declaration",
191 clang::diag::MAP_ERROR))
192 DiagEngine.Report(clang::diag::warn_unknown_warning_option)
193 << "implicit-function-declaration";
194
195 DiagEngine.setDiagnosticMapping(
196 clang::diag::ext_typecheck_convert_discards_qualifiers,
197 clang::diag::MAP_ERROR,
198 clang::SourceLocation());
Zonr Chang641558f2010-10-12 21:07:06 +0800199
200 mDiagErrorInvalidOutputDepParameter =
Logan Chien9207a2e2011-10-21 15:39:28 +0800201 DiagEngine.getCustomDiagID(
202 clang::DiagnosticsEngine::Error,
203 "invalid parameter for output dependencies files.");
Zonr Chang641558f2010-10-12 21:07:06 +0800204
205 mDiagErrorODR =
Logan Chien9207a2e2011-10-21 15:39:28 +0800206 DiagEngine.getCustomDiagID(
207 clang::DiagnosticsEngine::Error,
208 "type '%0' in different translation unit (%1 v.s. %2) "
209 "has incompatible type definition");
Zonr Chang641558f2010-10-12 21:07:06 +0800210
Logan Chien9207a2e2011-10-21 15:39:28 +0800211 mDiagErrorTargetAPIRange =
212 DiagEngine.getCustomDiagID(
213 clang::DiagnosticsEngine::Error,
Stephen Hines2e35b132011-07-22 02:50:19 -0700214 "target API level '%0' is out of range ('%1' - '%2')");
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800215}
216
217void SlangRS::initPreprocessor() {
218 clang::Preprocessor &PP = getPreprocessor();
219
Stephen Hines2e35b132011-07-22 02:50:19 -0700220 std::stringstream RSH;
221 RSH << "#define RS_VERSION " << mTargetAPI << std::endl;
Stephen Hines2d35edd2011-08-09 11:33:27 -0700222 RSH << "#include \"rs_core." RS_HEADER_SUFFIX "\"" << std::endl;
Stephen Hines2e35b132011-07-22 02:50:19 -0700223 PP.setPredefines(RSH.str());
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800224}
225
226void SlangRS::initASTContext() {
Stephen Hines9e5b5032010-11-03 13:19:14 -0700227 mRSContext = new RSContext(getPreprocessor(),
228 getASTContext(),
Stephen Hines3fd0a942011-01-18 12:27:39 -0800229 getTargetInfo(),
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800230 &mPragmas,
Stephen Hines4a4bf922011-08-18 17:20:33 -0700231 mTargetAPI,
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800232 &mGeneratedFileNames);
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800233}
234
235clang::ASTConsumer
236*SlangRS::createBackend(const clang::CodeGenOptions& CodeGenOpts,
237 llvm::raw_ostream *OS,
238 Slang::OutputType OT) {
239 return new RSBackend(mRSContext,
Stephen Hinese639eb52010-11-08 19:27:20 -0800240 &getDiagnostics(),
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800241 CodeGenOpts,
242 getTargetOptions(),
Stephen Hines3fd0a942011-01-18 12:27:39 -0800243 &mPragmas,
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800244 OS,
245 OT,
246 getSourceManager(),
Stephen Hines11274a72012-09-26 19:14:20 -0700247 mAllowRSPrefix,
248 mIsFilterscript);
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800249}
250
Zonr Chang592a9542010-10-07 20:03:58 +0800251bool SlangRS::IsRSHeaderFile(const char *File) {
Stephen Hines2d35edd2011-08-09 11:33:27 -0700252#define RS_HEADER_ENTRY(name) \
Zonr Chang3ab021f2010-10-18 22:32:15 +0800253 if (::strcmp(File, #name "."RS_HEADER_SUFFIX) == 0) \
Zonr Chang592a9542010-10-07 20:03:58 +0800254 return true;
255ENUM_RS_HEADER()
256#undef RS_HEADER_ENTRY
Zonr Chang592a9542010-10-07 20:03:58 +0800257 return false;
258}
259
Stephen Hines11274a72012-09-26 19:14:20 -0700260bool SlangRS::IsLocInRSHeaderFile(const clang::SourceLocation &Loc,
261 const clang::SourceManager &SourceMgr) {
262 clang::FullSourceLoc FSL(Loc, SourceMgr);
Stephen Hinesfcda2352010-10-19 16:49:32 -0700263 clang::PresumedLoc PLoc = SourceMgr.getPresumedLoc(FSL);
Stephen Hinesfcda2352010-10-19 16:49:32 -0700264
Stephen Hines688e64b2011-08-23 16:01:25 -0700265 const char *Filename = PLoc.getFilename();
266 if (!Filename) {
267 return false;
268 } else {
269 return IsRSHeaderFile(llvm::sys::path::filename(Filename).data());
270 }
Stephen Hinesfcda2352010-10-19 16:49:32 -0700271}
272
Logan Chien9207a2e2011-10-21 15:39:28 +0800273SlangRS::SlangRS()
Stephen Hines11274a72012-09-26 19:14:20 -0700274 : Slang(), mRSContext(NULL), mAllowRSPrefix(false), mTargetAPI(0),
275 mIsFilterscript(false) {
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800276}
277
Zonr Changcf6af6a2010-10-12 12:38:51 +0800278bool SlangRS::compile(
279 const std::list<std::pair<const char*, const char*> > &IOFiles,
280 const std::list<std::pair<const char*, const char*> > &DepFiles,
281 const std::vector<std::string> &IncludePaths,
282 const std::vector<std::string> &AdditionalDepTargets,
283 Slang::OutputType OutputType, BitCodeStorageType BitcodeStorage,
284 bool AllowRSPrefix, bool OutputDep,
mkopec1c460b372012-01-09 11:21:50 -0500285 unsigned int TargetAPI, bool EmitDebug,
286 llvm::CodeGenOpt::Level OptimizationLevel,
Zonr Changcf6af6a2010-10-12 12:38:51 +0800287 const std::string &JavaReflectionPathBase,
Stephen Hines0a813a32012-08-03 16:52:40 -0700288 const std::string &JavaReflectionPackageName,
289 const std::string &RSPackageName) {
Zonr Changcf6af6a2010-10-12 12:38:51 +0800290 if (IOFiles.empty())
291 return true;
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800292
Zonr Changcf6af6a2010-10-12 12:38:51 +0800293 if (OutputDep && (DepFiles.size() != IOFiles.size())) {
Zonr Chang641558f2010-10-12 21:07:06 +0800294 getDiagnostics().Report(mDiagErrorInvalidOutputDepParameter);
Zonr Changcf6af6a2010-10-12 12:38:51 +0800295 return false;
296 }
297
298 std::string RealPackageName;
299
300 const char *InputFile, *OutputFile, *BCOutputFile, *DepOutputFile;
301 std::list<std::pair<const char*, const char*> >::const_iterator
302 IOFileIter = IOFiles.begin(), DepFileIter = DepFiles.begin();
303
304 setIncludePaths(IncludePaths);
305 setOutputType(OutputType);
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800306 if (OutputDep) {
Zonr Changcf6af6a2010-10-12 12:38:51 +0800307 setAdditionalDepTargets(AdditionalDepTargets);
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800308 }
Zonr Changcf6af6a2010-10-12 12:38:51 +0800309
mkopec1c460b372012-01-09 11:21:50 -0500310 setDebugMetadataEmission(EmitDebug);
311
312 setOptimizationLevel(OptimizationLevel);
313
Zonr Changcf6af6a2010-10-12 12:38:51 +0800314 mAllowRSPrefix = AllowRSPrefix;
315
Stephen Hines2e35b132011-07-22 02:50:19 -0700316 mTargetAPI = TargetAPI;
Stephen Hines4cc499d2011-08-24 19:06:17 -0700317 if (mTargetAPI < SLANG_MINIMUM_TARGET_API ||
318 mTargetAPI > SLANG_MAXIMUM_TARGET_API) {
Stephen Hines2e35b132011-07-22 02:50:19 -0700319 getDiagnostics().Report(mDiagErrorTargetAPIRange) << mTargetAPI
Stephen Hines4cc499d2011-08-24 19:06:17 -0700320 << SLANG_MINIMUM_TARGET_API << SLANG_MAXIMUM_TARGET_API;
Stephen Hines2e35b132011-07-22 02:50:19 -0700321 return false;
322 }
323
Stephen Hinesc632be22011-09-23 15:53:16 -0700324 // Skip generation of warnings a second time if we are doing more than just
325 // a single pass over the input file.
326 bool SuppressAllWarnings = (OutputType != Slang::OT_Dependency);
327
Zonr Changcf6af6a2010-10-12 12:38:51 +0800328 for (unsigned i = 0, e = IOFiles.size(); i != e; i++) {
329 InputFile = IOFileIter->first;
330 OutputFile = IOFileIter->second;
331
332 reset();
333
334 if (!setInputSource(InputFile))
335 return false;
336
337 if (!setOutput(OutputFile))
338 return false;
339
Stephen Hinescf9a73a2012-09-20 10:38:02 -0700340 if (!JavaReflectionPackageName.empty()) {
341 mRSContext->setReflectJavaPackageName(
342 JavaReflectionPackageName);
343 }
344
Stephen Hines11274a72012-09-26 19:14:20 -0700345 mIsFilterscript = isFilterscript(InputFile);
346
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800347 if (Slang::compile() > 0)
348 return false;
349
350 if (OutputType != Slang::OT_Dependency) {
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800351
Stephen Hines5c25c512012-02-27 12:58:17 -0800352 if (BitcodeStorage == BCST_CPP_CODE) {
Jason Sams1b6a0882012-03-12 15:07:58 -0700353 RSReflectionCpp R(mRSContext);
354 bool ret = R.reflect(JavaReflectionPathBase, getInputFileName(), getOutputFileName());
355 if (!ret) {
356 return false;
357 }
Stephen Hines5c25c512012-02-27 12:58:17 -0800358 } else {
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800359
Stephen Hines5c25c512012-02-27 12:58:17 -0800360 if (!reflectToJava(JavaReflectionPathBase,
361 JavaReflectionPackageName,
Stephen Hines0a813a32012-08-03 16:52:40 -0700362 RSPackageName,
Stephen Hines5c25c512012-02-27 12:58:17 -0800363 &RealPackageName)) {
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800364 return false;
Stephen Hines5c25c512012-02-27 12:58:17 -0800365 }
366
367 for (std::vector<std::string>::const_iterator
368 I = mGeneratedFileNames.begin(), E = mGeneratedFileNames.end();
369 I != E;
370 I++) {
371 std::string ReflectedName = RSSlangReflectUtils::ComputePackagedPath(
372 JavaReflectionPathBase.c_str(),
373 (RealPackageName + OS_PATH_SEPARATOR_STR + *I).c_str());
374 appendGeneratedFileName(ReflectedName + ".java");
375 }
376
377 if ((OutputType == Slang::OT_Bitcode) &&
378 (BitcodeStorage == BCST_JAVA_CODE) &&
379 !generateBitcodeAccessor(JavaReflectionPathBase,
380 RealPackageName.c_str())) {
381 return false;
382 }
383 }
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800384 }
385
Zonr Changcf6af6a2010-10-12 12:38:51 +0800386 if (OutputDep) {
387 BCOutputFile = DepFileIter->first;
388 DepOutputFile = DepFileIter->second;
389
390 setDepTargetBC(BCOutputFile);
391
392 if (!setDepOutput(DepOutputFile))
393 return false;
394
Stephen Hinesc632be22011-09-23 15:53:16 -0700395 if (SuppressAllWarnings) {
396 getDiagnostics().setSuppressAllDiagnostics(true);
397 }
Zonr Changcf6af6a2010-10-12 12:38:51 +0800398 if (generateDepFile() > 0)
399 return false;
Stephen Hinesc632be22011-09-23 15:53:16 -0700400 if (SuppressAllWarnings) {
401 getDiagnostics().setSuppressAllDiagnostics(false);
402 }
Zonr Changcf6af6a2010-10-12 12:38:51 +0800403
404 DepFileIter++;
405 }
406
Zonr Change86245a2010-10-12 21:42:13 +0800407 if (!checkODR(InputFile))
Zonr Chang641558f2010-10-12 21:07:06 +0800408 return false;
409
Zonr Changcf6af6a2010-10-12 12:38:51 +0800410 IOFileIter++;
411 }
412
413 return true;
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800414}
415
Zonr Chang641558f2010-10-12 21:07:06 +0800416void SlangRS::reset() {
417 delete mRSContext;
418 mRSContext = NULL;
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800419 mGeneratedFileNames.clear();
Zonr Chang641558f2010-10-12 21:07:06 +0800420 Slang::reset();
421 return;
422}
423
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800424SlangRS::~SlangRS() {
425 delete mRSContext;
Zonr Chang641558f2010-10-12 21:07:06 +0800426 for (ReflectedDefinitionListTy::iterator I = ReflectedDefinitions.begin(),
427 E = ReflectedDefinitions.end();
428 I != E;
429 I++) {
430 delete I->getValue().first;
431 }
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800432 return;
433}
Stephen Hinese639eb52010-11-08 19:27:20 -0800434
435} // namespace slang