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

Evgeniy Stepanov eugenis at google.com
Tue Sep 9 03:51:25 PDT 2014


================
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) {}
----------------
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.


================
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" }
----------------
attribute 1 and 3 seem to be unused
maybe remove all the fp-math stuff from 2 and 4, too


================
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}
----------------
remove this, and all !srcloc.

http://reviews.llvm.org/D5189






More information about the llvm-commits mailing list