Skip to content

Instantly share code, notes, and snippets.

@PlloYNiiE
PlloYNiiE / SieveStatementPrinter::VisitDeclRefExpr.cpp
Created March 17, 2011 09:51
SieveStatementPrinter::VisitDeclRefExpr.cpp
void SieveStatementPrinter::VisitDeclRefExpr(DeclRefExpr *E) {
//current_stmt = new Collection::VarDecl();
Indent(level, " Visiting Decl Ref Expr");
//E->dump();
//llvm::outs() << "\tEnc DeclRef\n";
// stmts_storage.push_back(current_stmt);
//E->dump();
}
@PlloYNiiE
PlloYNiiE / SieveStatementPrinter::VisitBinaryOperator.cpp
Created March 17, 2011 09:49
SieveStatementPrinter::VisitBinaryOperator.cpp
void SieveStatementPrinter::VisitBinaryOperator(BinaryOperator *E) {
//Indent(level, " Visiting Binary Operator");
/*
//RhsDR->getDecl();
if (E->isAssignmentOp()) {
if (DeclRefExpr* DR = dyn_cast<DeclRefExpr>(E->getLHS())) {
if (VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) {
if (VD->hasInit()) {
@PlloYNiiE
PlloYNiiE / SieveStatementPrinter.cpp
Created March 17, 2011 07:48
SieveStatementPrinter.cpp
#include "SieveStmtPrinter.h"
#include <string>
#include "collection.h"
#include <vector>
#include <sstream>
using namespace clang;
using namespace llvm;
int number = 0;
int orderNum = 0;
level = 2
23 Visiting If Statement
IF ====== Condition =======
IF Variable (2) : i
IF Compare Operation: ==
IF Compare Value(SwitchStmt 0x967f98
<<<NULL>>>
(ImplicitCastExpr 0x968150 'int' <IntegralCast>
(ImplicitCastExpr 0x968140 'char' <LValueToRValue>
(DeclRefExpr 0x967f7c 'char' lvalue Var='c' 0x967f10)))
@PlloYNiiE
PlloYNiiE / the_hook.sloc
Created March 15, 2011 19:50
the_hook.sloc
Have a non-directory at the top, so creating directory top_dir
Adding /Users/Projects/Projects/drupal/sourcesieve/thehook/the_hook.php to top_dir
Categorizing files.
Finding a working MD5 command....
Found a working MD5 command.
Computing results.
Warning! Unclosed PHP file /Users/Projects/drupal/sourcesieve/thehook/the_hook.php, mode=1
SLOC Directory SLOC-by-Language (Sorted)
DeclContext *DC = vd->getDeclContext();
for (DeclContext::decl_iterator D = DC->decls_begin(), DEnd = DC->decls_end();
D != DEnd; ++D) {
QualType CurDeclType = getDeclType(*D);
std::cout << "xxx"<<CurDeclType->getTypeClassName()<<"yy"<<std::endl;
if (!Decls.empty() && !CurDeclType.isNull()) {
@PlloYNiiE
PlloYNiiE / prime_omp.cpp
Created January 26, 2011 21:08
prime_omp
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2005 Intel Corp.
//
// Subject to the terms and conditions set forth below, Intel hereby
// grants you a nonexclusive, nontransferable license, to use,
// reproduce and distribute the example code sequences contained
// herein, in object code format, solely as part of your computer
// program(s) and solely in order to allow your computer program(s) to
// implement the multimedia instruction extensions contained in such
// sequences solely with respect to the Intel instruction set
///////////////////////////////////////////////////////////////////////////////
//
// GetCommandLineArguments
//
// Grabs the number of threads from the commandline
//
///////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2005 Intel Corp.
//
// Subject to the terms and conditions set forth below, Intel hereby
// grants you a nonexclusive, nontransferable license, to use,
// reproduce and distribute the example code sequences contained
// herein, in object code format, solely as part of your computer
// program(s) and solely in order to allow your computer program(s) to
// implement the multimedia instruction extensions contained in such
// sequences solely with respect to the Intel instruction set
<?php
$hw1 = "case1_a.c";
`clang -cc1 -fsyntax-only -plugin sourcesieve $hw1`;
?>