Patches for building llvm on Solaris x86. Contributed by Nathan Keynes.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 30 May 2008 17:16:20 +0000 (17:16 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 30 May 2008 17:16:20 +0000 (17:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51775 91177308-0d34-0410-b5e6-96231b3b80d8

13 files changed:
Makefile.rules
include/llvm/Analysis/AliasAnalysis.h
include/llvm/Analysis/AliasSetTracker.h
include/llvm/Analysis/CallGraph.h
include/llvm/Analysis/LibCallSemantics.h
include/llvm/Assembly/PrintModulePass.h
include/llvm/CodeGen/MachineRelocation.h
include/llvm/Support/CallSite.h
include/llvm/Target/TargetMachineRegistry.h
include/llvm/Transforms/IPO/InlinerPass.h
include/llvm/Transforms/Utils/Cloning.h
include/llvm/Transforms/Utils/InlineCost.h
utils/GenLibDeps.pl

index 55d4d1b703823b83e09868ce393fce31e4379911..c74c46c56c5ed2b8aeb7374baf35e4e1b7df7c70 100644 (file)
@@ -451,6 +451,11 @@ ifdef UNIVERSAL
   DISABLE_AUTO_DEPENDENCIES=1
 endif
 
+# Solaris requires the following flags to compile
+ifeq ($(OS),SunOS)
+CXX.Flags += -D_POSIX_C_SOURCE=199506L -U_XOPEN_SOURCE 
+endif
+
 LD.Flags      += -L$(LibDir) -L$(LLVMLibDir) 
 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
 # All -I flags should go here, so that they don't confuse llvm-config.
index e013a4dc6debe4a3427fbea9370c818b6d085806..6333a5c85cb8b0dab09eb34a1d76e0573bbd52a9 100644 (file)
@@ -187,7 +187,7 @@ public:
   };
 
   /// getModRefBehavior - Return the behavior when calling the given call site.
-  ModRefBehavior getModRefBehavior(CallSite CS,
+  ModRefBehavior getModRefBehavior(CallSite cs,
                                    std::vector<PointerAccessInfo> *Info = 0);
 
   /// getModRefBehavior - Return the behavior when calling the given function.
@@ -206,8 +206,8 @@ public:
   ///
   /// This property corresponds to the GCC 'const' attribute.
   ///
-  bool doesNotAccessMemory(CallSite CS) {
-    return getModRefBehavior(CS) == DoesNotAccessMemory;
+  bool doesNotAccessMemory(CallSite cs) {
+    return getModRefBehavior(cs) == DoesNotAccessMemory;
   }
 
   /// doesNotAccessMemory - If the specified function is known to never read or
@@ -226,8 +226,8 @@ public:
   ///
   /// This property corresponds to the GCC 'pure' attribute.
   ///
-  bool onlyReadsMemory(CallSite CS) {
-    ModRefBehavior MRB = getModRefBehavior(CS);
+  bool onlyReadsMemory(CallSite cs) {
+    ModRefBehavior MRB = getModRefBehavior(cs);
     return MRB == DoesNotAccessMemory || MRB == OnlyReadsMemory;
   }
 
@@ -249,7 +249,7 @@ public:
   /// a particular call site modifies or reads the memory specified by the
   /// pointer.
   ///
-  virtual ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
+  virtual ModRefResult getModRefInfo(CallSite cs, Value *P, unsigned Size);
 
   /// getModRefInfo - Return information about whether two call sites may refer
   /// to the same set of memory locations.  This function returns NoModRef if
@@ -257,7 +257,7 @@ public:
   /// written by CS2, Mod if CS1 writes to memory read or written by CS2, or
   /// ModRef if CS1 might read or write memory accessed by CS2.
   ///
-  virtual ModRefResult getModRefInfo(CallSite CS1, CallSite CS2);
+  virtual ModRefResult getModRefInfo(CallSite cs1, CallSite cs2);
 
   /// hasNoModRefInfoForCalls - Return true if the analysis has no mod/ref
   /// information for pairs of function calls (other than "pure" and "const"
@@ -271,7 +271,7 @@ protected:
   /// getModRefBehavior - Return the behavior of the specified function if
   /// called from the specified call site.  The call site may be null in which
   /// case the most generic behavior of this function should be returned.
-  virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS,
+  virtual ModRefBehavior getModRefBehavior(Function *F, CallSite cs,
                                      std::vector<PointerAccessInfo> *Info = 0);
 
 public:
index d9e45ce9a1c46682360ba6a3f2b580681099c7dd..df674b03d87db6244cf6d2d23eb686744db24b8b 100644 (file)
@@ -230,10 +230,10 @@ private:
 
   void addPointer(AliasSetTracker &AST, HashNodePair &Entry, unsigned Size,
                   bool KnownMustAlias = false);
-  void addCallSite(CallSite CS, AliasAnalysis &AA);
-  void removeCallSite(CallSite CS) {
+  void addCallSite(CallSite cs, AliasAnalysis &AA);
+  void removeCallSite(CallSite cs) {
     for (size_t i = 0, e = CallSites.size(); i != e; ++i)
-      if (CallSites[i].getInstruction() == CS.getInstruction()) {
+      if (CallSites[i].getInstruction() == cs.getInstruction()) {
         CallSites[i] = CallSites.back();
         CallSites.pop_back();
       }
@@ -244,7 +244,7 @@ private:
   /// alias one of the members in the set.
   ///
   bool aliasesPointer(const Value *Ptr, unsigned Size, AliasAnalysis &AA) const;
-  bool aliasesCallSite(CallSite CS, AliasAnalysis &AA) const;
+  bool aliasesCallSite(CallSite cs, AliasAnalysis &AA) const;
 };
 
 inline std::ostream& operator<<(std::ostream &OS, const AliasSet &AS) {
@@ -283,7 +283,7 @@ public:
   bool add(StoreInst *SI);
   bool add(FreeInst *FI);
   bool add(VAArgInst *VAAI);
-  bool add(CallSite CS);          // Call/Invoke instructions
+  bool add(CallSite cs);          // Call/Invoke instructions
   bool add(CallInst *CI)   { return add(CallSite(CI)); }
   bool add(InvokeInst *II) { return add(CallSite(II)); }
   bool add(Instruction *I);       // Dispatch to one of the other add methods...
@@ -298,7 +298,7 @@ public:
   bool remove(StoreInst *SI);
   bool remove(FreeInst *FI);
   bool remove(VAArgInst *VAAI);
-  bool remove(CallSite CS);
+  bool remove(CallSite cs);
   bool remove(CallInst *CI)   { return remove(CallSite(CI)); }
   bool remove(InvokeInst *II) { return remove(CallSite(II)); }
   bool remove(Instruction *I);
@@ -383,7 +383,7 @@ private:
   }
   AliasSet *findAliasSetForPointer(const Value *Ptr, unsigned Size);
 
-  AliasSet *findAliasSetForCallSite(CallSite CS);
+  AliasSet *findAliasSetForCallSite(CallSite cs);
 };
 
 inline std::ostream& operator<<(std::ostream &OS, const AliasSetTracker &AST) {
index 3fe03b5e74c98702d0716916ee8affb064f409ad..b6fef7134f7567200b29e66df9db486b9fd4f711 100644 (file)
@@ -216,8 +216,8 @@ public:
 
   /// addCalledFunction add a function to the list of functions called by this
   /// one.
-  void addCalledFunction(CallSite CS, CallGraphNode *M) {
-    CalledFunctions.push_back(std::make_pair(CS, M));
+  void addCalledFunction(CallSite cs, CallGraphNode *M) {
+    CalledFunctions.push_back(std::make_pair(cs, M));
   }
 
   /// removeCallEdgeTo - This method removes a *single* edge to the specified
@@ -228,7 +228,7 @@ public:
   /// removeCallEdgeFor - This method removes the edge in the node for the
   /// specified call site.  Note that this method takes linear time, so it
   /// should be used sparingly.
-  void removeCallEdgeFor(CallSite CS);
+  void removeCallEdgeFor(CallSite cs);
   
   /// removeAnyCallEdgeTo - This method removes any call edges from this node to
   /// the specified callee function.  This takes more time to execute than
index 74e8401a1fe601b345c00ba233f7849a5735f732..72de39211aebcbe6683c1eaef6808a026647c917 100644 (file)
@@ -47,7 +47,7 @@ namespace llvm {
     enum LocResult {
       Yes, No, Unknown
     };
-    LocResult (*isLocation)(CallSite CS, const Value *Ptr, unsigned Size);
+    LocResult (*isLocation)(CallSite cs, const Value *Ptr, unsigned Size);
   };
   
   /// LibCallFunctionInfo - Each record in the array of FunctionInfo structs
index ee5cff509aaa675c48cf6b074ab483db615308f7..d9e4390356b68bc95762dedcaa4e6c69d84d9429 100644 (file)
@@ -31,8 +31,8 @@ public:
   static char ID;
   PrintModulePass() : ModulePass(intptr_t(&ID)), Out(&cerr), 
                       DeleteStream(false) {}
-  PrintModulePass(OStream *o, bool DS = false)
-    : ModulePass(intptr_t(&ID)), Out(o), DeleteStream(DS) {}
+  PrintModulePass(OStream *o, bool ds = false)
+    : ModulePass(intptr_t(&ID)), Out(o), DeleteStream(ds) {}
 
   ~PrintModulePass() {
     if (DeleteStream) delete Out;
@@ -57,8 +57,8 @@ public:
   PrintFunctionPass() : FunctionPass(intptr_t(&ID)), Banner(""), Out(&cerr), 
                         DeleteStream(false) {}
   PrintFunctionPass(const std::string &B, OStream *o = &cout,
-                    bool DS = false)
-    : FunctionPass(intptr_t(&ID)), Banner(B), Out(o), DeleteStream(DS) {}
+                    bool ds = false)
+    : FunctionPass(intptr_t(&ID)), Banner(B), Out(o), DeleteStream(ds) {}
 
   inline ~PrintFunctionPass() {
     if (DeleteStream) delete Out;
index fa23a4d1c4b0f0d602d5eb0c72859964cf3cf063..775f6115b777f990f5a607202f07fb420f69f018 100644 (file)
@@ -133,7 +133,7 @@ public:
   /// symbol, like "free".
   ///
   static MachineRelocation getExtSym(intptr_t offset, unsigned RelocationType, 
-                                     const char *ES, intptr_t cst = 0,
+                                     const char *es, intptr_t cst = 0,
                                      bool GOTrelative = 0) {
     assert((RelocationType & ~63) == 0 && "Relocation type too large!");
     MachineRelocation Result;
@@ -143,7 +143,7 @@ public:
     Result.AddrType = isExtSym;
     Result.NeedStub = true;
     Result.GOTRelative = GOTrelative;
-    Result.Target.ExtSym = ES;
+    Result.Target.ExtSym = es;
     return Result;
   }
 
index f118680d6fc8304befd4a7c753c4770cf88aa9fe..d7b28fce37feff5b07a9fbee23a4f283346c9261 100644 (file)
@@ -36,11 +36,11 @@ public:
   CallSite(CallInst *CI) : I(reinterpret_cast<Instruction*>(CI)) {}
   CallSite(InvokeInst *II) : I(reinterpret_cast<Instruction*>(II)) {}
   CallSite(Instruction *C);
-  CallSite(const CallSite &CS) : I(CS.I) {}
-  CallSite &operator=(const CallSite &CS) { I = CS.I; return *this; }
+  CallSite(const CallSite &cs) : I(cs.I) {}
+  CallSite &operator=(const CallSite &cs) { I = cs.I; return *this; }
 
-  bool operator==(const CallSite &CS) const { return I == CS.I; }
-  bool operator!=(const CallSite &CS) const { return I != CS.I; }
+  bool operator==(const CallSite &cs) const { return I == cs.I; }
+  bool operator!=(const CallSite &cs) const { return I != cs.I; }
   
   /// CallSite::get - This static method is sort of like a constructor.  It will
   /// create an appropriate call site for a Call or Invoke instruction, but it
@@ -148,8 +148,8 @@ public:
   bool arg_empty() const { return arg_end() == arg_begin(); }
   unsigned arg_size() const { return unsigned(arg_end() - arg_begin()); }
 
-  bool operator<(const CallSite &CS) const {
-    return getInstruction() < CS.getInstruction();
+  bool operator<(const CallSite &cs) const {
+    return getInstruction() < cs.getInstruction();
   }
 };
 
index 2607ad5e639194d8167852ef1e6bab16cbf4459f..280db90ced8cb976730cd8dd17c56cbb97017c4b 100644 (file)
@@ -70,7 +70,7 @@ namespace llvm {
   /// The type 'TargetMachineImpl' should provide a constructor with two 
   /// parameters:
   /// - const Module& M: the module that is being compiled:
-  /// - const std::string& FS: target-specific string describing target 
+  /// - const std::string& fs: target-specific string describing target 
   ///   flavour.
   
   template<class TargetMachineImpl>
@@ -86,8 +86,8 @@ namespace llvm {
     TargetMachineRegistry::entry Entry;
     TargetMachineRegistry::node Node;
     
-    static TargetMachine *Allocator(const Module &M, const std::string &FS) {
-      return new TargetMachineImpl(M, FS);
+    static TargetMachine *Allocator(const Module &M, const std::string &fs) {
+      return new TargetMachineImpl(M, fs);
     }
   };
 
index d34641def09b09f8fde8d7376c943ebe09e7c549..3a2b36cae2c00c3ec5756d6e23dfb6b66e656f99 100644 (file)
@@ -53,12 +53,12 @@ struct Inliner : public CallGraphSCCPass {
   /// returned is greater than the current inline threshold, the call site is
   /// not inlined.
   ///
-  virtual int getInlineCost(CallSite CS) = 0;
+  virtual int getInlineCost(CallSite cs) = 0;
 
   // getInlineFudgeFactor - Return a > 1.0 factor if the inliner should use a
   // higher threshold to determine if the function call should be inlined.
   ///
-  virtual float getInlineFudgeFactor(CallSite CS) = 0;
+  virtual float getInlineFudgeFactor(CallSite cs) = 0;
 
 private:
   // InlineThreshold - Cache the value here for easy access.
index 1e2bbaa295b37139c90b6910928650cb281249aa..2de66e4a3ccb6dbe0c1e416bbe176a372e19df07 100644 (file)
@@ -184,7 +184,7 @@ std::vector<BasicBlock *> CloneTrace(const std::vector<BasicBlock*> &origTrace);
 ///
 bool InlineFunction(CallInst *C, CallGraph *CG = 0, const TargetData *TD = 0);
 bool InlineFunction(InvokeInst *II, CallGraph *CG = 0, const TargetData *TD =0);
-bool InlineFunction(CallSite CS, CallGraph *CG = 0, const TargetData *TD = 0);
+bool InlineFunction(CallSite cs, CallGraph *CG = 0, const TargetData *TD = 0);
 
 } // End llvm namespace
 
index 6018a803c6f99852a3b8519441b604f79d5e1a7b..b56678b20423de1e0e13bbdcb80718f64f65d0d9 100644 (file)
@@ -77,12 +77,12 @@ namespace llvm {
     // getInlineCost - The heuristic used to determine if we should inline the
     // function call or not.
     //
-    int getInlineCost(CallSite CS,
+    int getInlineCost(CallSite cs,
                       SmallPtrSet<const Function *, 16> &NeverInline);
 
     // getInlineFudgeFactor - Return a > 1.0 factor if the inliner should use a
     // higher threshold to determine if the function call should be inlined.
-    float getInlineFudgeFactor(CallSite CS);
+    float getInlineFudgeFactor(CallSite cs);
   };
 }
 
index 74eedd3383bcac469dd2252a04e9de6a9d073bc9..35811b4e3cd132c33ff7a6a3af19fd0da32817bd 100755 (executable)
@@ -96,7 +96,7 @@ sub gen_one_entry {
     print "  <dt><b>$lib</b</dt><dd><ul>\n";
   }
   open UNDEFS, 
-    "$nmPath -g -u $Directory/$lib | sed -e 's/^  *U //' | sort | uniq |";
+    "$nmPath -g -u $Directory/$lib | sed -e 's/^[ 0]* U //' | sort | uniq |";
   my %DepLibs;
   while (<UNDEFS>) {
     chomp;