summaryrefslogtreecommitdiff
path: root/src/ToolBox/superpmi/mcs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ToolBox/superpmi/mcs')
-rw-r--r--src/ToolBox/superpmi/mcs/CMakeLists.txt1
-rw-r--r--src/ToolBox/superpmi/mcs/commandline.cpp22
-rw-r--r--src/ToolBox/superpmi/mcs/commandline.h2
-rw-r--r--src/ToolBox/superpmi/mcs/mcs.cpp5
-rw-r--r--src/ToolBox/superpmi/mcs/verbsmarty.cpp97
-rw-r--r--src/ToolBox/superpmi/mcs/verbsmarty.h22
6 files changed, 0 insertions, 149 deletions
diff --git a/src/ToolBox/superpmi/mcs/CMakeLists.txt b/src/ToolBox/superpmi/mcs/CMakeLists.txt
index 6ad1ff35ed..ebacd0761c 100644
--- a/src/ToolBox/superpmi/mcs/CMakeLists.txt
+++ b/src/ToolBox/superpmi/mcs/CMakeLists.txt
@@ -24,7 +24,6 @@ set(MCS_SOURCES
verbinteg.cpp
verbmerge.cpp
verbremovedup.cpp
- verbsmarty.cpp
verbstat.cpp
verbstrip.cpp
verbtoc.cpp
diff --git a/src/ToolBox/superpmi/mcs/commandline.cpp b/src/ToolBox/superpmi/mcs/commandline.cpp
index cc2244d870..161122815a 100644
--- a/src/ToolBox/superpmi/mcs/commandline.cpp
+++ b/src/ToolBox/superpmi/mcs/commandline.cpp
@@ -107,10 +107,6 @@ void CommandLine::DumpHelp(const char* program)
printf(" e.g. -removeDup -thin a.mc b.mc\n");
printf(" e.g. -removeDup -legacy -thin a.mc b.mc\n");
printf("\n");
- printf(" -smarty range inputfile outputfile\n");
- printf(" Write smarty Test IDs of the range from inputfile to outputfile.\n");
- printf(" e.g. -smarty 2 a.mc b.mc\n");
- printf("\n");
printf(" -stat {optional range} inputfile outputfile\n");
printf(" Report various statistics per method context.\n");
printf(" inputfile is read and statistics are written into outputfile\n");
@@ -344,14 +340,6 @@ bool CommandLine::Parse(int argc, char* argv[], /* OUT */ Options* o)
{
o->legacyCompare = true;
}
- else if ((_strnicmp(&argv[i][1], "smarty", argLen) == 0))
- {
- tempLen = strlen(argv[i]);
- o->actionSmarty = true;
- foundVerb = true;
- if (i + 1 < argc) // Peek to see if we have an mcl file or an integer next
- goto processMCL;
- }
else if ((_strnicmp(&argv[i][1], "verbosity", argLen) == 0))
{
if (++i >= argc)
@@ -564,16 +552,6 @@ bool CommandLine::Parse(int argc, char* argv[], /* OUT */ Options* o)
}
return true;
}
- if (o->actionSmarty)
- {
- if ((!foundFile1) || (!foundFile2))
- {
- LogError("CommandLine::Parse() '-smarty' needs one input file and one output file.");
- DumpHelp(argv[0]);
- return false;
- }
- return true;
- }
DumpHelp(argv[0]);
return false;
diff --git a/src/ToolBox/superpmi/mcs/commandline.h b/src/ToolBox/superpmi/mcs/commandline.h
index 442f2a4098..4e594934d2 100644
--- a/src/ToolBox/superpmi/mcs/commandline.h
+++ b/src/ToolBox/superpmi/mcs/commandline.h
@@ -27,7 +27,6 @@ public:
, actionInteg(false)
, actionMerge(false)
, actionRemoveDup(false)
- , actionSmarty(false)
, actionStat(false)
, actionStrip(false)
, actionTOC(false)
@@ -53,7 +52,6 @@ public:
bool actionInteg;
bool actionMerge;
bool actionRemoveDup;
- bool actionSmarty;
bool actionStat;
bool actionStrip;
bool actionTOC;
diff --git a/src/ToolBox/superpmi/mcs/mcs.cpp b/src/ToolBox/superpmi/mcs/mcs.cpp
index 7026ff55a3..4ed72cac27 100644
--- a/src/ToolBox/superpmi/mcs/mcs.cpp
+++ b/src/ToolBox/superpmi/mcs/mcs.cpp
@@ -19,7 +19,6 @@
#include "verbconcat.h"
#include "verbmerge.h"
#include "verbstrip.h"
-#include "verbsmarty.h"
#include "logging.h"
int __cdecl main(int argc, char* argv[])
@@ -98,10 +97,6 @@ int __cdecl main(int argc, char* argv[])
{
exitCode = verbTOC::DoWork(o.nameOfFile1);
}
- if (o.actionSmarty)
- {
- exitCode = verbSmarty::DoWork(o.nameOfFile1, o.nameOfFile2, o.indexCount, o.indexes);
- }
Logger::Shutdown();
return exitCode;
diff --git a/src/ToolBox/superpmi/mcs/verbsmarty.cpp b/src/ToolBox/superpmi/mcs/verbsmarty.cpp
deleted file mode 100644
index a9425bd11c..0000000000
--- a/src/ToolBox/superpmi/mcs/verbsmarty.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#include "standardpch.h"
-#include "verbsmarty.h"
-#include "simpletimer.h"
-#include "methodcontext.h"
-#include "methodcontextiterator.h"
-
-//
-// Constructs a new verbSmarty.
-//
-// Arguments:
-// hFile - A handle to the output file that we are writing the Smarty Test IDs
-//
-// Assumptions:
-// hFile refers to an open and writeable file handle.
-//
-verbSmarty::verbSmarty(HANDLE hFile)
-{
- m_hFile = hFile;
-}
-
-//
-// Dumps the Smarty TestID to file
-//
-// Arguments:
-// testID - Smarty Test ID
-//
-void verbSmarty::DumpTestInfo(int testID)
-{
-#define bufflen 4096
- DWORD bytesWritten;
-
- char buff[bufflen];
- int buff_offset = 0;
- ZeroMemory(buff, bufflen * sizeof(char));
-
- buff_offset += sprintf_s(&buff[buff_offset], bufflen - buff_offset, "%i\r\n", testID);
- WriteFile(m_hFile, buff, buff_offset * sizeof(char), &bytesWritten, nullptr);
-}
-
-int verbSmarty::DoWork(const char* nameOfInput, const char* nameOfOutput, int indexCount, const int* indexes)
-{
- LogVerbose("Reading from '%s' reading Smarty ID for the Mc Indexes and writing into '%s'", nameOfInput,
- nameOfOutput);
-
- MethodContextIterator mci(indexCount, indexes);
- if (!mci.Initialize(nameOfInput))
- return -1;
-
- int savedCount = 0;
-
- HANDLE hFileOut = CreateFileA(nameOfOutput, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
- FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
- if (hFileOut == INVALID_HANDLE_VALUE)
- {
- LogError("Failed to open input 1 '%s'. GetLastError()=%u", nameOfOutput, GetLastError());
- return -1;
- }
-
- verbSmarty* verbList = new verbSmarty(hFileOut);
-
- // TODO-Cleanup: look to use toc for this
- while (mci.MoveNext())
- {
- MethodContext* mc = mci.Current();
-
- int testID = mc->repGetTestID();
- if (testID != -1)
- {
- // write to the file
- verbList->DumpTestInfo(testID);
- }
- else
- {
- LogError("Smarty ID not found for '%s'", mc->cr->repProcessName());
- }
- }
-
- delete verbList;
-
- if (!CloseHandle(hFileOut))
- {
- LogError("2nd CloseHandle failed. GetLastError()=%u", GetLastError());
- return -1;
- }
-
- LogInfo("Loaded %d, Saved %d", mci.MethodContextNumber(), savedCount);
-
- if (!mci.Destroy())
- return -1;
-
- return 0;
-}
diff --git a/src/ToolBox/superpmi/mcs/verbsmarty.h b/src/ToolBox/superpmi/mcs/verbsmarty.h
deleted file mode 100644
index c595ecbf4e..0000000000
--- a/src/ToolBox/superpmi/mcs/verbsmarty.h
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-//----------------------------------------------------------
-// verbSmarty.h - verb that outputs Smarty test ID for mc
-//----------------------------------------------------------
-#ifndef _verbSmarty
-#define _verbSmarty
-
-class verbSmarty
-{
-public:
- verbSmarty(HANDLE hFile);
- void DumpTestInfo(int testID);
- static int DoWork(const char* nameOfInput, const char* nameofOutput, int indexCount, const int* indexes);
-
-private:
- HANDLE m_hFile;
-};
-#endif