3 #include <llvm/IR/DebugLoc.h>
4 //#include <llvm/IR/Constant.h>
5 //#include <llvm/IR/Instruction.h>
6 //#include <llvm/IR/IRBuilder.h>
7 //#include <llvm/Support/raw_ostream.h>
9 Value *getPosition( Instruction * I, IRBuilder <> IRB)
11 const DebugLoc & debug_location = I->getDebugLoc ();
12 std::string position_string;
14 llvm::raw_string_ostream position_stream (position_string);
15 debug_location . print (position_stream);
18 return IRB . CreateGlobalStringPtr (position_string);
21 Value *getPositionPrint( Instruction * I, IRBuilder <> IRB)
23 const DebugLoc & debug_location = I->getDebugLoc ();
24 std::string position_string;
26 llvm::raw_string_ostream position_stream (position_string);
27 debug_location . print (position_stream);
29 errs() << position_string << "\n";
30 return IRB . CreateGlobalStringPtr (position_string);