X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=getPosition.hpp;h=afc00c66734684974d1dc8d40b1a022788e0fc07;hb=c9efd55388808675480a2f3f476959dd7e5de4be;hp=f26d1721c62787f0784cc828eb5c74e564b08b4c;hpb=6d0c694ec816c3422efa4d5f973eda3ae4ad6933;p=c11llvm.git diff --git a/getPosition.hpp b/getPosition.hpp index f26d172..afc00c6 100644 --- a/getPosition.hpp +++ b/getPosition.hpp @@ -17,3 +17,15 @@ Value *getPosition( Instruction * I, IRBuilder <> IRB) return IRB . CreateGlobalStringPtr (position_string); } + +Value *getPositionPrint( Instruction * I, IRBuilder <> IRB) +{ + const DebugLoc & debug_location = I->getDebugLoc (); + std::string position_string; + { + llvm::raw_string_ostream position_stream (position_string); + debug_location . print (position_stream); + } + errs() << position_string << "\n"; + return IRB . CreateGlobalStringPtr (position_string); +} \ No newline at end of file