[PATCH] [asan-assembly-instrumentation] Added CFI directives to the generated instrumentation code.

Yuri Gorshenin ygorshenin at chromium.org
Tue Sep 9 04:05:42 PDT 2014


PTAL

================
Comment at: include/llvm/MC/MCTargetAsmParser.h:127
@@ +126,3 @@
+  /// Sets frame register corresponding to the current MachineFunction. Doesn't
+  /// called when top-level assembly is parsed.
+  virtual void SetFrameRegister(unsigned RegNo) {}
----------------
eugenis wrote:
> It's better to document what the function does (or does not do), rather then when it is called.
> For example, it looks like FrameReg stays uninitialized if it is not called, resulting in undefined behavior for top-level asm.
> 
FrameReg is a field in X86AsmInstrumentation and initialized to X86::NoRegister in the ctor.

================
Comment at: test/Instrumentation/AddressSanitizer/X86/asm_cfi.ll:45
@@ +44,3 @@
+attributes #0 = { nounwind sanitize_address uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #1 = { nounwind }
+attributes #2 = { nounwind sanitize_address uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
----------------
eugenis wrote:
> attribute 1 and 3 seem to be unused
> maybe remove all the fp-math stuff from 2 and 4, too
> 
Done.

================
Comment at: test/Instrumentation/AddressSanitizer/X86/asm_cfi.ll:49
@@ +48,3 @@
+
+!0 = metadata !{metadata !"clang version 3.6.0 "}
+!1 = metadata !{i32 45, i32 69, i32 107}
----------------
eugenis wrote:
> remove this, and all !srcloc.
> 
Done.

http://reviews.llvm.org/D5189






More information about the llvm-commits mailing list