[PATCH] D68824: Fix __builtin_assume_aligned with too large values.

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 10 12:28:09 PDT 2019


lebedev.ri added a comment.

Thanks, i like it.



================
Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:2058-2073
+/*
 void CodeGenFunction::EmitAlignmentAssumption(llvm::Value *PtrValue,
                                               QualType Ty, SourceLocation Loc,
                                               SourceLocation AssumptionLoc,
                                               unsigned Alignment,
                                               llvm::Value *OffsetValue) {
   llvm::Value *TheCheck;
----------------
Just remove.


================
Comment at: clang/lib/CodeGen/CodeGenFunction.h:2831-2836
+/*
   void EmitAlignmentAssumption(llvm::Value *PtrValue, QualType Ty,
                                SourceLocation Loc, SourceLocation AssumptionLoc,
                                unsigned Alignment,
                                llvm::Value *OffsetValue = nullptr);
+*/
----------------
Just remove.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:6066
              << Arg->getSourceRange();
+    if (Result > (1 << 29ULL))
+      Diag(TheCall->getBeginLoc(), diag::warn_assume_align_too_big)
----------------
`(1ULL << 29ULL)`.
Is there some define for this somwhere, don't like magic numbers.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68824/new/

https://reviews.llvm.org/D68824





More information about the cfe-commits mailing list