1128bf458Scgyurgyik //===-- Implementation of toupper------------------------------------------===// 2128bf458Scgyurgyik // 3128bf458Scgyurgyik // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4128bf458Scgyurgyik // See https://llvm.org/LICENSE.txt for license information. 5128bf458Scgyurgyik // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6128bf458Scgyurgyik // 7128bf458Scgyurgyik //===----------------------------------------------------------------------===// 8128bf458Scgyurgyik 9128bf458Scgyurgyik #include "src/ctype/toupper.h" 10c120edc7SMichael Jones #include "src/__support/ctype_utils.h" 11128bf458Scgyurgyik 12128bf458Scgyurgyik #include "src/__support/common.h" 13128bf458Scgyurgyik 14128bf458Scgyurgyik namespace __llvm_libc { 15128bf458Scgyurgyik 16128bf458Scgyurgyik // TODO: Currently restricted to default locale. 17128bf458Scgyurgyik // These should be extended using locale information. 18a0b65a7bSMichael Jones LLVM_LIBC_FUNCTION(int, toupper, (int c)) { 19128bf458Scgyurgyik if (internal::islower(c)) 20*9cdd4ea0SAlfonso Gregory return c - ('a' - 'A'); 21128bf458Scgyurgyik return c; 22128bf458Scgyurgyik } 23128bf458Scgyurgyik 24128bf458Scgyurgyik } // namespace __llvm_libc 25