<div dir="ltr">Why don't we use LLVM style instead?</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 12, 2015 at 4:27 AM, Alexander Potapenko <span dir="ltr"><<a href="mailto:glider@google.com" target="_blank">glider@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: glider<br>
Date: Fri Jun 12 06:27:06 2015<br>
New Revision: 239601<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D239601-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=U9x0o1I-hm4qR38YO4tz7GKkvuBQ-MpxxbWMCOuEWhg&s=aYu71xvvGEci3NScBzmSjLBMr1dYGY_kc50vLp9Ouaw&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=239601&view=rev</a><br>
Log:<br>
[ASan] format AddressSanitizer.cpp with `clang-format -style=Google`, NFC<br>
<br>
Modified:<br>
llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp<br>
<br>
Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_Transforms_Instrumentation_AddressSanitizer.cpp-3Frev-3D239601-26r1-3D239600-26r2-3D239601-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=U9x0o1I-hm4qR38YO4tz7GKkvuBQ-MpxxbWMCOuEWhg&s=PKD-RlnsiMwWNGTA8YUZUM1R_Dyyz_HV28o7w9X7iRE&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=239601&r1=239600&r2=239601&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Fri Jun 12 06:27:06 2015<br>
@@ -106,10 +106,8 @@ static const char *const kAsanUnpoisonSt<br>
static const char *const kAsanOptionDetectUAR =<br>
"__asan_option_detect_stack_use_after_return";<br>
<br>
-static const char *const kAsanAllocaPoison =<br>
- "__asan_alloca_poison";<br>
-static const char *const kAsanAllocasUnpoison =<br>
- "__asan_allocas_unpoison";<br>
+static const char *const kAsanAllocaPoison = "__asan_alloca_poison";<br>
+static const char *const kAsanAllocasUnpoison = "__asan_allocas_unpoison";<br>
<br>
// Accesses sizes are powers of two: 1, 2, 4, 8, 16.<br>
static const size_t kNumberOfAccessSizes = 5;<br>
@@ -410,8 +408,7 @@ struct AddressSanitizer : public Functio<br>
/// If it is an interesting memory access, return the PointerOperand<br>
/// and set IsWrite/Alignment. Otherwise return nullptr.<br>
Value *isInterestingMemoryAccess(Instruction *I, bool *IsWrite,<br>
- uint64_t *TypeSize,<br>
- unsigned *Alignment);<br>
+ uint64_t *TypeSize, unsigned *Alignment);<br>
void instrumentMop(ObjectSizeOffsetVisitor &ObjSizeVis, Instruction *I,<br>
bool UseCalls, const DataLayout &DL);<br>
void instrumentPointerComparisonOrSubtraction(Instruction *I);<br>
@@ -588,7 +585,7 @@ struct FunctionStackPoisoner : public In<br>
Value *SavedStack) {<br>
IRBuilder<> IRB(InstBefore);<br>
IRB.CreateCall(AsanAllocasUnpoisonFunc,<br>
- {IRB.CreateLoad(DynamicAllocaLayout),<br>
+ {IRB.CreateLoad(DynamicAllocaLayout),<br>
IRB.CreatePtrToInt(SavedStack, IntptrTy)});<br>
}<br>
<br>
@@ -1706,8 +1703,7 @@ void FunctionStackPoisoner::poisonStack(<br>
if (ClInstrumentAllocas && DynamicAllocaVec.size() > 0) {<br>
// Handle dynamic allocas.<br>
createDynamicAllocasInitStorage();<br>
- for (auto &AI : DynamicAllocaVec)<br>
- handleDynamicAllocaCall(AI);<br>
+ for (auto &AI : DynamicAllocaVec) handleDynamicAllocaCall(AI);<br>
<br>
unpoisonDynamicAllocas();<br>
}<br>
@@ -1901,9 +1897,9 @@ void FunctionStackPoisoner::poisonAlloca<br>
// For now just insert the call to ASan runtime.<br>
Value *AddrArg = IRB.CreatePointerCast(V, IntptrTy);<br>
Value *SizeArg = ConstantInt::get(IntptrTy, Size);<br>
- IRB.CreateCall(DoPoison ? AsanPoisonStackMemoryFunc<br>
- : AsanUnpoisonStackMemoryFunc,<br>
- {AddrArg, SizeArg});<br>
+ IRB.CreateCall(<br>
+ DoPoison ? AsanPoisonStackMemoryFunc : AsanUnpoisonStackMemoryFunc,<br>
+ {AddrArg, SizeArg});<br>
}<br>
<br>
// Handling llvm.lifetime intrinsics for a given %alloca:<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</div>