summaryrefslogtreecommitdiff
path: root/utils/KillTheDoctor
diff options
context:
space:
mode:
authorAhmed Charles <ace2001ac@gmail.com>2012-02-19 11:37:01 +0000
committerAhmed Charles <ace2001ac@gmail.com>2012-02-19 11:37:01 +0000
commitb0934ab7d811e23bf530371976b8b35f3242169c (patch)
tree11a0f1c5a9a90a6084360819fbc67b6933a11bc0 /utils/KillTheDoctor
parentd7ace3f8d1b7216d7381c408b26259e1201f7c29 (diff)
downloadllvm-b0934ab7d811e23bf530371976b8b35f3242169c.tar.gz
llvm-b0934ab7d811e23bf530371976b8b35f3242169c.tar.bz2
llvm-b0934ab7d811e23bf530371976b8b35f3242169c.tar.xz
Remove dead code. Improve llvm_unreachable text. Simplify some control flow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150918 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/KillTheDoctor')
-rw-r--r--utils/KillTheDoctor/KillTheDoctor.cpp46
1 files changed, 0 insertions, 46 deletions
diff --git a/utils/KillTheDoctor/KillTheDoctor.cpp b/utils/KillTheDoctor/KillTheDoctor.cpp
index 1ddae0bc8b..70713b25bf 100644
--- a/utils/KillTheDoctor/KillTheDoctor.cpp
+++ b/utils/KillTheDoctor/KillTheDoctor.cpp
@@ -211,19 +211,6 @@ static error_code GetFileNameFromHandle(HANDLE FileHandle,
}
}
-static std::string QuoteProgramPathIfNeeded(StringRef Command) {
- if (Command.find_first_of(' ') == StringRef::npos)
- return Command;
- else {
- std::string ret;
- ret.reserve(Command.size() + 3);
- ret.push_back('"');
- ret.append(Command.begin(), Command.end());
- ret.push_back('"');
- return ret;
- }
-}
-
/// @brief Find program using shell lookup rules.
/// @param Program This is either an absolute path, relative path, or simple a
/// program name. Look in PATH for any programs that match. If no
@@ -269,39 +256,6 @@ static std::string FindProgram(const std::string &Program, error_code &ec) {
return PathName;
}
-static error_code EnableDebugPrivileges() {
- HANDLE TokenHandle;
- BOOL success = ::OpenProcessToken(::GetCurrentProcess(),
- TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
- &TokenHandle);
- if (!success)
- return windows_error(::GetLastError());
-
- TokenScopedHandle Token(TokenHandle);
- TOKEN_PRIVILEGES TokenPrivileges;
- LUID LocallyUniqueID;
-
- success = ::LookupPrivilegeValueA(NULL,
- SE_DEBUG_NAME,
- &LocallyUniqueID);
- if (!success)
- return windows_error(::GetLastError());
-
- TokenPrivileges.PrivilegeCount = 1;
- TokenPrivileges.Privileges[0].Luid = LocallyUniqueID;
- TokenPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
-
- success = ::AdjustTokenPrivileges(Token,
- FALSE,
- &TokenPrivileges,
- sizeof(TOKEN_PRIVILEGES),
- NULL,
- NULL);
- // The value of success is basically useless. Either way we are just returning
- // the value of ::GetLastError().
- return windows_error(::GetLastError());
-}
-
static StringRef ExceptionCodeToString(DWORD ExceptionCode) {
switch(ExceptionCode) {
case EXCEPTION_ACCESS_VIOLATION: return "EXCEPTION_ACCESS_VIOLATION";