[llvm] r239601 - [ASan] format AddressSanitizer.cpp with `clang-format -style=Google`, NFC
Alexey Samsonov
vonosmas at gmail.com
Fri Jun 12 10:40:18 PDT 2015
Yeah, AddressSanitizer.cpp was originally written (and updated) with Google
style, but I think that it resides in LLVM for too long that we should
migrate it eventually.
For instance, it makes hard to move the code to/from this file from another
parts of LLVM.
On Fri, Jun 12, 2015 at 8:46 AM, Alexander Potapenko <glider at google.com>
wrote:
> I've asked Dima and he told me we've used Google style previously,
> this was also my impression.
> I think I've tried the default style and the diff was larger.
>
> On Fri, Jun 12, 2015 at 5:42 PM, Alexey Samsonov <vonosmas at gmail.com>
> wrote:
> > Why don't we use LLVM style instead?
> >
> > On Fri, Jun 12, 2015 at 4:27 AM, Alexander Potapenko <glider at google.com>
> > wrote:
> >>
> >> Author: glider
> >> Date: Fri Jun 12 06:27:06 2015
> >> New Revision: 239601
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=239601&view=rev
> >> Log:
> >> [ASan] format AddressSanitizer.cpp with `clang-format -style=Google`,
> NFC
> >>
> >> Modified:
> >> llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
> >>
> >> Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
> >> URL:
> >>
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=239601&r1=239600&r2=239601&view=diff
> >>
> >>
> ==============================================================================
> >> --- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
> >> (original)
> >> +++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Fri
> Jun
> >> 12 06:27:06 2015
> >> @@ -106,10 +106,8 @@ static const char *const kAsanUnpoisonSt
> >> static const char *const kAsanOptionDetectUAR =
> >> "__asan_option_detect_stack_use_after_return";
> >>
> >> -static const char *const kAsanAllocaPoison =
> >> - "__asan_alloca_poison";
> >> -static const char *const kAsanAllocasUnpoison =
> >> - "__asan_allocas_unpoison";
> >> +static const char *const kAsanAllocaPoison = "__asan_alloca_poison";
> >> +static const char *const kAsanAllocasUnpoison =
> >> "__asan_allocas_unpoison";
> >>
> >> // Accesses sizes are powers of two: 1, 2, 4, 8, 16.
> >> static const size_t kNumberOfAccessSizes = 5;
> >> @@ -410,8 +408,7 @@ struct AddressSanitizer : public Functio
> >> /// If it is an interesting memory access, return the PointerOperand
> >> /// and set IsWrite/Alignment. Otherwise return nullptr.
> >> Value *isInterestingMemoryAccess(Instruction *I, bool *IsWrite,
> >> - uint64_t *TypeSize,
> >> - unsigned *Alignment);
> >> + uint64_t *TypeSize, unsigned
> >> *Alignment);
> >> void instrumentMop(ObjectSizeOffsetVisitor &ObjSizeVis, Instruction
> *I,
> >> bool UseCalls, const DataLayout &DL);
> >> void instrumentPointerComparisonOrSubtraction(Instruction *I);
> >> @@ -588,7 +585,7 @@ struct FunctionStackPoisoner : public In
> >> Value *SavedStack) {
> >> IRBuilder<> IRB(InstBefore);
> >> IRB.CreateCall(AsanAllocasUnpoisonFunc,
> >> - {IRB.CreateLoad(DynamicAllocaLayout),
> >> + {IRB.CreateLoad(DynamicAllocaLayout),
> >> IRB.CreatePtrToInt(SavedStack, IntptrTy)});
> >> }
> >>
> >> @@ -1706,8 +1703,7 @@ void FunctionStackPoisoner::poisonStack(
> >> if (ClInstrumentAllocas && DynamicAllocaVec.size() > 0) {
> >> // Handle dynamic allocas.
> >> createDynamicAllocasInitStorage();
> >> - for (auto &AI : DynamicAllocaVec)
> >> - handleDynamicAllocaCall(AI);
> >> + for (auto &AI : DynamicAllocaVec) handleDynamicAllocaCall(AI);
> >>
> >> unpoisonDynamicAllocas();
> >> }
> >> @@ -1901,9 +1897,9 @@ void FunctionStackPoisoner::poisonAlloca
> >> // For now just insert the call to ASan runtime.
> >> Value *AddrArg = IRB.CreatePointerCast(V, IntptrTy);
> >> Value *SizeArg = ConstantInt::get(IntptrTy, Size);
> >> - IRB.CreateCall(DoPoison ? AsanPoisonStackMemoryFunc
> >> - : AsanUnpoisonStackMemoryFunc,
> >> - {AddrArg, SizeArg});
> >> + IRB.CreateCall(
> >> + DoPoison ? AsanPoisonStackMemoryFunc :
> AsanUnpoisonStackMemoryFunc,
> >> + {AddrArg, SizeArg});
> >> }
> >>
> >> // Handling llvm.lifetime intrinsics for a given %alloca:
> >>
> >>
> >> _______________________________________________
> >> llvm-commits mailing list
> >> llvm-commits at cs.uiuc.edu
> >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >
> >
> >
> >
> > --
> > Alexey Samsonov
> > vonosmas at gmail.com
>
>
>
> --
> Alexander Potapenko
> Software Engineer
>
> Google Germany GmbH
> Dienerstraße 12
> 80331 München
>
--
Alexey Samsonov
vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150612/16f58153/attachment.html>
More information about the llvm-commits
mailing list