Skip to content

Commit 5712db9

Browse files
committed
Copy Bitwriter to generate PNaClBitwriter.
Copy classes for LLVM BitcodeWriter into a PNaCL subdirectory, to create a PNaCL version. Renames classes/methods to include PNaCl prefix so that they don't conflict with the LLVM BitcodeWriter. Also removed experimental support for use-list order preservation. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3405 Review URL: https://codereview.chromium.org/14126011
1 parent ac21bcb commit 5712db9

21 files changed

+3435
-4
lines changed

include/llvm/Bitcode/NaCl/NaClBitstreamWriter.h

Lines changed: 548 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//===-- llvm/Bitcode/NaCl/NaClReaderWriter.h - ------------------*- C++ -*-===//
2+
// NaCl Bitcode reader/writer.
3+
//
4+
// The LLVM Compiler Infrastructure
5+
//
6+
// This file is distributed under the University of Illinois Open Source
7+
// License. See LICENSE.TXT for details.
8+
//
9+
//===----------------------------------------------------------------------===//
10+
//
11+
// This header defines interfaces to read and write LLVM bitcode files/streams.
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
#ifndef LLVM_BITCODE_NACL_NACLREADERWRITER_H
16+
#define LLVM_BITCODE_NACL_NACLREADERWRITER_H
17+
18+
namespace llvm {
19+
class Module;
20+
class raw_ostream;
21+
22+
/// NaClWriteBitcodeToFile - Write the specified module to the
23+
/// specified raw output stream, using PNaCl wire format. For
24+
/// streams where it matters, the given stream should be in "binary"
25+
/// mode.
26+
void NaClWriteBitcodeToFile(const Module *M, raw_ostream &Out);
27+
28+
} // end llvm namespace
29+
#endif

lib/Bitcode/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
add_subdirectory(Reader)
22
add_subdirectory(Writer)
3+
add_subdirectory(NaCl)

lib/Bitcode/LLVMBuild.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
;===------------------------------------------------------------------------===;
1717

1818
[common]
19-
subdirectories = Reader Writer
19+
subdirectories = Reader Writer NaCl
2020

2121
[component_0]
2222
type = Group

lib/Bitcode/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
##===----------------------------------------------------------------------===##
99

1010
LEVEL = ../..
11-
PARALLEL_DIRS = Reader Writer
11+
PARALLEL_DIRS = Reader Writer NaCl
1212

1313
include $(LEVEL)/Makefile.common
1414

lib/Bitcode/NaCl/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add_subdirectory(Writer)

lib/Bitcode/NaCl/LLVMBuild.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
;===- ./lib/Bitcode/NaCl/LLVMBuild.txt ------------------------*- Conf -*--===;
2+
;
3+
; The LLVM Compiler Infrastructure
4+
;
5+
; This file is distributed under the University of Illinois Open Source
6+
; License. See LICENSE.TXT for details.
7+
;
8+
;===------------------------------------------------------------------------===;
9+
;
10+
; This is an LLVMBuild description file for the components in this subdirectory.
11+
;
12+
; For more information on the LLVMBuild system, please see:
13+
;
14+
; http://llvm.org/docs/LLVMBuild.html
15+
;
16+
;===------------------------------------------------------------------------===;
17+
18+
[common]
19+
subdirectories = Writer
20+
21+
[component_0]
22+
type = Group
23+
name = NaClBitcode
24+
parent = Bitcode

lib/Bitcode/NaCl/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
##===- lib/Bitcode/NaCl/Makefile ---------------------------*- Makefile -*-===##
2+
#
3+
# The LLVM Compiler Infrastructure
4+
#
5+
# This file is distributed under the University of Illinois Open Source
6+
# License. See LICENSE.TXT for details.
7+
#
8+
##===----------------------------------------------------------------------===##
9+
10+
LEVEL = ../../..
11+
PARALLEL_DIRS = Writer
12+
13+
include $(LEVEL)/Makefile.common
14+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
add_llvm_library(NaClBitWriter
2+
NaClBitcodeWriter.cpp
3+
NaClValueEnumerator.cpp
4+
)
5+
add_dependencies(NaClBitWriter intinsics_gen)

lib/Bitcode/NaCl/Writer/LLVMBuild.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
;===- ./lib/Bitcode/NaCl/Writer/LLVMBuild.txt -----------------*- Conf -*--===;
2+
;
3+
; The LLVM Compiler Infrastructure
4+
;
5+
; This file is distributed under the University of Illinois Open Source
6+
; License. See LICENSE.TXT for details.
7+
;
8+
;===------------------------------------------------------------------------===;
9+
;
10+
; This is an LLVMBuild description file for the components in this subdirectory.
11+
;
12+
; For more information on the LLVMBuild system, please see:
13+
;
14+
; http://llvm.org/docs/LLVMBuild.html
15+
;
16+
;===------------------------------------------------------------------------===;
17+
18+
[component_0]
19+
type = Library
20+
name = NaClBitWriter
21+
parent = NaClBitcode
22+
required_libraries = Core Support

0 commit comments

Comments
 (0)