Reflow paragraphs in comments.
This is intended as a clean up after the big clang-format commit
(r280751), which unfortunately resulted in many of the comment
paragraphs in LLDB being very hard to read.
FYI, the script I used was:
import textwrap
import commands
import os
import sys
import re
tmp = "%s.tmp"%sys.argv[1]
out = open(tmp, "w+")
with open(sys.argv[1], "r") as f:
header = ""
text = ""
comment = re.compile(r'^( *//) ([^ ].*)$')
special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$')
for line in f:
match = comment.match(line)
if match and not special.match(match.group(2)):
# skip intentionally short comments.
if not text and len(match.group(2)) < 40:
out.write(line)
continue
if text:
text += " " + match.group(2)
else:
header = match.group(1)
text = match.group(2)
continue
if text:
filled = textwrap.wrap(text, width=(78-len(header)),
break_long_words=False)
for l in filled:
out.write(header+" "+l+'\n')
text = ""
out.write(line)
os.rename(tmp, sys.argv[1])
Differential Revision: https://reviews.llvm.org/D46144
llvm-svn: 331197
This commit is contained in:
@@ -38,14 +38,12 @@ using namespace lldb_renderscript;
|
||||
|
||||
// [``slang``](https://android.googlesource.com/platform/frameworks/compile/slang),
|
||||
// the compiler frontend for RenderScript embeds an ARM specific triple in IR
|
||||
// that is shipped in the app, after
|
||||
// generating IR that has some assumptions that an ARM device is the target.
|
||||
// As the IR is then compiled on a device of unknown (at time the IR was
|
||||
// generated at least) architecture,
|
||||
// when calling RenderScript API function as part of debugger expressions, we
|
||||
// have to perform a fixup pass that
|
||||
// removes those assumptions right before the module is sent to be generated by
|
||||
// the llvm backend.
|
||||
// that is shipped in the app, after generating IR that has some assumptions
|
||||
// that an ARM device is the target. As the IR is then compiled on a device of
|
||||
// unknown (at time the IR was generated at least) architecture, when calling
|
||||
// RenderScript API function as part of debugger expressions, we have to
|
||||
// perform a fixup pass that removes those assumptions right before the module
|
||||
// is sent to be generated by the llvm backend.
|
||||
|
||||
namespace {
|
||||
bool registerRSDefaultTargetOpts(clang::TargetOptions &proto,
|
||||
@@ -107,10 +105,9 @@ bool RenderScriptRuntimeModulePass::runOnModule(llvm::Module &module) {
|
||||
case llvm::Triple::ArchType::x86:
|
||||
changed_module |= fixupX86FunctionCalls(module);
|
||||
// For some reason this triple gets totally missed by the backend, and must
|
||||
// be set manually.
|
||||
// There a reference in bcc/Main.cpp about auto feature-detection being
|
||||
// removed from LLVM3.5, but I can't
|
||||
// see that discussion anywhere public.
|
||||
// be set manually. There a reference in bcc/Main.cpp about auto feature-
|
||||
// detection being removed from LLVM3.5, but I can't see that discussion
|
||||
// anywhere public.
|
||||
real_triple = "i686--linux-android";
|
||||
break;
|
||||
case llvm::Triple::ArchType::x86_64:
|
||||
@@ -118,12 +115,12 @@ bool RenderScriptRuntimeModulePass::runOnModule(llvm::Module &module) {
|
||||
break;
|
||||
case llvm::Triple::ArchType::mipsel:
|
||||
case llvm::Triple::ArchType::mips64el:
|
||||
// No actual IR fixup pass is needed on MIPS, but the datalayout
|
||||
// and targetmachine do need to be explicitly set.
|
||||
// No actual IR fixup pass is needed on MIPS, but the datalayout and
|
||||
// targetmachine do need to be explicitly set.
|
||||
|
||||
// bcc explicitly compiles MIPS code to use the static relocation
|
||||
// model due to an issue with relocations in mclinker.
|
||||
// see libbcc/support/CompilerConfig.cpp for details
|
||||
// bcc explicitly compiles MIPS code to use the static relocation model due
|
||||
// to an issue with relocations in mclinker. see
|
||||
// libbcc/support/CompilerConfig.cpp for details
|
||||
reloc_model = llvm::Reloc::Static;
|
||||
changed_module = true;
|
||||
break;
|
||||
@@ -146,8 +143,7 @@ bool RenderScriptRuntimeModulePass::runOnModule(llvm::Module &module) {
|
||||
assert(target_machine &&
|
||||
"failed to identify RenderScriptRuntime target machine");
|
||||
// We've been using a triple and datalayout of some ARM variant all along,
|
||||
// so
|
||||
// we need to let the backend know that this is no longer the case.
|
||||
// so we need to let the backend know that this is no longer the case.
|
||||
if (log) {
|
||||
log->Printf("%s - Changing RS target triple to '%s'", __FUNCTION__,
|
||||
real_triple.str().c_str());
|
||||
|
||||
Reference in New Issue
Block a user