add support for libcds atomic function calls
[c11llvm.git] / getPosition.hpp
index f26d1721c62787f0784cc828eb5c74e564b08b4c..afc00c66734684974d1dc8d40b1a022788e0fc07 100644 (file)
@@ -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