]> granicus.if.org Git - clang/commitdiff
More const is always good.
authorAnders Carlsson <andersca@mac.com>
Tue, 17 Nov 2009 03:57:07 +0000 (03:57 +0000)
committerAnders Carlsson <andersca@mac.com>
Tue, 17 Nov 2009 03:57:07 +0000 (03:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89033 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExpr.cpp
lib/CodeGen/CodeGenFunction.h

index 1844b02516f38eb703a003b6b6be9646c012a097..ff3fdd56920bbe43b1b39f8d760c354bf3aeb7c2 100644 (file)
@@ -1171,7 +1171,7 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) {
 }
 
 LValue CodeGenFunction::EmitLValueForBitfield(llvm::Value* BaseValue,
-                                              FieldDecl* Field,
+                                              const FieldDecl* Field,
                                               unsigned CVRQualifiers) {
   CodeGenTypes::BitFieldInfo Info = CGM.getTypes().getBitFieldInfo(Field);
 
@@ -1196,7 +1196,7 @@ LValue CodeGenFunction::EmitLValueForBitfield(llvm::Value* BaseValue,
 }
 
 LValue CodeGenFunction::EmitLValueForField(llvm::Value* BaseValue,
-                                           FieldDecl* Field,
+                                           const FieldDecl* Field,
                                            bool isUnion,
                                            unsigned CVRQualifiers) {
   if (Field->isBitField())
@@ -1563,8 +1563,8 @@ LValue CodeGenFunction::EmitPointerToDataMemberLValue(const FieldDecl *Field) {
       getContext().getTypeDeclType(const_cast<CXXRecordDecl*>(ClassDecl)));
   NNSpecTy = getContext().getPointerType(NNSpecTy);
   llvm::Value *V = llvm::Constant::getNullValue(ConvertType(NNSpecTy));
-  LValue MemExpLV = EmitLValueForField(V, const_cast<FieldDecl*>(Field)
-                                       /*isUnion*/false, /*Qualifiers*/0);
+  LValue MemExpLV = EmitLValueForField(V, Field, /*isUnion=*/false
+                                       /*Qualifiers=*/0);
   const llvm::Type *ResultType = ConvertType(getContext().getPointerDiffType());
   V = Builder.CreatePtrToInt(MemExpLV.getAddress(), ResultType, "datamember");
   return LValue::MakeAddr(V, MakeQualifiers(Field->getType()));
index d0f184fc6f7d73d0ce4ca05e19f9868c604493ec..44561473100394d4c12a23b44263d9461ebec790 100644 (file)
@@ -844,13 +844,13 @@ public:
   
   llvm::Value *EmitIvarOffset(const ObjCInterfaceDecl *Interface,
                               const ObjCIvarDecl *Ivar);
-  LValue EmitLValueForField(llvm::Value* Base, FieldDecl* Field,
+  LValue EmitLValueForField(llvm::Value* Base, const FieldDecl* Field,
                             bool isUnion, unsigned CVRQualifiers);
   LValue EmitLValueForIvar(QualType ObjectTy,
                            llvm::Value* Base, const ObjCIvarDecl *Ivar,
                            unsigned CVRQualifiers);
 
-  LValue EmitLValueForBitfield(llvm::Value* Base, FieldDecl* Field,
+  LValue EmitLValueForBitfield(llvm::Value* Base, const FieldDecl* Field,
                                 unsigned CVRQualifiers);
 
   LValue EmitBlockDeclRefLValue(const BlockDeclRefExpr *E);