diff --git a/CMakeLists.txt b/CMakeLists.txt index 266dc91..7113921 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -set(CMAKE_CXX_FLAGS "-std=c++0x") +set(CMAKE_CXX_FLAGS "-std=c++0x -O3") SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/build) SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/build) diff --git a/src/cpp/srcSlice.cpp b/src/cpp/srcSlice.cpp index 75a226b..da0297d 100644 --- a/src/cpp/srcSlice.cpp +++ b/src/cpp/srcSlice.cpp @@ -75,6 +75,6 @@ int main(int argc, char * argv[]) { srcSAXController control(argv[1]); srcSliceHandler handler; control.parse(&handler); - TestSlice(handler.sysDict.dictionary); + //TestSlice(handler.sysDict.dictionary); return 0; } diff --git a/src/headers/srcSliceHandler.hpp b/src/headers/srcSliceHandler.hpp index 816aeb0..97bab9d 100644 --- a/src/headers/srcSliceHandler.hpp +++ b/src/headers/srcSliceHandler.hpp @@ -534,16 +534,18 @@ public : } void GetExprStmtParts(){ //std::cerr<<"op: "<second.find(fdname); //std::cerr<<"MMM: "<second.end()){ + sp->second.slines.insert(currentNameAndLine.second); + if(lastSp != FunctionIt->second.end() && !lastSp->second.potentialAlias){ //std::cerr<<"dat: "<<*rVecIt<<" "<second.function<<" "<second.dvars.insert(functionTmplt.functionName+":"+functionTmplt.declstmt.name); - sp->second.slines.insert(currentNameAndLine.second); + //check for aliases - } + }else if(lastSp != FunctionIt->second.end() && lastSp->second.potentialAlias){ + //it's an alias for the rhs. + sp->second.isAlias = true; + sp->second.lastInsertedAlias = sp->second.aliases.insert(fdname).first; + }/* if(!triggerField[call] && sp->second.potentialAlias){ //it's an alias for the rhs. sp->second.isAlias = true; sp->second.lastInsertedAlias = sp->second.aliases.insert(fdname).first; - } + }*/ } } } } } void ProcessExprStmtRhs(){ + + ///TODO: This won't work for all expressions + //std::cerr<<"DIS: "<second.find(functionTmplt.functionName+":"+functionTmplt.exprstmt.lhs); + if(splIt != FunctionIt->second.end()){ //Found it so add statement line. + splIt->second.slines.insert(functionTmplt.exprstmt.ln); + //std::cerr<<"This: "<second.variableName<<" "<second.potentialAlias<second.find(functionTmplt.functionName+":"+functionTmplt.exprstmt.lhs); - if(splIt != FunctionIt->second.end()){ //Found it so add statement line. - splIt->second.slines.insert(functionTmplt.exprstmt.ln); - //std::cerr<<"This: "<second.variableName<<" "<second.potentialAlias<second.find(functionTmplt.functionName+":"+*rVecIt); //std::cerr<<"That: "<second.end()){ //lvalue depends on this rvalue //std::cerr<<"ERP: "<second.dvars.insert(functionTmplt.functionName+":"+functionTmplt.exprstmt.lhs); + if(!(splIt != FunctionIt->second.end() && splIt->second.potentialAlias)){ + sprIt->second.dvars.insert(functionTmplt.functionName+":"+functionTmplt.exprstmt.lhs); + + }else{ + sprIt->second.lastInsertedAlias = sprIt->second.aliases.insert(functionTmplt.functionName+":"+functionTmplt.exprstmt.lhs).first; + } sprIt->second.slines.insert(functionTmplt.exprstmt.ln); if(sprIt->second.isAlias){ //std::cerr<second.end() && splIt->second.potentialAlias){ - sprIt->second.lastInsertedAlias = sprIt->second.aliases.insert(functionTmplt.functionName+":"+functionTmplt.exprstmt.lhs).first; + } } }