Skip to content

Commit 34830ce

Browse files
committed
test
1 parent 08bd742 commit 34830ce

File tree

6 files changed

+31
-159
lines changed

6 files changed

+31
-159
lines changed

.github/workflows/CI-unixish.yml

Lines changed: 0 additions & 110 deletions
This file was deleted.

.github/workflows/CI-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
build:
1616
strategy:
1717
matrix:
18-
os: [windows-2022, windows-2025]
19-
config: [Release, Debug]
18+
os: [windows-2025]
19+
config: [Debug]
2020
fail-fast: false
2121

2222
runs-on: ${{ matrix.os }}

.github/workflows/clang-tidy.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,21 @@ int main(int argc, char **argv)
128128
rawtokens->removeComments();
129129
simplecpp::TokenList outputTokens(files);
130130
simplecpp::FileDataCache filedata;
131+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
131132
simplecpp::preprocess(outputTokens, *rawtokens, files, filedata, dui, &outputList);
133+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
132134
simplecpp::cleanup(filedata);
135+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
133136
delete rawtokens;
134137
rawtokens = nullptr;
138+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
135139

136140
// Output
137141
if (!quiet) {
138142
if (!error_only)
139143
std::cout << outputTokens.stringify() << std::endl;
140144

145+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
141146
for (const simplecpp::Output &output : outputList) {
142147
std::cerr << output.location.file() << ':' << output.location.line << ": ";
143148
switch (output.type) {
@@ -176,6 +181,7 @@ int main(int argc, char **argv)
176181
}
177182
}
178183

184+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
179185
if (fail_on_error && !outputList.empty())
180186
return 1;
181187

simplecpp.cpp

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -547,11 +547,11 @@ simplecpp::TokenList &simplecpp::TokenList::operator=(TokenList &&other)
547547
void simplecpp::TokenList::clear()
548548
{
549549
backToken = nullptr;
550-
while (frontToken) {
551-
Token * const next = frontToken->next;
552-
delete frontToken;
553-
frontToken = next;
554-
}
550+
// while (frontToken) {
551+
// Token * const next = frontToken->next;
552+
// delete frontToken;
553+
// frontToken = next;
554+
// }
555555
sizeOfType.clear();
556556
}
557557

@@ -3088,8 +3088,9 @@ simplecpp::FileData *simplecpp::FileDataCache::lookup(const std::string &sourcef
30883088
return nullptr;
30893089
}
30903090

3091-
for (std::list<std::string>::const_iterator it = dui.includePaths.begin(); it != dui.includePaths.end(); ++it) {
3092-
const std::string path = getIncludePathFileName(*it, header);
3091+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
3092+
for (const auto &includePath : dui.includePaths) {
3093+
const std::string path = getIncludePathFileName(includePath, header);
30933094
const auto name_it = mNameMap.find(path);
30943095

30953096
if (name_it != mNameMap.end())
@@ -3133,11 +3134,14 @@ std::pair<bool, simplecpp::FileData *> simplecpp::FileDataCache::load(const std:
31333134

31343135
std::pair<bool, simplecpp::FileData *> simplecpp::FileDataCache::get(const std::string &sourcefile, const std::string &header, const simplecpp::DUI &dui, bool systemheader, std::vector<std::string> &filenames, simplecpp::OutputList *outputList)
31353136
{
3137+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
31363138
FileData *const data = lookup(sourcefile, header, dui, systemheader);
31373139

3140+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
31383141
if (data != nullptr)
31393142
return std::make_pair(false, data);
31403143

3144+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
31413145
return load(sourcefile, header, dui, systemheader, filenames, outputList);
31423146
}
31433147

@@ -3309,11 +3313,13 @@ static std::string getTimeDefine(const struct tm *timep)
33093313

33103314
void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenList &rawtokens, std::vector<std::string> &files, simplecpp::FileDataCache &cache, const simplecpp::DUI &dui, simplecpp::OutputList *outputList, std::list<simplecpp::MacroUsage> *macroUsage, std::list<simplecpp::IfCond> *ifCond)
33113315
{
3316+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
33123317
#ifdef SIMPLECPP_WINDOWS
33133318
if (dui.clearIncludeCache)
33143319
nonExistingFilesCache.clear();
33153320
#endif
3316-
3321+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
3322+
33173323
std::map<std::string, std::size_t> sizeOfType(rawtokens.sizeOfType);
33183324
sizeOfType.insert(std::make_pair("char", sizeof(char)));
33193325
sizeOfType.insert(std::make_pair("short", sizeof(short)));
@@ -3404,6 +3410,7 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
34043410
includetokenstack.push(filedata->tokens.cfront());
34053411
}
34063412

3413+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
34073414
std::map<std::string, std::list<Location> > maybeUsedMacros;
34083415

34093416
for (const Token *rawtok = nullptr; rawtok || !includetokenstack.empty();) {
@@ -3519,11 +3526,13 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
35193526
return;
35203527
}
35213528

3529+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
35223530
const Token * const inctok = inc2.cfront();
35233531

35243532
const bool systemheader = (inctok->str()[0] == '<');
35253533
const std::string header(inctok->str().substr(1U, inctok->str().size() - 2U));
35263534
const FileData *const filedata = cache.get(rawtok->location.file(), header, dui, systemheader, files, outputList).second;
3535+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
35273536
if (filedata == nullptr) {
35283537
if (outputList) {
35293538
simplecpp::Output out(files);
@@ -3752,6 +3761,7 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
37523761
output.takeTokens(tokens);
37533762
}
37543763
}
3764+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
37553765

37563766
if (macroUsage) {
37573767
for (simplecpp::MacroMap::const_iterator macroIt = macros.begin(); macroIt != macros.end(); ++macroIt) {

simplecpp.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <cctype>
1010
#include <cstring>
1111
#include <iosfwd>
12+
#include <iostream>
1213
#include <list>
1314
#include <map>
1415
#include <memory>
@@ -424,9 +425,13 @@ namespace simplecpp {
424425
}
425426

426427
void clear() {
428+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
427429
mNameMap.clear();
430+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
428431
mIdMap.clear();
432+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
429433
mData.clear();
434+
std::cout << __FILE__ << ":" << __LINE__ << std::endl;
430435
}
431436

432437
typedef std::vector<std::unique_ptr<FileData>> container_type;

0 commit comments

Comments
 (0)