blob: 3c0fd9c7a78ce4ff85bd79edfabaa383b9bafadc [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,
Stephen Hines925879f2013-07-19 18:19:04 -070077 const std::string &RSPackageName) {
Zonr Changcf6af6a2010-10-12 12:38:51 +080078 return mRSContext->reflectToJava(OutputPathBase,
Stephen Hines0a813a32012-08-03 16:52:40 -070079 RSPackageName,
Zonr Changcf6af6a2010-10-12 12:38:51 +080080 getInputFileName(),
Stephen Hines925879f2013-07-19 18:19:04 -070081 getOutputFileName());
Zonr Changcf6af6a2010-10-12 12:38:51 +080082}
83
84bool SlangRS::generateBitcodeAccessor(const std::string &OutputPathBase,
85 const std::string &PackageName) {
86 RSSlangReflectUtils::BitCodeAccessorContext BCAccessorContext;
87
88 BCAccessorContext.rsFileName = getInputFileName().c_str();
89 BCAccessorContext.bcFileName = getOutputFileName().c_str();
90 BCAccessorContext.reflectPath = OutputPathBase.c_str();
91 BCAccessorContext.packageName = PackageName.c_str();
92 BCAccessorContext.bcStorage = BCST_JAVA_CODE; // Must be BCST_JAVA_CODE
93
94 return RSSlangReflectUtils::GenerateBitCodeAccessor(BCAccessorContext);
95}
96
Zonr Change86245a2010-10-12 21:42:13 +080097bool SlangRS::checkODR(const char *CurInputFile) {
Zonr Chang641558f2010-10-12 21:07:06 +080098 for (RSContext::ExportableList::iterator I = mRSContext->exportable_begin(),
99 E = mRSContext->exportable_end();
100 I != E;
101 I++) {
Stephen Hinesa858cb62011-01-17 12:17:51 -0800102 RSExportable *RSE = *I;
103 if (RSE->getKind() != RSExportable::EX_TYPE)
Zonr Chang641558f2010-10-12 21:07:06 +0800104 continue;
105
Stephen Hinesa858cb62011-01-17 12:17:51 -0800106 RSExportType *ET = static_cast<RSExportType *>(RSE);
Zonr Chang641558f2010-10-12 21:07:06 +0800107 if (ET->getClass() != RSExportType::ExportClassRecord)
108 continue;
109
110 RSExportRecordType *ERT = static_cast<RSExportRecordType *>(ET);
111
112 // Artificial record types (create by us not by user in the source) always
113 // conforms the ODR.
114 if (ERT->isArtificial())
115 continue;
116
117 // Key to lookup ERT in ReflectedDefinitions
118 llvm::StringRef RDKey(ERT->getName());
119 ReflectedDefinitionListTy::const_iterator RD =
120 ReflectedDefinitions.find(RDKey);
121
122 if (RD != ReflectedDefinitions.end()) {
123 const RSExportRecordType *Reflected = RD->getValue().first;
124 // There's a record (struct) with the same name reflected before. Enforce
125 // ODR checking - the Reflected must hold *exactly* the same "definition"
126 // as the one defined previously. We say two record types A and B have the
127 // same definition iff:
128 //
129 // struct A { struct B {
130 // Type(a1) a1, Type(b1) b1,
131 // Type(a2) a2, Type(b1) b2,
132 // ... ...
133 // Type(aN) aN Type(b3) b3,
134 // }; }
135 // Cond. #1. They have same number of fields, i.e., N = M;
136 // Cond. #2. for (i := 1 to N)
137 // Type(ai) = Type(bi) must hold;
138 // Cond. #3. for (i := 1 to N)
139 // Name(ai) = Name(bi) must hold;
140 //
141 // where,
142 // Type(F) = the type of field F and
143 // Name(F) = the field name.
144
145 bool PassODR = false;
146 // Cond. #1 and Cond. #2
147 if (Reflected->equals(ERT)) {
148 // Cond #3.
149 RSExportRecordType::const_field_iterator AI = Reflected->fields_begin(),
150 BI = ERT->fields_begin();
151
152 for (unsigned i = 0, e = Reflected->getFields().size(); i != e; i++) {
153 if ((*AI)->getName() != (*BI)->getName())
154 break;
155 AI++;
156 BI++;
157 }
158 PassODR = (AI == (Reflected->fields_end()));
159 }
160
161 if (!PassODR) {
162 getDiagnostics().Report(mDiagErrorODR) << Reflected->getName()
163 << getInputFileName()
164 << RD->getValue().second;
165 return false;
166 }
167 } else {
168 llvm::StringMapEntry<ReflectedDefinitionTy> *ME =
169 llvm::StringMapEntry<ReflectedDefinitionTy>::Create(RDKey.begin(),
170 RDKey.end());
Zonr Change86245a2010-10-12 21:42:13 +0800171 ME->setValue(std::make_pair(ERT, CurInputFile));
Zonr Chang641558f2010-10-12 21:07:06 +0800172
173 if (!ReflectedDefinitions.insert(ME))
174 delete ME;
175
176 // Take the ownership of ERT such that it won't be freed in ~RSContext().
177 ERT->keep();
178 }
Zonr Chang641558f2010-10-12 21:07:06 +0800179 }
180 return true;
181}
Zonr Changcf6af6a2010-10-12 12:38:51 +0800182
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800183void SlangRS::initDiagnostic() {
Logan Chien9207a2e2011-10-21 15:39:28 +0800184 clang::DiagnosticsEngine &DiagEngine = getDiagnostics();
Zonr Changcf6af6a2010-10-12 12:38:51 +0800185
Logan Chien9207a2e2011-10-21 15:39:28 +0800186 if (DiagEngine.setDiagnosticGroupMapping("implicit-function-declaration",
187 clang::diag::MAP_ERROR))
188 DiagEngine.Report(clang::diag::warn_unknown_warning_option)
189 << "implicit-function-declaration";
190
191 DiagEngine.setDiagnosticMapping(
192 clang::diag::ext_typecheck_convert_discards_qualifiers,
193 clang::diag::MAP_ERROR,
194 clang::SourceLocation());
Zonr Chang641558f2010-10-12 21:07:06 +0800195
196 mDiagErrorInvalidOutputDepParameter =
Logan Chien9207a2e2011-10-21 15:39:28 +0800197 DiagEngine.getCustomDiagID(
198 clang::DiagnosticsEngine::Error,
199 "invalid parameter for output dependencies files.");
Zonr Chang641558f2010-10-12 21:07:06 +0800200
201 mDiagErrorODR =
Logan Chien9207a2e2011-10-21 15:39:28 +0800202 DiagEngine.getCustomDiagID(
203 clang::DiagnosticsEngine::Error,
204 "type '%0' in different translation unit (%1 v.s. %2) "
205 "has incompatible type definition");
Zonr Chang641558f2010-10-12 21:07:06 +0800206
Logan Chien9207a2e2011-10-21 15:39:28 +0800207 mDiagErrorTargetAPIRange =
208 DiagEngine.getCustomDiagID(
209 clang::DiagnosticsEngine::Error,
Stephen Hines2e35b132011-07-22 02:50:19 -0700210 "target API level '%0' is out of range ('%1' - '%2')");
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800211}
212
213void SlangRS::initPreprocessor() {
214 clang::Preprocessor &PP = getPreprocessor();
215
Stephen Hines2e35b132011-07-22 02:50:19 -0700216 std::stringstream RSH;
217 RSH << "#define RS_VERSION " << mTargetAPI << std::endl;
Stephen Hines2d35edd2011-08-09 11:33:27 -0700218 RSH << "#include \"rs_core." RS_HEADER_SUFFIX "\"" << std::endl;
Stephen Hines2e35b132011-07-22 02:50:19 -0700219 PP.setPredefines(RSH.str());
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800220}
221
222void SlangRS::initASTContext() {
Stephen Hines9e5b5032010-11-03 13:19:14 -0700223 mRSContext = new RSContext(getPreprocessor(),
224 getASTContext(),
Stephen Hines3fd0a942011-01-18 12:27:39 -0800225 getTargetInfo(),
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800226 &mPragmas,
Stephen Hines4a4bf922011-08-18 17:20:33 -0700227 mTargetAPI,
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800228 &mGeneratedFileNames);
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800229}
230
231clang::ASTConsumer
232*SlangRS::createBackend(const clang::CodeGenOptions& CodeGenOpts,
233 llvm::raw_ostream *OS,
234 Slang::OutputType OT) {
235 return new RSBackend(mRSContext,
Stephen Hinese639eb52010-11-08 19:27:20 -0800236 &getDiagnostics(),
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800237 CodeGenOpts,
238 getTargetOptions(),
Stephen Hines3fd0a942011-01-18 12:27:39 -0800239 &mPragmas,
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800240 OS,
241 OT,
242 getSourceManager(),
Stephen Hines11274a72012-09-26 19:14:20 -0700243 mAllowRSPrefix,
244 mIsFilterscript);
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800245}
246
Zonr Chang592a9542010-10-07 20:03:58 +0800247bool SlangRS::IsRSHeaderFile(const char *File) {
Stephen Hines2d35edd2011-08-09 11:33:27 -0700248#define RS_HEADER_ENTRY(name) \
Zonr Chang3ab021f2010-10-18 22:32:15 +0800249 if (::strcmp(File, #name "."RS_HEADER_SUFFIX) == 0) \
Zonr Chang592a9542010-10-07 20:03:58 +0800250 return true;
251ENUM_RS_HEADER()
252#undef RS_HEADER_ENTRY
Zonr Chang592a9542010-10-07 20:03:58 +0800253 return false;
254}
255
Stephen Hines11274a72012-09-26 19:14:20 -0700256bool SlangRS::IsLocInRSHeaderFile(const clang::SourceLocation &Loc,
257 const clang::SourceManager &SourceMgr) {
258 clang::FullSourceLoc FSL(Loc, SourceMgr);
Stephen Hinesfcda2352010-10-19 16:49:32 -0700259 clang::PresumedLoc PLoc = SourceMgr.getPresumedLoc(FSL);
Stephen Hinesfcda2352010-10-19 16:49:32 -0700260
Stephen Hines688e64b2011-08-23 16:01:25 -0700261 const char *Filename = PLoc.getFilename();
262 if (!Filename) {
263 return false;
264 } else {
265 return IsRSHeaderFile(llvm::sys::path::filename(Filename).data());
266 }
Stephen Hinesfcda2352010-10-19 16:49:32 -0700267}
268
Logan Chien9207a2e2011-10-21 15:39:28 +0800269SlangRS::SlangRS()
Stephen Hines11274a72012-09-26 19:14:20 -0700270 : Slang(), mRSContext(NULL), mAllowRSPrefix(false), mTargetAPI(0),
271 mIsFilterscript(false) {
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800272}
273
Zonr Changcf6af6a2010-10-12 12:38:51 +0800274bool SlangRS::compile(
275 const std::list<std::pair<const char*, const char*> > &IOFiles,
276 const std::list<std::pair<const char*, const char*> > &DepFiles,
277 const std::vector<std::string> &IncludePaths,
278 const std::vector<std::string> &AdditionalDepTargets,
279 Slang::OutputType OutputType, BitCodeStorageType BitcodeStorage,
280 bool AllowRSPrefix, bool OutputDep,
mkopec1c460b372012-01-09 11:21:50 -0500281 unsigned int TargetAPI, bool EmitDebug,
282 llvm::CodeGenOpt::Level OptimizationLevel,
Zonr Changcf6af6a2010-10-12 12:38:51 +0800283 const std::string &JavaReflectionPathBase,
Stephen Hines0a813a32012-08-03 16:52:40 -0700284 const std::string &JavaReflectionPackageName,
285 const std::string &RSPackageName) {
Zonr Changcf6af6a2010-10-12 12:38:51 +0800286 if (IOFiles.empty())
287 return true;
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800288
Zonr Changcf6af6a2010-10-12 12:38:51 +0800289 if (OutputDep && (DepFiles.size() != IOFiles.size())) {
Zonr Chang641558f2010-10-12 21:07:06 +0800290 getDiagnostics().Report(mDiagErrorInvalidOutputDepParameter);
Zonr Changcf6af6a2010-10-12 12:38:51 +0800291 return false;
292 }
293
294 std::string RealPackageName;
295
296 const char *InputFile, *OutputFile, *BCOutputFile, *DepOutputFile;
297 std::list<std::pair<const char*, const char*> >::const_iterator
298 IOFileIter = IOFiles.begin(), DepFileIter = DepFiles.begin();
299
300 setIncludePaths(IncludePaths);
301 setOutputType(OutputType);
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800302 if (OutputDep) {
Zonr Changcf6af6a2010-10-12 12:38:51 +0800303 setAdditionalDepTargets(AdditionalDepTargets);
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800304 }
Zonr Changcf6af6a2010-10-12 12:38:51 +0800305
mkopec1c460b372012-01-09 11:21:50 -0500306 setDebugMetadataEmission(EmitDebug);
307
308 setOptimizationLevel(OptimizationLevel);
309
Zonr Changcf6af6a2010-10-12 12:38:51 +0800310 mAllowRSPrefix = AllowRSPrefix;
311
Stephen Hines2e35b132011-07-22 02:50:19 -0700312 mTargetAPI = TargetAPI;
Stephen Hines4cc499d2011-08-24 19:06:17 -0700313 if (mTargetAPI < SLANG_MINIMUM_TARGET_API ||
314 mTargetAPI > SLANG_MAXIMUM_TARGET_API) {
Stephen Hines2e35b132011-07-22 02:50:19 -0700315 getDiagnostics().Report(mDiagErrorTargetAPIRange) << mTargetAPI
Stephen Hines4cc499d2011-08-24 19:06:17 -0700316 << SLANG_MINIMUM_TARGET_API << SLANG_MAXIMUM_TARGET_API;
Stephen Hines2e35b132011-07-22 02:50:19 -0700317 return false;
318 }
319
Stephen Hinesc632be22011-09-23 15:53:16 -0700320 // Skip generation of warnings a second time if we are doing more than just
321 // a single pass over the input file.
322 bool SuppressAllWarnings = (OutputType != Slang::OT_Dependency);
323
Zonr Changcf6af6a2010-10-12 12:38:51 +0800324 for (unsigned i = 0, e = IOFiles.size(); i != e; i++) {
325 InputFile = IOFileIter->first;
326 OutputFile = IOFileIter->second;
327
328 reset();
329
330 if (!setInputSource(InputFile))
331 return false;
332
333 if (!setOutput(OutputFile))
334 return false;
335
Stephen Hines11274a72012-09-26 19:14:20 -0700336 mIsFilterscript = isFilterscript(InputFile);
337
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800338 if (Slang::compile() > 0)
339 return false;
340
Stephen Hines925879f2013-07-19 18:19:04 -0700341 if (!JavaReflectionPackageName.empty()) {
342 mRSContext->setReflectJavaPackageName(JavaReflectionPackageName);
343 }
344 const std::string &RealPackageName =
345 mRSContext->getReflectJavaPackageName();
346
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800347 if (OutputType != Slang::OT_Dependency) {
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800348
Stephen Hines5c25c512012-02-27 12:58:17 -0800349 if (BitcodeStorage == BCST_CPP_CODE) {
Jason Sams1b6a0882012-03-12 15:07:58 -0700350 RSReflectionCpp R(mRSContext);
351 bool ret = R.reflect(JavaReflectionPathBase, getInputFileName(), getOutputFileName());
352 if (!ret) {
353 return false;
354 }
Stephen Hines5c25c512012-02-27 12:58:17 -0800355 } else {
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800356
Stephen Hines925879f2013-07-19 18:19:04 -0700357 if (!reflectToJava(JavaReflectionPathBase, RSPackageName)) {
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800358 return false;
Stephen Hines5c25c512012-02-27 12:58:17 -0800359 }
360
361 for (std::vector<std::string>::const_iterator
362 I = mGeneratedFileNames.begin(), E = mGeneratedFileNames.end();
363 I != E;
364 I++) {
365 std::string ReflectedName = RSSlangReflectUtils::ComputePackagedPath(
366 JavaReflectionPathBase.c_str(),
367 (RealPackageName + OS_PATH_SEPARATOR_STR + *I).c_str());
368 appendGeneratedFileName(ReflectedName + ".java");
369 }
370
371 if ((OutputType == Slang::OT_Bitcode) &&
372 (BitcodeStorage == BCST_JAVA_CODE) &&
373 !generateBitcodeAccessor(JavaReflectionPathBase,
374 RealPackageName.c_str())) {
375 return false;
376 }
377 }
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800378 }
379
Zonr Changcf6af6a2010-10-12 12:38:51 +0800380 if (OutputDep) {
381 BCOutputFile = DepFileIter->first;
382 DepOutputFile = DepFileIter->second;
383
384 setDepTargetBC(BCOutputFile);
385
386 if (!setDepOutput(DepOutputFile))
387 return false;
388
Stephen Hinesc632be22011-09-23 15:53:16 -0700389 if (SuppressAllWarnings) {
390 getDiagnostics().setSuppressAllDiagnostics(true);
391 }
Zonr Changcf6af6a2010-10-12 12:38:51 +0800392 if (generateDepFile() > 0)
393 return false;
Stephen Hinesc632be22011-09-23 15:53:16 -0700394 if (SuppressAllWarnings) {
395 getDiagnostics().setSuppressAllDiagnostics(false);
396 }
Zonr Changcf6af6a2010-10-12 12:38:51 +0800397
398 DepFileIter++;
399 }
400
Zonr Change86245a2010-10-12 21:42:13 +0800401 if (!checkODR(InputFile))
Zonr Chang641558f2010-10-12 21:07:06 +0800402 return false;
403
Zonr Changcf6af6a2010-10-12 12:38:51 +0800404 IOFileIter++;
405 }
406
407 return true;
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800408}
409
Zonr Chang641558f2010-10-12 21:07:06 +0800410void SlangRS::reset() {
411 delete mRSContext;
412 mRSContext = NULL;
Stephen Hines4cc67fc2011-01-31 16:48:57 -0800413 mGeneratedFileNames.clear();
Zonr Chang641558f2010-10-12 21:07:06 +0800414 Slang::reset();
415 return;
416}
417
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800418SlangRS::~SlangRS() {
419 delete mRSContext;
Zonr Chang641558f2010-10-12 21:07:06 +0800420 for (ReflectedDefinitionListTy::iterator I = ReflectedDefinitions.begin(),
421 E = ReflectedDefinitions.end();
422 I != E;
423 I++) {
424 delete I->getValue().first;
425 }
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800426 return;
427}
Stephen Hinese639eb52010-11-08 19:27:20 -0800428
429} // namespace slang