[cfe-commits] r136679 - in /cfe/trunk/lib: ARCMigrate/ARCMT.cpp Analysis/LiveVariables.cpp Sema/SemaDeclAttr.cpp

Benjamin Kramer benny.kra at googlemail.com
Mon Aug 1 21:50:49 PDT 2011


Author: d0k
Date: Mon Aug  1 23:50:49 2011
New Revision: 136679

URL: http://llvm.org/viewvc/llvm-project?rev=136679&view=rev
Log:
Make helper functions static.

Modified:
    cfe/trunk/lib/ARCMigrate/ARCMT.cpp
    cfe/trunk/lib/Analysis/LiveVariables.cpp
    cfe/trunk/lib/Sema/SemaDeclAttr.cpp

Modified: cfe/trunk/lib/ARCMigrate/ARCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ARCMT.cpp?rev=136679&r1=136678&r2=136679&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ARCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ARCMT.cpp Mon Aug  1 23:50:49 2011
@@ -176,7 +176,8 @@
   return false;
 }
 
-CompilerInvocation *createInvocationForMigration(CompilerInvocation &origCI) {
+static CompilerInvocation *
+createInvocationForMigration(CompilerInvocation &origCI) {
   llvm::OwningPtr<CompilerInvocation> CInvok;
   CInvok.reset(new CompilerInvocation(origCI));
   CInvok->getPreprocessorOpts().ImplicitPCHInclude = std::string();
@@ -193,9 +194,9 @@
   return CInvok.take();
 }
 
-void emitPremigrationErrors(const CapturedDiagList &arcDiags,
-                            const DiagnosticOptions &diagOpts,
-                            Preprocessor &PP) {
+static void emitPremigrationErrors(const CapturedDiagList &arcDiags,
+                                   const DiagnosticOptions &diagOpts,
+                                   Preprocessor &PP) {
   TextDiagnosticPrinter printer(llvm::errs(), diagOpts);
   llvm::IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
   llvm::IntrusiveRefCntPtr<Diagnostic> Diags(

Modified: cfe/trunk/lib/Analysis/LiveVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/LiveVariables.cpp?rev=136679&r1=136678&r2=136679&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/LiveVariables.cpp (original)
+++ cfe/trunk/lib/Analysis/LiveVariables.cpp Mon Aug  1 23:50:49 2011
@@ -433,10 +433,11 @@
   return new LiveVariables(LV);
 }
 
-bool compare_entries(const CFGBlock *A, const CFGBlock *B) {
+static bool compare_entries(const CFGBlock *A, const CFGBlock *B) {
   return A->getBlockID() < B->getBlockID();
 }
-bool compare_vd_entries(const Decl *A, const Decl *B) {
+
+static bool compare_vd_entries(const Decl *A, const Decl *B) {
   SourceLocation ALoc = A->getLocStart();
   SourceLocation BLoc = B->getLocStart();
   return ALoc.getRawEncoding() < BLoc.getRawEncoding();

Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=136679&r1=136678&r2=136679&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Mon Aug  1 23:50:49 2011
@@ -237,10 +237,10 @@
 /// \brief Check if passed in Decl is a field or potentially shared global var
 /// \return true if the Decl is a field or potentially shared global variable
 ///
-static bool mayBeSharedVariable(Decl *D) {
+static bool mayBeSharedVariable(const Decl *D) {
   if (isa<FieldDecl>(D))
     return true;
-  if(VarDecl *vd = dyn_cast<VarDecl>(D))
+  if (const VarDecl *vd = dyn_cast<VarDecl>(D))
     return (vd->hasGlobalStorage() && !(vd->isThreadSpecified()));
 
   return false;
@@ -251,12 +251,11 @@
 /// Note that this function may produce an error message.
 /// \return true if the Decl is a pointer type; false otherwise
 ///
-bool checkIsPointer(Sema & S, Decl * D, const AttributeList & Attr) {
-  if(ValueDecl * vd = dyn_cast <ValueDecl>(D)) {
+static bool checkIsPointer(Sema &S, const Decl *D, const AttributeList &Attr) {
+  if (const ValueDecl *vd = dyn_cast<ValueDecl>(D)) {
     QualType QT = vd->getType();
-    if(QT->isAnyPointerType()) {
+    if (QT->isAnyPointerType())
       return true;
-    }
     S.Diag(Attr.getLoc(), diag::warn_pointer_attribute_wrong_type)
       << Attr.getName()->getName() << QT;
   } else {





More information about the cfe-commits mailing list