Skip to content

Commit

Permalink
Remove LLVM
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul committed Dec 22, 2024
1 parent 469bb32 commit f281429
Show file tree
Hide file tree
Showing 354 changed files with 8,497 additions and 28,212 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/upstream-utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ jobs:
./libuv.py clone
./libuv.py copy-src
./libuv.py format-patch
- name: Run llvm.py
run: |
cd upstream_utils
./llvm.py clone
./llvm.py copy-src
./llvm.py format-patch
- name: Run mpack.py
run: |
cd upstream_utils
Expand Down
47 changes: 0 additions & 47 deletions ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ licenses, and/or restrictions:
Program Locations
------- ---------
Google Test gtest
LLVM wpiutil/src/main/native/thirdparty/llvm
wpiutil/src/test/native/cpp/llvm/
JSON for Modern C++ wpiutil/src/main/native/thirdparty/json
wpiutil/src/test/native/cpp/json/
libuv wpinet/src/main/native/thirdparty/libuv/
Expand Down Expand Up @@ -313,51 +311,6 @@ mechanisms:
2) It will contain specific license and restriction terms at the top of every
file.

==============================================================================
Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy):
==============================================================================
University of Illinois/NCSA
Open Source License

Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign.
All rights reserved.

Developed by:

LLVM Team

University of Illinois at Urbana-Champaign

http://llvm.org

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal with
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.

* Neither the names of the LLVM Team, University of Illinois at
Urbana-Champaign, nor the names of its contributors may be used to
endorse or promote products derived from this Software without specific
prior written permission.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.


==============================================================================
JSON for Modern C++ License
==============================================================================
Expand Down
9 changes: 4 additions & 5 deletions apriltag/src/main/native/cpp/AprilTagFieldLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "frc/apriltag/AprilTagFieldLayout.h"

#include <fstream>
#include <string>
#include <system_error>
#include <utility>
#include <vector>
Expand All @@ -12,7 +14,6 @@
#include <units/length.h>
#include <wpi/MemoryBuffer.h>
#include <wpi/json.h>
#include <wpi/raw_ostream.h>

using namespace frc;

Expand Down Expand Up @@ -89,10 +90,8 @@ std::optional<frc::Pose3d> AprilTagFieldLayout::GetTagPose(int ID) const {
}

void AprilTagFieldLayout::Serialize(std::string_view path) {
std::error_code error_code;

wpi::raw_fd_ostream output{path, error_code};
if (error_code) {
std::ofstream output{std::string{path}};
if (!output.is_open()) {
throw std::runtime_error(fmt::format("Cannot open file: {}", path));
}

Expand Down
2 changes: 0 additions & 2 deletions cameraserver/multiCameraServer/src/main/native/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
#include <networktables/NetworkTableInstance.h>
#include <wpi/MemoryBuffer.h>
#include <wpi/StringExtras.h>
#include <wpi/fmt/raw_ostream.h>
#include <wpi/json.h>
#include <wpi/print.h>
#include <wpi/raw_ostream.h>

#include "cameraserver/CameraServer.h"

Expand Down
10 changes: 5 additions & 5 deletions cameraserver/src/main/native/cpp/cameraserver/CameraServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
#include <networktables/NetworkTableInstance.h>
#include <networktables/StringArrayTopic.h>
#include <networktables/StringTopic.h>
#include <wpi/DenseMap.h>
#include <wpi/SmallString.h>
#include <wpi/StringExtras.h>
#include <wpi/StringMap.h>
#include <wpi/flat_map.h>
#include <wpi/mutex.h>

#include "cameraserver/CameraServerShared.h"
Expand Down Expand Up @@ -61,7 +61,7 @@ struct SourcePublisher {
nt::StringArrayPublisher streamsPublisher;
nt::StringEntry modeEntry;
nt::StringArrayPublisher modesPublisher;
wpi::DenseMap<CS_Property, PropertyPublisher> properties;
wpi::flat_map<CS_Property, PropertyPublisher> properties;
};

struct Instance {
Expand All @@ -76,8 +76,8 @@ struct Instance {
std::string m_primarySourceName;
wpi::StringMap<cs::VideoSource> m_sources;
wpi::StringMap<cs::VideoSink> m_sinks;
wpi::DenseMap<CS_Sink, CS_Source> m_fixedSources;
wpi::DenseMap<CS_Source, SourcePublisher> m_publishers;
wpi::flat_map<CS_Sink, CS_Source> m_fixedSources;
wpi::flat_map<CS_Source, SourcePublisher> m_publishers;
std::shared_ptr<nt::NetworkTable> m_publishTable{
nt::NetworkTableInstance::GetDefault().GetTable(kPublishName)};
cs::VideoListener m_videoListener;
Expand All @@ -94,7 +94,7 @@ static Instance& GetInstance() {
}

static std::string_view MakeSourceValue(CS_Source source,
wpi::SmallVectorImpl<char>& buf) {
wpi::SmallVector<char>& buf) {
CS_Status status = 0;
buf.clear();
switch (cs::GetSourceKind(source, &status)) {
Expand Down
39 changes: 0 additions & 39 deletions cmake/modules/AddDoxygenDocs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,6 @@ macro(add_doxygen_docs)
DOXYGEN_EXCLUDE_PATTERNS
# apriltag
"apriltag_pose.h"
# llvm
"wpi/AlignOf.h"
"wpi/Casting.h"
"wpi/Chrono.h"
"wpi/Compiler.h"
"wpi/ConvertUTF.h"
"wpi/DenseMap.h"
"wpi/DenseMapInfo.h"
"wpi/Endian.h"
"wpi/EpochTracker.h"
"wpi/Errc.h"
"wpi/Errno.h"
"wpi/ErrorHandling.h"
"wpi/bit.h"
"wpi/fs.h"
"wpi/FunctionExtras.h"
"wpi/function_ref.h"
"wpi/Hashing.h"
"wpi/iterator.h"
"wpi/iterator_range.h"
"wpi/ManagedStatic.h"
"wpi/MapVector.h"
"wpi/MathExtras.h"
"wpi/MemAlloc.h"
"wpi/PointerIntPair.h"
"wpi/PointerLikeTypeTraits.h"
"wpi/PointerUnion.h"
"wpi/raw_os_ostream.h"
"wpi/raw_ostream.h"
"wpi/SmallPtrSet.h"
"wpi/SmallSet.h"
"wpi/SmallString.h"
"wpi/SmallVector.h"
"wpi/StringExtras.h"
"wpi/StringMap.h"
"wpi/SwapByteOrder.h"
"wpi/type_traits.h"
"wpi/VersionTuple.h"
"wpi/WindowsError.h"
# libuv
"uv.h"
"uv/**"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static void LoggerFunc(unsigned int level, const char* file, unsigned int line,
wpi::print(stderr, "DS: {}: {} ({}:{})\n", levelmsg, msg, file, line);
}

static void generateEnabledDsPacket(wpi::SmallVectorImpl<uint8_t>& data,
static void generateEnabledDsPacket(wpi::SmallVector<uint8_t>& data,
uint16_t sendCount) {
data.clear();
data.push_back(sendCount >> 8);
Expand Down
2 changes: 1 addition & 1 deletion cscore/src/main/native/cpp/HttpCameraImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void HttpCameraImpl::StreamThreadMain() {
}

wpi::HttpConnection* HttpCameraImpl::DeviceStreamConnect(
wpi::SmallVectorImpl<char>& boundary) {
wpi::SmallVector<char>& boundary) {
// Build the request
wpi::HttpRequest req;
{
Expand Down
3 changes: 1 addition & 2 deletions cscore/src/main/native/cpp/HttpCameraImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ class HttpCameraImpl : public SourceImpl {
void StreamThreadMain();

// Functions used by StreamThreadMain()
wpi::HttpConnection* DeviceStreamConnect(
wpi::SmallVectorImpl<char>& boundary);
wpi::HttpConnection* DeviceStreamConnect(wpi::SmallVector<char>& boundary);
void DeviceStream(wpi::raw_istream& is, std::string_view boundary);
bool DeviceStreamFrame(wpi::raw_istream& is, std::string& imageBuf);

Expand Down
6 changes: 3 additions & 3 deletions cscore/src/main/native/cpp/Instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ class Instance {
void DestroySink(CS_Sink handle);

std::span<CS_Source> EnumerateSourceHandles(
wpi::SmallVectorImpl<CS_Source>& vec) {
wpi::SmallVector<CS_Source>& vec) {
return m_sources.GetAll(vec);
}

std::span<CS_Sink> EnumerateSinkHandles(wpi::SmallVectorImpl<CS_Sink>& vec) {
std::span<CS_Sink> EnumerateSinkHandles(wpi::SmallVector<CS_Sink>& vec) {
return m_sinks.GetAll(vec);
}

std::span<CS_Sink> EnumerateSourceSinks(CS_Source source,
wpi::SmallVectorImpl<CS_Sink>& vec) {
wpi::SmallVector<CS_Sink>& vec) {
vec.clear();
m_sinks.ForEach([&](CS_Sink sinkHandle, const SinkData& data) {
if (source == data.sourceHandle.load()) {
Expand Down
1 change: 0 additions & 1 deletion cscore/src/main/native/cpp/MjpegServerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include <wpi/SmallString.h>
#include <wpi/StringExtras.h>
#include <wpi/fmt/raw_ostream.h>
#include <wpi/print.h>
#include <wpinet/HttpUtil.h>
#include <wpinet/TCPAcceptor.h>
Expand Down
1 change: 0 additions & 1 deletion cscore/src/main/native/cpp/MjpegServerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <wpi/SafeThread.h>
#include <wpi/SmallVector.h>
#include <wpi/raw_istream.h>
#include <wpi/raw_ostream.h>
#include <wpinet/NetworkAcceptor.h>
#include <wpinet/NetworkStream.h>
#include <wpinet/raw_socket_ostream.h>
Expand Down
9 changes: 5 additions & 4 deletions cscore/src/main/native/cpp/PropertyContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int PropertyContainer::GetPropertyIndex(std::string_view name) const {
}

std::span<int> PropertyContainer::EnumerateProperties(
wpi::SmallVectorImpl<int>& vec, CS_Status* status) const {
wpi::SmallVector<int>& vec, CS_Status* status) const {
if (!m_properties_cached && !CacheProperties(status)) {
return {};
}
Expand All @@ -58,8 +58,9 @@ CS_PropertyKind PropertyContainer::GetPropertyKind(int property) const {
return prop->propKind;
}

std::string_view PropertyContainer::GetPropertyName(
int property, wpi::SmallVectorImpl<char>& buf, CS_Status* status) const {
std::string_view PropertyContainer::GetPropertyName(int property,
wpi::SmallVector<char>& buf,
CS_Status* status) const {
if (!m_properties_cached && !CacheProperties(status)) {
return {};
}
Expand Down Expand Up @@ -168,7 +169,7 @@ int PropertyContainer::GetPropertyDefault(int property,
}

std::string_view PropertyContainer::GetStringProperty(
int property, wpi::SmallVectorImpl<char>& buf, CS_Status* status) const {
int property, wpi::SmallVector<char>& buf, CS_Status* status) const {
if (!m_properties_cached && !CacheProperties(status)) {
return {};
}
Expand Down
11 changes: 4 additions & 7 deletions cscore/src/main/native/cpp/PropertyContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <string_view>
#include <vector>

#include <wpi/SmallVector.h>
#include <wpi/StringMap.h>
#include <wpi/json_fwd.h>
#include <wpi/mutex.h>
Expand All @@ -22,8 +23,6 @@

namespace wpi {
class Logger;
template <typename T>
class SmallVectorImpl;
} // namespace wpi

namespace cs {
Expand All @@ -33,20 +32,18 @@ class PropertyContainer {
virtual ~PropertyContainer() = default;

int GetPropertyIndex(std::string_view name) const;
std::span<int> EnumerateProperties(wpi::SmallVectorImpl<int>& vec,
std::span<int> EnumerateProperties(wpi::SmallVector<int>& vec,
CS_Status* status) const;
CS_PropertyKind GetPropertyKind(int property) const;
std::string_view GetPropertyName(int property,
wpi::SmallVectorImpl<char>& buf,
std::string_view GetPropertyName(int property, wpi::SmallVector<char>& buf,
CS_Status* status) const;
int GetProperty(int property, CS_Status* status) const;
virtual void SetProperty(int property, int value, CS_Status* status);
int GetPropertyMin(int property, CS_Status* status) const;
int GetPropertyMax(int property, CS_Status* status) const;
int GetPropertyStep(int property, CS_Status* status) const;
int GetPropertyDefault(int property, CS_Status* status) const;
std::string_view GetStringProperty(int property,
wpi::SmallVectorImpl<char>& buf,
std::string_view GetStringProperty(int property, wpi::SmallVector<char>& buf,
CS_Status* status) const;
virtual void SetStringProperty(int property, std::string_view value,
CS_Status* status);
Expand Down
7 changes: 3 additions & 4 deletions cscore/src/main/native/cpp/SinkImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ void SinkImpl::SetDescription(std::string_view description) {
m_description = description;
}

std::string_view SinkImpl::GetDescription(
wpi::SmallVectorImpl<char>& buf) const {
std::string_view SinkImpl::GetDescription(wpi::SmallVector<char>& buf) const {
std::scoped_lock lock(m_mutex);
buf.append(m_description.begin(), m_description.end());
return {buf.data(), buf.size()};
Expand Down Expand Up @@ -114,7 +113,7 @@ std::string SinkImpl::GetError() const {
return std::string{m_source->GetCurFrame().GetError()};
}

std::string_view SinkImpl::GetError(wpi::SmallVectorImpl<char>& buf) const {
std::string_view SinkImpl::GetError(wpi::SmallVector<char>& buf) const {
std::scoped_lock lock(m_mutex);
if (!m_source) {
return "no source connected";
Expand Down Expand Up @@ -222,7 +221,7 @@ std::string GetSinkError(CS_Sink sink, CS_Status* status) {
return data->sink->GetError();
}

std::string_view GetSinkError(CS_Sink sink, wpi::SmallVectorImpl<char>& buf,
std::string_view GetSinkError(CS_Sink sink, wpi::SmallVector<char>& buf,
CS_Status* status) {
auto data = Instance::GetInstance().GetSink(sink);
if (!data || (data->kind & SinkMask) == 0) {
Expand Down
4 changes: 2 additions & 2 deletions cscore/src/main/native/cpp/SinkImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SinkImpl : public PropertyContainer {
std::string_view GetName() const { return m_name; }

void SetDescription(std::string_view description);
std::string_view GetDescription(wpi::SmallVectorImpl<char>& buf) const;
std::string_view GetDescription(wpi::SmallVector<char>& buf) const;

void Enable();
void Disable();
Expand All @@ -46,7 +46,7 @@ class SinkImpl : public PropertyContainer {
}

std::string GetError() const;
std::string_view GetError(wpi::SmallVectorImpl<char>& buf) const;
std::string_view GetError(wpi::SmallVector<char>& buf) const;

bool SetConfigJson(std::string_view config, CS_Status* status);
virtual bool SetConfigJson(const wpi::json& config, CS_Status* status);
Expand Down
3 changes: 1 addition & 2 deletions cscore/src/main/native/cpp/SourceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ void SourceImpl::SetDescription(std::string_view description) {
m_description = description;
}

std::string_view SourceImpl::GetDescription(
wpi::SmallVectorImpl<char>& buf) const {
std::string_view SourceImpl::GetDescription(wpi::SmallVector<char>& buf) const {
std::scoped_lock lock(m_mutex);
buf.append(m_description.begin(), m_description.end());
return {buf.data(), buf.size()};
Expand Down
Loading

0 comments on commit f281429

Please sign in to comment.