[PATCH] Prologue support

Peter Collingbourne peter at pcc.me.uk
Fri Nov 28 17:02:06 PST 2014


> Function prologue sigils: TODO figure out what Reid meant by this

I think he means (for example) the mechanism ubsan uses to check function types. More details in section 5 of this paper: http://www.pcc.me.uk/~peter/acad/usenix14.pdf

You will also need to modify Clang to use `prologue` instead of `prefix` for ubsan.

================
Comment at: lib/AsmParser/LLParser.cpp:1155
@@ +1154,3 @@
+///   ::= int32
+bool LLParser::ParseInt32(signed &Val) {
+  if (Lex.getKind() != lltok::APSInt)
----------------
This function doesn't appear to be used.

================
Comment at: lib/Bitcode/Reader/BitcodeReader.cpp:2072
@@ -2056,1 +2071,3 @@
         FunctionPrefixes.push_back(std::make_pair(Func, Record[10]-1));
+      if (Record.size() > 11 && Record[11] != 0)
+        FunctionPrologues.push_back(std::make_pair(Func, Record[11]-1));
----------------
I think those who care about backwards compatibility of bitcode would prefer the new field to appear at the end.

Along the same lines, because of the change in semantics, we should store `prologue` at offset 10 and `prefix` at the end.

================
Comment at: test/CodeGen/X86/prefixdata.ll:6
@@ -7,2 +5,3 @@
+; CHECK: .type f, at function
 ; CHECK-NEXT: .long	1
 define void @f() prefix i32 1 {
----------------
You could check that the function label appears after the prefix data here.

http://reviews.llvm.org/D6454






More information about the llvm-commits mailing list