X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=getPosition.hpp;h=afc00c66734684974d1dc8d40b1a022788e0fc07;hb=84b9cc1cf068b080db61e377d8cef369f09a4b51;hp=f26d1721c62787f0784cc828eb5c74e564b08b4c;hpb=c7be9ffa4a8c95788e862c08572e38dbcaad2abc;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