diff --git a/Plugins/ModelSimGenerator/ModelSimWriterFactory/ModelSimWriterFactory.cpp b/Plugins/ModelSimGenerator/ModelSimWriterFactory/ModelSimWriterFactory.cpp index 1cab001bf..dceca3355 100644 --- a/Plugins/ModelSimGenerator/ModelSimWriterFactory/ModelSimWriterFactory.cpp +++ b/Plugins/ModelSimGenerator/ModelSimWriterFactory/ModelSimWriterFactory.cpp @@ -52,7 +52,7 @@ QList > ModelSimWriterFactory::prepareDesign(QL QList > components; - foreach (QSharedPointer mDesign, designs) + for (QSharedPointer mDesign : designs) { components.append(mDesign->getTopInstance()); components.append(mDesign->getInstances()->values()); @@ -63,14 +63,15 @@ QList > ModelSimWriterFactory::prepareDesign(QL document->writer_ = writer; document->fileName_ = designs.first()->getTopInstance()->getModuleName() + ".do"; document->vlnv_ = designs.first()->getTopInstance()->getComponent()->getVlnv().toString(); + document->metaDesign_ = designs.first(); - foreach (QSharedPointer mComponent, components) + for (QSharedPointer mComponent : components) { QString basePath = library_->getPath(mComponent->getComponent()->getVlnv()); - foreach (QSharedPointer fileSet, *mComponent->getFileSets()) + for (QSharedPointer fileSet : *mComponent->getFileSets()) { - foreach (QSharedPointer file, *fileSet->getFiles()) + for (QSharedPointer file : *fileSet->getFiles()) { // Fetch the absolute path to the file QString absolutePath = General::getAbsolutePath(basePath, file->name()); diff --git a/Plugins/PluginSystem/GeneratorPlugin/GenerationControl.cpp b/Plugins/PluginSystem/GeneratorPlugin/GenerationControl.cpp index 634fcc45c..ebe8eeaca 100644 --- a/Plugins/PluginSystem/GeneratorPlugin/GenerationControl.cpp +++ b/Plugins/PluginSystem/GeneratorPlugin/GenerationControl.cpp @@ -91,9 +91,7 @@ bool GenerationControl::writeDocuments() } // If instantiation exists, make sure that the instantiation refers to the file set. - QStringList fileSetRefs = instantiation->getFileSetReferenceStrings(); - - if (instantiation && !fileSetRefs.contains(fileSet->name())) + if (instantiation && instantiation->getFileSetReferenceStrings().contains(fileSet->name())) { QSharedPointer newFileSetRef(new FileSetRef()); newFileSetRef->setReference(fileSet->name()); @@ -106,7 +104,7 @@ bool GenerationControl::writeDocuments() bool fails = false; // Go through each potential file. - foreach(QSharedPointer output, *outputControl_->getOutputs()) + for (QSharedPointer output : *outputControl_->getOutputs()) { // Form the path from the determined output path plus determined file name. QString absFilePath = outputControl_->getOutputPath() + "/" + output->fileName_; @@ -235,7 +233,7 @@ void GenerationControl::initializeDocuments() QList > documents = factory_->prepareDesign(designs); // Go through the parsed designs. - foreach(QSharedPointer output, documents) + for (QSharedPointer output : documents) { if (!output) { @@ -421,7 +419,7 @@ QSharedPointer > > GenerationControl::findPossibleVie } // Go through each view of the containing component and pick the eligible ones. - foreach(QSharedPointer view, *input.component->getViews()) + for (QSharedPointer view : *input.component->getViews()) { // Find the design instantiation of the view. QSharedPointer dis = input.component->getModel()-> @@ -469,7 +467,7 @@ QSharedPointer > > GenerationControl::findPossibleVie (new QList >); // In practice, go through each view, and if it is not hierarchical, append to the list. - foreach (QSharedPointer view, *targetComponent->getViews()) + for (QSharedPointer view : *targetComponent->getViews()) { if (!view->isHierarchical()) {