[llvm-commits] CVS: reopt/lib/Inst/lib/Phase1/Intraphase.h Phase1.cpp PrimInfo.cpp PrimInfo.h

Brian Gaeke gaeke at cs.uiuc.edu
Wed Nov 19 14:51:09 PST 2003


Changes in directory reopt/lib/Inst/lib/Phase1:

Intraphase.h updated: 1.1 -> 1.2
Phase1.cpp updated: 1.29 -> 1.30
PrimInfo.cpp updated: 1.17 -> 1.18
PrimInfo.h updated: 1.11 -> 1.12

---
Log message:

Cleanups: file headers, using declarations, namespacification, removing
#if 0'd-out code, wrapping at 80 columns, sorting headers, not using endl,
doxygenifying comments, renaming header guard macros, etc.  (There is still
more to do, but at least it compiles again now...)


---
Diffs of the changes:  (+188 -165)

Index: reopt/lib/Inst/lib/Phase1/Intraphase.h
diff -u reopt/lib/Inst/lib/Phase1/Intraphase.h:1.1 reopt/lib/Inst/lib/Phase1/Intraphase.h:1.2
--- reopt/lib/Inst/lib/Phase1/Intraphase.h:1.1	Tue May 13 12:29:50 2003
+++ reopt/lib/Inst/lib/Phase1/Intraphase.h	Wed Nov 19 14:49:53 2003
@@ -1,15 +1,23 @@
-////////////////
-// programmer: Joel Stanley
-//       date: Sun May 11 00:02:14 CDT 2003
-//     fileid: Intraphase.h
-//    purpose: Provides declarations of types that must be shared between Phase1 and the
-//    other (runtime) phases.
+//===- Intraphase.h - Shared declarations between pp phases ---------------===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
+//
+// Originally written by Joel Stanley on 11-May-2003. Provides
+// declarations of types that must be shared between Phase1 and the
+// other (runtime) phases.
+//
+//===----------------------------------------------------------------------===//
 
-#ifndef _INCLUDED_INTRAPHASE_H
-#define _INCLUDED_INTRAPHASE_H
+#ifndef INTRAPHASE_H
+#define INTRAPHASE_H
 
-namespace pp
-{
+namespace llvm {
+namespace pp {
 
 enum GBTEntryType {
     GBT_COUNTER,
@@ -18,6 +26,7 @@
     GBT_POINT
 };
  
-}; // end namespace pp
+} // end namespace pp
+} // end namespace llvm
 
-#endif // _INCLUDED_INTRAPHASE_H
+#endif // INTRAPHASE_H


Index: reopt/lib/Inst/lib/Phase1/Phase1.cpp
diff -u reopt/lib/Inst/lib/Phase1/Phase1.cpp:1.29 reopt/lib/Inst/lib/Phase1/Phase1.cpp:1.30
--- reopt/lib/Inst/lib/Phase1/Phase1.cpp:1.29	Sat Sep 13 16:12:09 2003
+++ reopt/lib/Inst/lib/Phase1/Phase1.cpp	Wed Nov 19 14:49:53 2003
@@ -1,19 +1,16 @@
-////////////////
-// programmer: Joel Stanley
-//       date: Sun Jan  5 11:17:21 EST 2003
-//     fileid: Phase1.cpp
-//    purpose: Implements the first phase of the performance primitives
-//             transformation.
+//===- Phase1.cpp - First phase of performance primitives transformation --===//
+// 
+//                     The LLVM Compiler Infrastructure
 //
-// []
-
-#include <iostream>
-#include <vector>
-#include <set>
-#include <algorithm>
-#include <map>
-#include <string>
-#include <cassert>
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
+//
+// Originally written by Joel Stanley on 5-Jan-2003. Implements the
+// first phase of the performance primitives transformation.
+//
+//===----------------------------------------------------------------------===//
 
 #include "llvm/Pass.h"
 #include "llvm/Module.h"
@@ -28,15 +25,19 @@
 #include "Support/STLExtras.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Target/TargetData.h"
-
 #include "PrimInfo.h"
+#include <iostream>
+#include <vector>
+#include <set>
+#include <algorithm>
+#include <map>
+#include <string>
+#include <cassert>
 
-using std::cerr;
-using std::endl;
 using std::vector;
 
-namespace pp
-{
+namespace llvm {
+namespace pp {
 
 static void PurgeInst(Instruction* inst)
 {
@@ -58,11 +59,16 @@
     // placeholder pairs holds: glob volatile ptr, glob temporary variable ptr
     typedef std::pair<GlobalVariable*,GlobalVariable*> PlaceholderPair; 
     
-    void transformSites();                                       // Transform all metric sites
-    void transformSites(Function* pointSigFun);                  // Transform all point sites
-    void transformSites(std::pair<Function*, Function*>& rpair); // Transform all region-pair sites 
-    void transformSite(CallInst* pointSigFun);                   // Transform single point site
-    void transformSite(CallInst* startCall, CallInst* endCall);  // Transform single region-pair site
+    // Transform all metric sites
+    void transformSites();
+    // Transform all point sites
+    void transformSites(Function* pointSigFun);
+    // Transform all region-pair sites 
+    void transformSites(std::pair<Function*, Function*>& rpair);
+    // Transform single point site
+    void transformSite(CallInst* pointSigFun);
+    // Transform single region-pair site
+    void transformSite(CallInst* startCall, CallInst* endCall);
 
     void generatePlaceholder(CallInst* ci, PlaceholderPair& placeholder);
     void findRegionPairs(vector<std::pair<Function*, Function*> >& rpairs);
@@ -87,8 +93,6 @@
     static const unsigned POINTCALL_ID_OPIDX = 1;
 };
 
-//////////////// Phase1 implementation ////////////////
-
 Phase1::Phase1(): m_targetData("PerfInst Phase 1", this)
 {
 }
@@ -100,16 +104,22 @@
     vector<const Type*> params;
 
     // Signature for unsigned pp_counterPrim()
-    m_counterPrimFunc = m.getOrInsertFunction("pp_counterPrim", FunctionType::get(Type::UIntTy, params, false));
+    m_counterPrimFunc =
+      m.getOrInsertFunction("pp_counterPrim",
+                            FunctionType::get(Type::UIntTy, params, false));
 
     // Signature for void pp_regionPair(void*,void*)
     params.push_back(PointerType::get(Type::SByteTy));
     params.push_back(PointerType::get(Type::SByteTy));
-    m_regionPairDeclFunc = m.getOrInsertFunction("pp_regionPair", FunctionType::get(Type::VoidTy, params, false));
+    m_regionPairDeclFunc =
+      m.getOrInsertFunction("pp_regionPair",
+                            FunctionType::get(Type::VoidTy, params, false));
 
     // Signature for void pp_metricSpec(void*)
     params.pop_back();
-    m_metricSpecDeclFunc = m.getOrInsertFunction("pp_metricSpec", FunctionType::get(Type::VoidTy, params, false));
+    m_metricSpecDeclFunc =
+      m.getOrInsertFunction("pp_metricSpec",
+                            FunctionType::get(Type::VoidTy, params, false));
 
     // Global variable to hold the address of the inserted alloca's
     m_allocAddr = new GlobalVariable(PointerType::get(Type::UByteTy), false,
@@ -120,10 +130,6 @@
 
     // Invoke PrimInfo's static initializer
     PrimInfo::buildStructTypes(&m);
-
-    //
-    ////////////////
-
 }
 
 static Function* extractFunctionArg(Value* rpairParam) 
@@ -180,39 +186,41 @@
 
 void Phase1::transformSites() 
 {
-    ////////////////
     // Build list of region pair sigfuns
 
     vector<std::pair<Function*, Function*> > rpairs;
     vector<const Type*> params;
 
     // Populate with builtins
-
-    // The new approach: pp_declareInterval{Start,End} are the only sigfuns used to
-    // declare an interval, instead of the interval being implicit by the given locations
-    // of the calls to (registered) region sigfuns.  For now, we will still use the old
-    // code for processing the contents of 'rpairs', but the only element of rpairs will
-    // be the pair of interval-declaration sigfuns.  TODO: Clean up this approach, and do
-    // the same for point-site declarations.
+    
+    // The new approach: pp_declareInterval{Start,End} are the only
+    // sigfuns used to declare an interval, instead of the interval
+    // being implicit by the given locations of the calls to
+    // (registered) region sigfuns.  For now, we will still use the
+    // old code for processing the contents of 'rpairs', but the only
+    // element of rpairs will be the pair of interval-declaration
+    // sigfuns.  TODO: Clean up this approach, and do the same for
+    // point-site declarations.
 
     params.push_back(PointerType::get(Type::DoubleTy));
     params.push_back(Type::UIntTy);
-    //Function* intervalStartDeclFunc = m_module->getNamedFunction("pp_declareIntervalStart");
 
     Function* intervalStartDeclFunc =
         m_module->getOrInsertFunction("pp_declareIntervalStart",
-                                      FunctionType::get(Type::VoidTy, params, false));
+                                      FunctionType::get(Type::VoidTy,
+                                                        params, false));
         
     params.clear();
     params.push_back(Type::UIntTy);
     params.push_back(PointerType::get(Type::DoubleTy));
     Function* intervalEndDeclFunc =
         m_module->getOrInsertFunction("pp_declareIntervalEnd",
-                                      FunctionType::get(Type::VoidTy, params, false));
+                                      FunctionType::get(Type::VoidTy,
+                                                        params, false));
 
-    rpairs.push_back(std::make_pair(intervalStartDeclFunc, intervalEndDeclFunc));
+    rpairs.push_back(std::make_pair(intervalStartDeclFunc,
+                                    intervalEndDeclFunc));
 
-    ////////////////
     // Build list of point metric spec sigfuns, finding ppMetricSpec will yield
     // user-defined instances of them.
     vector<Function*> metricSpecs;
@@ -220,7 +228,8 @@
     // counter builtin
     params.clear();
     FunctionType* ftype = FunctionType::get(Type::UIntTy, params, false);
-    metricSpecs.push_back(m_module->getOrInsertFunction("pp_counterPrim", ftype));
+    metricSpecs.push_back(m_module->getOrInsertFunction("pp_counterPrim",
+                                                        ftype));
     
     // timestamp builtin
     params.clear();
@@ -230,25 +239,23 @@
     // Find user-declared point sigfuns and add them to the list
     findMetricSpecs(metricSpecs);
 
-    ////////////////
     // Transform point sites
-
     for(unsigned i = 0, e = metricSpecs.size(); i < e; ++i)
         transformSites(metricSpecs[i]);
     
-    ////////////////
     // Transform region sites
-
     for(unsigned i = 0, e = rpairs.size(); i < e; ++i)
         transformSites(rpairs[i]);
 
     // Build the global bookkeeping table (GBT) contents
     vector<Constant*> gbtElems;
-    for(vector<PrimInfo>::iterator i = m_primInfos.begin(), e = m_primInfos.end(); i != e; ++i)
+    for(vector<PrimInfo>::iterator i = m_primInfos.begin(),
+          e = m_primInfos.end(); i != e; ++i)
         i->buildStructInstances(gbtElems);
 
     // Make the GBT itself, and the corresponding global variable.
-    ArrayType* gbtType = ArrayType::get(PrimInfo::getStructType(), gbtElems.size());
+    ArrayType* gbtType = ArrayType::get(PrimInfo::getStructType(),
+                                        gbtElems.size());
     ConstantArray* gbtContents = ConstantArray::get(gbtType, gbtElems);
     GlobalVariable* gbt = new GlobalVariable(gbtType, true,
                                              GlobalVariable::ExternalLinkage,
@@ -256,15 +263,15 @@
 
     // Record the GBT size
     ConstantUInt* size = ConstantUInt::get(Type::UIntTy, gbtElems.size());
-    GlobalVariable* gbtSize = new GlobalVariable(Type::UIntTy, true,
-                                                 GlobalVariable::ExternalLinkage,
-                                                 size, "ppGBTSize", m_module);
+    GlobalVariable* gbtSize =
+      new GlobalVariable(Type::UIntTy, true, GlobalVariable::ExternalLinkage,
+                         size, "ppGBTSize", m_module);
 }
 
 static void DumpUses(Value* v) 
 {
     for(Value::use_iterator u = v->use_begin(), ue = v->use_end(); u != ue; ++u)
-            cerr << "Use is: " << *u << endl;
+      std::cerr << "Use is: " << *u << "\n";
 }
     
 void Phase1::transformSites(Function* pointSigFun)
@@ -292,8 +299,8 @@
     if(startFunc->use_empty() && endFunc->use_empty())
         return;
 
-    // Transform each region, where a region is defined by a call to startFunc and endFunc
-    // within the same scope.
+    // Transform each region, where a region is defined by a call to
+    // startFunc and endFunc within the same scope.
 
     for(Value::use_iterator u = startFunc->use_begin(),
             ue = startFunc->use_end(); u != ue; ++u) {
@@ -305,24 +312,27 @@
         CallInst* startCall = dyn_cast<CallInst>(*u);
         assert(startCall && "Use of a registered pp sigfun not in a call");
 
-        // Find call to endpoint: The first operand of the start function is used in only
-        // two places: the call to the start function, and the call to the end
-        // function. Find the call to the end function.
+        // Find call to endpoint: The first operand of the start
+        // function is used in only two places: the call to the start
+        // function, and the call to the end function. Find the call
+        // to the end function.
 
         assert(startCall->getNumOperands() == NUM_START_OPDS &&
                "Start-region call inst has unexpected number of operands");
 
         Value* stOpd = startCall->getOperand(1);
 
-        assert(isa<AllocaInst>(stOpd) && "Unexpected first operand of start call");
+        assert(isa<AllocaInst>(stOpd)
+               && "Unexpected first operand of start call");
         assert(stOpd->use_size() == NUM_STOPD_USES &&
-               "Unexpected number of uses of of start-region (\"connector\") operand");
+               "Unexpected # uses of of start-region (\"connector\") operand");
         
         CallInst* endCall;
         if((endCall = dyn_cast<CallInst>(stOpd->use_back()))) {
             if(endCall->getCalledFunction() != endFunc) {
                 endCall = dyn_cast<CallInst>(*stOpd->use_begin());
-                assert(endCall && "Use of start call's first opd in non-call inst");
+                assert(endCall
+                       && "Use of start call's first opd in non-call inst");
             }
         }
         else
@@ -339,20 +349,18 @@
 
 static GlobalVariable* GetLHSGlobal(CallInst* ci) 
 {
-    // Assumes ci is an "end call" with two pointer parameters, the first of which is the
-    // address of the global variable.
-
-    assert(ci->getNumOperands() == 3 && isa<GlobalVariable>(ci->getOperand(1)) &&
-           "Call inst does not have expected format");
-
+    // Assumes ci is an "end call" with two pointer parameters, the
+    // first of which is the address of the global variable.
+    assert(ci->getNumOperands() == 3
+           && isa<GlobalVariable>(ci->getOperand(1))
+           && "Call inst does not have expected format");
     return cast<GlobalVariable>(ci->getOperand(1));
 }
 
 static unsigned extractUnsignedValue(CallInst* ci, unsigned nth) 
 {
-    // extract the literal value of the nth actual of ci, which must be of type
+    // Extract the literal value of the nth actual of ci, which must be of type
     // unsigned.
-
     if(ConstantUInt* ui = dyn_cast<ConstantUInt>(ci->getOperand(nth)))
         return ui->getValue();
 
@@ -368,7 +376,6 @@
     generatePlaceholder(endCall, endPair);
 
     // Create info about this site for later documentation
-
     unsigned siteID = extractUnsignedValue(endCall, ENDCALL_ID_OPIDX);
     m_primInfos.push_back(PrimInfo(PrimInfo::REGION, siteID,
                                    startPair.first, endPair.first, m_module,
@@ -385,13 +392,16 @@
     // A placeholder is a "load half-word", "store byte" pair.  This is done in
     // order to make a placeholder sequence that has a relatively small chance
     // of appearing in the original target code.
-
     placeholder.first = 
-        new GlobalVariable(Type::UShortTy, false, GlobalVariable::InternalLinkage,
-                           Constant::getNullValue(Type::UShortTy), "gv", m_module);
+        new GlobalVariable(Type::UShortTy, false,
+                           GlobalVariable::InternalLinkage,
+                           Constant::getNullValue(Type::UShortTy), "gv",
+                           m_module);
     placeholder.second = 
-        new GlobalVariable(Type::UByteTy, false, GlobalVariable::InternalLinkage,
-                           Constant::getNullValue(Type::UByteTy), "tmp", m_module);
+        new GlobalVariable(Type::UByteTy, false,
+                           GlobalVariable::InternalLinkage,
+                           Constant::getNullValue(Type::UByteTy), "tmp",
+                           m_module);
 
     // Build load/store sequence
     buildGuardedGVRead(ci, placeholder.first, placeholder.second);
@@ -403,11 +413,12 @@
     PlaceholderPair php;
     generatePlaceholder(pointCall, php);
 
-    // Create info about this site for later documentation
-
-    // If a call to the counter primitive, mark as counter instead of generic point.
-    PrimInfo::PrimType type = pointCall->getCalledFunction() == m_counterPrimFunc ?
-        PrimInfo::COUNTER : PrimInfo::POINT;
+    // Create info about this site for later documentation.
+    // If a call to the counter primitive, mark as counter instead of
+    // generic point.
+    PrimInfo::PrimType type =
+      pointCall->getCalledFunction() == m_counterPrimFunc ?
+      PrimInfo::COUNTER : PrimInfo::POINT;
 
     unsigned siteID = extractUnsignedValue(pointCall, POINTCALL_ID_OPIDX);
     m_primInfos.push_back(PrimInfo(type, siteID, php.first, m_module,
@@ -421,23 +432,24 @@
                                 GlobalVariable* newGV,
                                 GlobalVariable* newTmp)
 {
-    // Generate a small alloca and store its address to the global variable represented by
-    // m_allocAddr.  This is so that the proper stack offset can be found at runtime by
-    // the later phases.
-
+    // Generate a small alloca and store its address to the global
+    // variable represented by m_allocAddr.  This is so that the
+    // proper stack offset can be found at runtime by the later
+    // phases.
     AllocaInst* ai = new AllocaInst(Type::UByteTy, 0, "marker", ci);
     new StoreInst(ai, m_allocAddr, ci);
 
     // tmp modification for doing experiments: remove boolean guard
     // and just do a straight read of the global volatile
-
     assert(newGV->getType() == PointerType::get(Type::UShortTy) &&
            newTmp->getType() == PointerType::get(Type::UByteTy) &&
            "Encountered unexpected types volatile variables");
 
     BasicBlock* gvAssignBlk = ci->getParent();
     LoadInst* deref = new LoadInst(newGV, "deref", ci);
-    CastInst* toTmpType = new CastInst(deref, newTmp->getType()->getElementType(), "castToTmpType", ci);
+    CastInst* toTmpType =
+      new CastInst(deref, newTmp->getType()->getElementType(), "castToTmpType",
+                   ci);
     new StoreInst(toTmpType, newTmp, ci);
 }
 
@@ -454,3 +466,4 @@
 RegisterOpt<Phase1> pass1("pp1", "PerfPrim Phase 1");
 
 }; // end namespace pp
+}; // end namespace llvm


Index: reopt/lib/Inst/lib/Phase1/PrimInfo.cpp
diff -u reopt/lib/Inst/lib/Phase1/PrimInfo.cpp:1.17 reopt/lib/Inst/lib/Phase1/PrimInfo.cpp:1.18
--- reopt/lib/Inst/lib/Phase1/PrimInfo.cpp:1.17	Sat Sep 13 16:12:09 2003
+++ reopt/lib/Inst/lib/Phase1/PrimInfo.cpp	Wed Nov 19 14:49:53 2003
@@ -1,11 +1,18 @@
-////////////////
-// programmer: Joel Stanley
-//       date: Tue Jan 28 14:07:05 CST 2003
-//     fileid: PrimInfo.cpp
-//    purpose: Captures information about an instance of a performance primitive "marker"
-//             in the code.
+//===- PrimInfo.cpp - Performance primitive marker implementation ---------===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
+//
+// Originally written by Joel Stanley on 28-Jan-2003.  Captures
+// information about an instance of a performance primitive "marker"
+// in the code.
+//
+//===----------------------------------------------------------------------===//
 
-#include <cassert>
 #include "llvm/Module.h"
 #include "llvm/Type.h"
 #include "llvm/DerivedTypes.h"
@@ -14,17 +21,12 @@
 #include "llvm/GlobalVariable.h"
 #include "llvm/Constant.h"
 #include "Support/VectorExtras.h"
-
 #include "PrimInfo.h"
 #include "Intraphase.h"
+#include <cassert>
 
-using std::cerr;
-using std::endl;
-
-namespace pp 
-{
-
-//////////////// PrimInfo implementation ////////////////
+namespace llvm {
+namespace pp {
 
 StructType* PrimInfo::sm_structType = 0;
 
@@ -56,7 +58,8 @@
     m_module(module),
     m_startFunc(calledFunc)
 {
-    assert(type != POINT || calledFunc && "point type --> non-null called function");
+    assert(type != POINT || calledFunc
+           && "point type --> non-null called function");
 }
 
 void PrimInfo::buildStructTypes(Module* module)
@@ -66,20 +69,6 @@
     assert(!init && "Expect only one invocation of this function");
     init = true;
 
-    // {{{ struct PrimInfo
-    // {
-    //   // Site ID for this site (one value identifies one entire interval as well)
-    //   unsigned siteID;
-    //   
-    //   // Type of GBT entry type (i.e., member of enum GBTEntryType)
-    //   unsigned gbtType;
-    //
-    //   // Address of global variable corresponding to this primitive.
-    //   unsigned short* loadVar;
-    //
-    // };
-    // }}}
-
     PointerType* uspt = PointerType::get(Type::UShortTy);
 
     sm_structType =
@@ -103,25 +92,21 @@
 
 void PrimInfo::buildStructInstances(std::vector<Constant*>& gbtElems)
 {
-    StructType* st = getStructType();
-
-    switch(m_type) {
-        case REGION: {
-
-            // Create the struct for the start of the region
-            assert(m_startFunc->asize() == 2 && "Unexpected # args for start func");
-            gbtElems.push_back(makeConstStruct(st, m_siteID, GBT_INTERVAL_START, m_globVol));
-
-            // Create the struct for the end of the region
-            assert(m_endFunc->asize() == 2 && "Unexpected # args for end func");
-            gbtElems.push_back(makeConstStruct(st, m_siteID, GBT_INTERVAL_END, m_globVolEnd));
-
-            break;
-        }
-
-        default:
-            assert(0 && "(BuildStructInstances) Unsupported PrimInfo type");
-    }
+  StructType* st = getStructType();
+  assert ((m_type == REGION)
+          && "(BuildStructInstances) Unsupported PrimInfo type");
+
+  // Create the struct for the start of the region
+  assert(m_startFunc->asize() == 2
+         && "Unexpected # args for start func");
+  gbtElems.push_back(makeConstStruct(st, m_siteID,
+                                     GBT_INTERVAL_START, m_globVol));
+
+  // Create the struct for the end of the region
+  assert(m_endFunc->asize() == 2 && "Unexpected # args for end func");
+  gbtElems.push_back(makeConstStruct(st, m_siteID,
+                                     GBT_INTERVAL_END, m_globVolEnd));
 }
 
-}; // end namespace pp
+} // end namespace pp
+} // end namespace llvm


Index: reopt/lib/Inst/lib/Phase1/PrimInfo.h
diff -u reopt/lib/Inst/lib/Phase1/PrimInfo.h:1.11 reopt/lib/Inst/lib/Phase1/PrimInfo.h:1.12
--- reopt/lib/Inst/lib/Phase1/PrimInfo.h:1.11	Tue Jun 24 10:39:54 2003
+++ reopt/lib/Inst/lib/Phase1/PrimInfo.h	Wed Nov 19 14:49:53 2003
@@ -1,8 +1,24 @@
-////////////////
-// programmer: Joel Stanley
-//       date: Tue Jan 28 14:12:56 CST 2003
-//     fileid: PrimInfo.h
-//    purpose: See PrimInfo.cpp
+//===- PrimInfo.h - Performance primitive marker interface ----------------===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
+//
+// Originally written by Joel Stanley on 28-Jan-2003.  Captures
+// information about an instance of a performance primitive "marker"
+// in the code.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef PRIMINFO_H
+#define PRIMINFO_H
+
+#include <map>
+
+namespace llvm {
 
 class Module;
 class StructType;
@@ -11,10 +27,7 @@
 class Function;
 class CastInst;
 
-#include <map>
-
-namespace pp
-{
+namespace pp {
 
 class PrimInfo 
 {
@@ -63,8 +76,8 @@
     
   private:
     
-    // For a particular primitive, we need to know its type, its specifier, and any
-    // supplied configuration parameters.
+    // For a particular primitive, we need to know its type, its
+    // specifier, and any supplied configuration parameters.
 
     PrimType           m_type;
     unsigned           m_siteID;
@@ -77,4 +90,7 @@
     static StructType* sm_structType;
 };
  
-}; // end namespace pp
+} // end namespace pp
+} // end namespace llvm
+
+#endif // PRIMINFO_H





More information about the llvm-commits mailing list