コード例 #1
0
void ReduceClassTemplateParameter::removeParameterFromMethods()
{
  CXXRecordDecl *CXXRD = TheClassTemplateDecl->getTemplatedDecl();
  for (auto I = CXXRD->method_begin(), E = CXXRD->method_end();
       I != E; ++I) {
    ClassTemplateMethodVisitor V(this, TheParameterIndex);
    V.TraverseDecl(*I);
  }
}
コード例 #2
0
bool FlattenCFGTransformer::HandleAnyClassDecl(Decl *D) {
	DPRINT("enter ClassDecl");
	CXXRecordDecl *cd = NULL;
	if(ClassTemplateDecl *td = dyn_cast<ClassTemplateDecl>(D)) { // class template
		cd = td->getTemplatedDecl();
	} else if(CXXRecordDecl *td = dyn_cast<CXXRecordDecl>(D)) { // class
		cd = td;
	} else {
		DPRINT("not class type Decl");
		return false;
	}

	assert(cd && "get CXXRecordDecl failed");

	// process all member methods
	for(CXXRecordDecl::method_iterator I = cd->method_begin(), E = cd->method_end(); 
			I != E; ++I){
		HandleAnyFunctionDecl(*I);
	}
	return true;
}