minor optimization
This commit is contained in:
parent
a1af733a53
commit
61a5d9f94f
|
@ -149,16 +149,6 @@ void CppPreprocessor::addDefineByLine(const QString &line, bool hardCoded)
|
||||||
addDefineByParts(name, args, value, hardCoded);
|
addDefineByParts(name, args, value, hardCoded);
|
||||||
}
|
}
|
||||||
|
|
||||||
PDefine CppPreprocessor::getDefine(const QString &name)
|
|
||||||
{
|
|
||||||
return mDefines.value(name,PDefine());
|
|
||||||
}
|
|
||||||
|
|
||||||
PDefine CppPreprocessor::getHardDefine(const QString &name)
|
|
||||||
{
|
|
||||||
return mHardDefines.value(name,PDefine());
|
|
||||||
}
|
|
||||||
|
|
||||||
void CppPreprocessor::setScanOptions(bool parseSystem, bool parseLocal)
|
void CppPreprocessor::setScanOptions(bool parseSystem, bool parseLocal)
|
||||||
{
|
{
|
||||||
mParseSystem = parseSystem;
|
mParseSystem = parseSystem;
|
||||||
|
@ -669,11 +659,6 @@ void CppPreprocessor::removeGCCAttribute(const QString &line, QString &newLine,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PParsedFile CppPreprocessor::getInclude(int index)
|
|
||||||
{
|
|
||||||
return mIncludes[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void CppPreprocessor::openInclude(const QString &fileName, QStringList bufferedText)
|
void CppPreprocessor::openInclude(const QString &fileName, QStringList bufferedText)
|
||||||
{
|
{
|
||||||
if (mIncludes.size()>0) {
|
if (mIncludes.size()>0) {
|
||||||
|
@ -802,33 +787,6 @@ void CppPreprocessor::closeInclude()
|
||||||
.arg(parsedFile->index+1));
|
.arg(parsedFile->index+1));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CppPreprocessor::getCurrentBranch()
|
|
||||||
{
|
|
||||||
if (!mBranchResults.isEmpty())
|
|
||||||
return mBranchResults.last();
|
|
||||||
else
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CppPreprocessor::setCurrentBranch(bool value)
|
|
||||||
{
|
|
||||||
mBranchResults.append(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CppPreprocessor::removeCurrentBranch()
|
|
||||||
{
|
|
||||||
if (mBranchResults.size()>0)
|
|
||||||
mBranchResults.pop_back();
|
|
||||||
}
|
|
||||||
|
|
||||||
const QStringList& CppPreprocessor::result() const
|
|
||||||
{
|
|
||||||
|
|
||||||
PFileIncludes CppPreprocessor::getFileIncludesEntry(const QString &fileName)
|
|
||||||
{
|
|
||||||
return mIncludesList.value(fileName,PFileIncludes());
|
|
||||||
}
|
|
||||||
|
|
||||||
void CppPreprocessor::addDefinesInFile(const QString &fileName)
|
void CppPreprocessor::addDefinesInFile(const QString &fileName)
|
||||||
{
|
{
|
||||||
if (mProcessed.contains(fileName))
|
if (mProcessed.contains(fileName))
|
||||||
|
|
|
@ -112,23 +112,41 @@ private:
|
||||||
void expandMacro(const QString& line, QString& newLine, QString& word, int& i, int depth);
|
void expandMacro(const QString& line, QString& newLine, QString& word, int& i, int depth);
|
||||||
QString removeGCCAttributes(const QString& line);
|
QString removeGCCAttributes(const QString& line);
|
||||||
void removeGCCAttribute(const QString&line, QString& newLine, int &i, const QString& word);
|
void removeGCCAttribute(const QString&line, QString& newLine, int &i, const QString& word);
|
||||||
PDefine getDefine(const QString& name);
|
PDefine getDefine(const QString& name) const{
|
||||||
|
return mDefines.value(name,PDefine());
|
||||||
|
}
|
||||||
// current file stuff
|
// current file stuff
|
||||||
PParsedFile getInclude(int index);
|
PParsedFile getInclude(int index) const {
|
||||||
|
return mIncludes[index];
|
||||||
|
}
|
||||||
void openInclude(const QString& fileName, QStringList bufferedText=QStringList());
|
void openInclude(const QString& fileName, QStringList bufferedText=QStringList());
|
||||||
void closeInclude();
|
void closeInclude();
|
||||||
|
|
||||||
// branch stuff
|
// branch stuff
|
||||||
bool getCurrentBranch();
|
bool getCurrentBranch(){
|
||||||
void setCurrentBranch(bool value);
|
if (!mBranchResults.isEmpty())
|
||||||
void removeCurrentBranch();
|
return mBranchResults.last();
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
void setCurrentBranch(bool value){
|
||||||
|
mBranchResults.append(value);
|
||||||
|
}
|
||||||
|
void removeCurrentBranch(){
|
||||||
|
if (mBranchResults.size()>0)
|
||||||
|
mBranchResults.pop_back();
|
||||||
|
};
|
||||||
// include stuff
|
// include stuff
|
||||||
PFileIncludes getFileIncludesEntry(const QString& FileName);
|
PFileIncludes getFileIncludesEntry(const QString& fileName){
|
||||||
|
return mIncludesList.value(fileName,PFileIncludes());
|
||||||
|
}
|
||||||
void addDefinesInFile(const QString& fileName);
|
void addDefinesInFile(const QString& fileName);
|
||||||
void addDefineByParts(const QString& name, const QString& args,
|
void addDefineByParts(const QString& name, const QString& args,
|
||||||
const QString& value, bool hardCoded);
|
const QString& value, bool hardCoded);
|
||||||
void addDefineByLine(const QString& line, bool hardCoded);
|
void addDefineByLine(const QString& line, bool hardCoded);
|
||||||
PDefine getHardDefine(const QString& name);
|
PDefine getHardDefine(const QString& name){
|
||||||
|
return mHardDefines.value(name,PDefine());
|
||||||
|
};
|
||||||
void invalidDefinesInFile(const QString& fileName);
|
void invalidDefinesInFile(const QString& fileName);
|
||||||
|
|
||||||
void parseArgs(PDefine define);
|
void parseArgs(PDefine define);
|
||||||
|
|
Loading…
Reference in New Issue