[cfe-commits] r87087 - in /cfe/trunk: include/clang/AST/ASTContext.h include/clang/Lex/Preprocessor.h include/clang/Parse/Parser.h lib/AST/ASTContext.cpp lib/CodeGen/CGStmt.cpp lib/CodeGen/CodeGenFunction.h lib/CodeGen/CodeGenTypes.h lib/Lex/PPExpressions.cpp lib/Lex/Preprocessor.cpp tools/clang-cc/clang-cc.cpp

Daniel Dunbar daniel at zuster.org
Thu Nov 12 23:51:54 CST 2009


Author: ddunbar
Date: Thu Nov 12 23:51:54 2009
New Revision: 87087

URL: http://llvm.org/viewvc/llvm-project?rev=87087&view=rev
Log:
Wherein the TargetInfo argument to Preprocessor is made 'const' and propogated.

Modified:
    cfe/trunk/include/clang/AST/ASTContext.h
    cfe/trunk/include/clang/Lex/Preprocessor.h
    cfe/trunk/include/clang/Parse/Parser.h
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/lib/CodeGen/CGStmt.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.h
    cfe/trunk/lib/CodeGen/CodeGenTypes.h
    cfe/trunk/lib/Lex/PPExpressions.cpp
    cfe/trunk/lib/Lex/Preprocessor.cpp
    cfe/trunk/tools/clang-cc/clang-cc.cpp

Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=87087&r1=87086&r2=87087&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Thu Nov 12 23:51:54 2009
@@ -232,7 +232,7 @@
   llvm::DenseMap<const Decl *, std::string> DeclComments;
 
 public:
-  TargetInfo &Target;
+  const TargetInfo &Target;
   IdentifierTable &Idents;
   SelectorTable &Selectors;
   Builtin::Context &BuiltinInfo;
@@ -319,7 +319,7 @@
   CanQualType UndeducedAutoTy;
   CanQualType ObjCBuiltinIdTy, ObjCBuiltinClassTy;
 
-  ASTContext(const LangOptions& LOpts, SourceManager &SM, TargetInfo &t,
+  ASTContext(const LangOptions& LOpts, SourceManager &SM, const TargetInfo &t,
              IdentifierTable &idents, SelectorTable &sels,
              Builtin::Context &builtins,
              bool FreeMemory = true, unsigned size_reserve=0);

Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=87087&r1=87086&r2=87087&view=diff

==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Thu Nov 12 23:51:54 2009
@@ -51,7 +51,7 @@
 class Preprocessor {
   Diagnostic        *Diags;
   LangOptions        Features;
-  TargetInfo        &Target;
+  const TargetInfo  &Target;
   FileManager       &FileMgr;
   SourceManager     &SourceMgr;
   ScratchBuffer     *ScratchBuf;
@@ -210,7 +210,8 @@
   std::vector<CachedTokensTy::size_type> BacktrackPositions;
 
 public:
-  Preprocessor(Diagnostic &diags, const LangOptions &opts, TargetInfo &target,
+  Preprocessor(Diagnostic &diags, const LangOptions &opts,
+               const TargetInfo &target,
                SourceManager &SM, HeaderSearch &Headers,
                IdentifierInfoLookup *IILookup = 0,
                bool OwnsHeaderSearch = false);
@@ -221,7 +222,7 @@
   void setDiagnostics(Diagnostic &D) { Diags = &D; }
 
   const LangOptions &getLangOptions() const { return Features; }
-  TargetInfo &getTargetInfo() const { return Target; }
+  const TargetInfo &getTargetInfo() const { return Target; }
   FileManager &getFileManager() const { return FileMgr; }
   SourceManager &getSourceManager() const { return SourceMgr; }
   HeaderSearch &getHeaderSearchInfo() const { return HeaderInfo; }

Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=87087&r1=87086&r2=87087&view=diff

==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Thu Nov 12 23:51:54 2009
@@ -114,7 +114,7 @@
   ~Parser();
 
   const LangOptions &getLang() const { return PP.getLangOptions(); }
-  TargetInfo &getTargetInfo() const { return PP.getTargetInfo(); }
+  const TargetInfo &getTargetInfo() const { return PP.getTargetInfo(); }
   Preprocessor &getPreprocessor() const { return PP; }
   Action &getActions() const { return Actions; }
 

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=87087&r1=87086&r2=87087&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu Nov 12 23:51:54 2009
@@ -35,7 +35,7 @@
 };
 
 ASTContext::ASTContext(const LangOptions& LOpts, SourceManager &SM,
-                       TargetInfo &t,
+                       const TargetInfo &t,
                        IdentifierTable &idents, SelectorTable &sels,
                        Builtin::Context &builtins,
                        bool FreeMem, unsigned size_reserve) :

Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=87087&r1=87086&r2=87087&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Thu Nov 12 23:51:54 2009
@@ -737,7 +737,7 @@
 }
 
 static std::string
-SimplifyConstraint(const char *Constraint, TargetInfo &Target,
+SimplifyConstraint(const char *Constraint, const TargetInfo &Target,
                  llvm::SmallVectorImpl<TargetInfo::ConstraintInfo> *OutCons=0) {
   std::string Result;
 

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=87087&r1=87086&r2=87087&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Thu Nov 12 23:51:54 2009
@@ -74,7 +74,7 @@
   void operator=(const CodeGenFunction&);  // DO NOT IMPLEMENT
 public:
   CodeGenModule &CGM;  // Per-module state.
-  TargetInfo &Target;
+  const TargetInfo &Target;
 
   typedef std::pair<llvm::Value *, llvm::Value *> ComplexPairTy;
   CGBuilderTy Builder;

Modified: cfe/trunk/lib/CodeGen/CodeGenTypes.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTypes.h?rev=87087&r1=87086&r2=87087&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenTypes.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenTypes.h Thu Nov 12 23:51:54 2009
@@ -91,7 +91,7 @@
 /// while lowering AST types to LLVM types.
 class CodeGenTypes {
   ASTContext &Context;
-  TargetInfo &Target;
+  const TargetInfo &Target;
   llvm::Module& TheModule;
   const llvm::TargetData& TheTargetData;
   mutable const ABIInfo* TheABIInfo;
@@ -153,7 +153,7 @@
   ~CodeGenTypes();
 
   const llvm::TargetData &getTargetData() const { return TheTargetData; }
-  TargetInfo &getTarget() const { return Target; }
+  const TargetInfo &getTarget() const { return Target; }
   ASTContext &getContext() const { return Context; }
   const ABIInfo &getABIInfo() const;
   llvm::LLVMContext &getLLVMContext() { return TheModule.getContext(); }

Modified: cfe/trunk/lib/Lex/PPExpressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPExpressions.cpp?rev=87087&r1=87086&r2=87087&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/PPExpressions.cpp (original)
+++ cfe/trunk/lib/Lex/PPExpressions.cpp Thu Nov 12 23:51:54 2009
@@ -228,7 +228,7 @@
       return true;  // A diagnostic was already emitted.
 
     // Character literals are always int or wchar_t, expand to intmax_t.
-    TargetInfo &TI = PP.getTargetInfo();
+    const TargetInfo &TI = PP.getTargetInfo();
     unsigned NumBits;
     if (Literal.isMultiChar())
       NumBits = TI.getIntWidth();

Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=87087&r1=87086&r2=87087&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Thu Nov 12 23:51:54 2009
@@ -44,7 +44,7 @@
 //===----------------------------------------------------------------------===//
 
 Preprocessor::Preprocessor(Diagnostic &diags, const LangOptions &opts,
-                           TargetInfo &target, SourceManager &SM,
+                           const TargetInfo &target, SourceManager &SM,
                            HeaderSearch &Headers,
                            IdentifierInfoLookup* IILookup,
                            bool OwnsHeaders)

Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=87087&r1=87086&r2=87087&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Thu Nov 12 23:51:54 2009
@@ -224,7 +224,7 @@
                    const PreprocessorOptions &PPOpts,
                    const HeaderSearchOptions &HSOpts,
                    const DependencyOutputOptions &DepOpts,
-                   TargetInfo &Target, SourceManager &SourceMgr,
+                   const TargetInfo &Target, SourceManager &SourceMgr,
                    FileManager &FileMgr) {
   // Create a PTH manager if we are using some form of a token cache.
   PTHManager *PTHMgr = 0;




More information about the cfe-commits mailing list