11cb0ef41Sopenharmony_ci// Copyright 2020 the V8 project authors. All rights reserved. 21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be 31cb0ef41Sopenharmony_ci// found in the LICENSE file. 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ci#include "include/cppgc/source-location.h" 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_cinamespace cppgc { 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_cistd::string SourceLocation::ToString() const { 101cb0ef41Sopenharmony_ci if (!file_) { 111cb0ef41Sopenharmony_ci return {}; 121cb0ef41Sopenharmony_ci } 131cb0ef41Sopenharmony_ci return std::string(function_) + "@" + file_ + ":" + std::to_string(line_); 141cb0ef41Sopenharmony_ci} 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ci} // namespace cppgc 17