diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-03-05 18:54:05 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-03-05 18:54:05 +0000 |
| commit | 37e058783948f450f26dc863a694d28146a06d78 (patch) | |
| tree | c8ac9f121af67cc67e4e079c0ea8eee6aec25224 /clang/Sema/SemaDecl.cpp | |
| parent | ae3429f5f1287cc953f5f4cafcc99b684e9f1e96 (diff) | |
| download | bcm5719-llvm-37e058783948f450f26dc863a694d28146a06d78.tar.gz bcm5719-llvm-37e058783948f450f26dc863a694d28146a06d78.zip | |
remove the source location arguments to various target query methods.
llvm-svn: 47954
Diffstat (limited to 'clang/Sema/SemaDecl.cpp')
| -rw-r--r-- | clang/Sema/SemaDecl.cpp | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/clang/Sema/SemaDecl.cpp b/clang/Sema/SemaDecl.cpp index b45317ac9c1..bb26ce70e76 100644 --- a/clang/Sema/SemaDecl.cpp +++ b/clang/Sema/SemaDecl.cpp @@ -1561,8 +1561,7 @@ Sema::DeclTy *Sema::ActOnEnumConstant(Scope *S, DeclTy *theEnumDecl, } else { // First value, set to zero. EltTy = Context.IntTy; - EnumVal.zextOrTrunc( - static_cast<uint32_t>(Context.getTypeSize(EltTy, IdLoc))); + EnumVal.zextOrTrunc(static_cast<uint32_t>(Context.getTypeSize(EltTy))); } } @@ -1584,9 +1583,7 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, DeclTy *EnumDeclX, // TODO: If the result value doesn't fit in an int, it must be a long or long // long value. ISO C does not support this, but GCC does as an extension, // emit a warning. - unsigned IntWidth = - Context.Target.getIntWidth(Context.getFullLoc(Enum->getLocation())); - + unsigned IntWidth = Context.Target.getIntWidth(); // Verify that all the values are okay, compute the size of the values, and // reverse the list. @@ -1643,14 +1640,12 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, DeclTy *EnumDeclX, BestType = Context.IntTy; BestWidth = IntWidth; } else { - BestWidth = - Context.Target.getLongWidth(Context.getFullLoc(Enum->getLocation())); + BestWidth = Context.Target.getLongWidth(); if (NumNegativeBits <= BestWidth && NumPositiveBits < BestWidth) BestType = Context.LongTy; else { - BestWidth = Context.Target.getLongLongWidth( - Context.getFullLoc(Enum->getLocation())); + BestWidth = Context.Target.getLongLongWidth(); if (NumNegativeBits > BestWidth || NumPositiveBits >= BestWidth) Diag(Enum->getLocation(), diag::warn_enum_too_large); @@ -1664,14 +1659,10 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, DeclTy *EnumDeclX, BestType = Context.UnsignedIntTy; BestWidth = IntWidth; } else if (NumPositiveBits <= - (BestWidth = Context.Target.getLongWidth( - Context.getFullLoc(Enum->getLocation())))) - + (BestWidth = Context.Target.getLongWidth())) { BestType = Context.UnsignedLongTy; - else { - BestWidth = - Context.Target.getLongLongWidth(Context.getFullLoc(Enum->getLocation())); - + } else { + BestWidth = Context.Target.getLongLongWidth(); assert(NumPositiveBits <= BestWidth && "How could an initializer get larger than ULL?"); BestType = Context.UnsignedLongLongTy; @@ -1936,8 +1927,7 @@ QualType Sema::HandleVectorTypeAttribute(QualType curType, curType.getCanonicalType().getAsString()); return QualType(); } - unsigned typeSize = static_cast<unsigned>( - Context.getTypeSize(curType, rawAttr->getLoc())); + unsigned typeSize = static_cast<unsigned>(Context.getTypeSize(curType)); // vecSize is specified in bytes - convert to bits. unsigned vectorSize = static_cast<unsigned>(vecSize.getZExtValue() * 8); @@ -1970,7 +1960,7 @@ void Sema::HandlePackedAttribute(Decl *d, AttributeList *rawAttr) { else if (FieldDecl *FD = dyn_cast<FieldDecl>(d)) { // If the alignment is less than or equal to 8 bits, the packed attribute // has no effect. - if (Context.getTypeAlign(FD->getType(), SourceLocation()) <= 8) + if (Context.getTypeAlign(FD->getType()) <= 8) Diag(rawAttr->getLoc(), diag::warn_attribute_ignored_for_field_of_type, rawAttr->getName()->getName(), FD->getType().getAsString()); |

