]> git.lizzy.rs Git - rust.git/commitdiff
rollup merge of #19317: sfackler/xcrate-namespace
authorAlex Crichton <alex@alexcrichton.com>
Wed, 26 Nov 2014 17:46:59 +0000 (09:46 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 27 Nov 2014 00:50:12 +0000 (16:50 -0800)
The chunk of code in encoder.rs was at one point deleted, but must have come back in a rebase or something :(

Closes #19293

1  2 
src/librustc/metadata/encoder.rs
src/librustc_llvm/lib.rs

index 8c21e559ec1f80a1418bdc5d15a15c6e2ce0fccb,7f4e811f514a1a1406d695ad3ca9ce01893f2aed..d65fb9d2778becd2678bfb59126649cad032a9a0
@@@ -500,20 -500,10 +500,10 @@@ fn encode_reexported_static_methods(ecx
  /// Iterates through "auxiliary node IDs", which are node IDs that describe
  /// top-level items that are sub-items of the given item. Specifically:
  ///
- /// * For enums, iterates through the node IDs of the variants.
- ///
  /// * For newtype structs, iterates through the node ID of the constructor.
  fn each_auxiliary_node_id(item: &ast::Item, callback: |NodeId| -> bool) -> bool {
      let mut continue_ = true;
      match item.node {
-         ast::ItemEnum(ref enum_def, _) => {
-             for variant in enum_def.variants.iter() {
-                 continue_ = callback(variant.node.id);
-                 if !continue_ {
-                     break
-                 }
-             }
-         }
          ast::ItemStruct(ref struct_def, _) => {
              // If this is a newtype struct, return the constructor.
              match struct_def.ctor_id {
@@@ -1230,9 -1220,10 +1220,9 @@@ fn encode_info_for_item(ecx: &EncodeCon
          encode_name(rbml_w, item.ident.name);
          encode_attributes(rbml_w, item.attrs.as_slice());
          match ty.node {
 -            ast::TyPath(ref path, ref bounds, _) if path.segments
 +            ast::TyPath(ref path, _) if path.segments
                                                          .len() == 1 => {
                  let ident = path.segments.last().unwrap().identifier;
 -                assert!(bounds.is_none());
                  encode_impl_type_basename(rbml_w, ident);
              }
              _ => {}
diff --combined src/librustc_llvm/lib.rs
index 23726664e3c6beb0473b6de9639967196afc332a,8d14912a6d4da2213c01b58280c66b313002493b..8752a14d610557b59886d52f8c2499020cce1ddf
@@@ -45,6 -45,7 +45,7 @@@ pub use self::DiagnosticKind::*
  pub use self::CallConv::*;
  pub use self::Visibility::*;
  pub use self::DiagnosticSeverity::*;
+ pub use self::Linkage::*;
  
  use std::c_str::ToCStr;
  use std::cell::RefCell;
@@@ -520,24 -521,24 +521,24 @@@ extern 
      pub fn LLVMGetModuleContext(M: ModuleRef) -> ContextRef;
      pub fn LLVMDisposeModule(M: ModuleRef);
  
 -    /** Data layout. See Module::getDataLayout. */
 +    /// Data layout. See Module::getDataLayout.
      pub fn LLVMGetDataLayout(M: ModuleRef) -> *const c_char;
      pub fn LLVMSetDataLayout(M: ModuleRef, Triple: *const c_char);
  
 -    /** Target triple. See Module::getTargetTriple. */
 +    /// Target triple. See Module::getTargetTriple.
      pub fn LLVMGetTarget(M: ModuleRef) -> *const c_char;
      pub fn LLVMSetTarget(M: ModuleRef, Triple: *const c_char);
  
 -    /** See Module::dump. */
 +    /// See Module::dump.
      pub fn LLVMDumpModule(M: ModuleRef);
  
 -    /** See Module::setModuleInlineAsm. */
 +    /// See Module::setModuleInlineAsm.
      pub fn LLVMSetModuleInlineAsm(M: ModuleRef, Asm: *const c_char);
  
 -    /** See llvm::LLVMTypeKind::getTypeID. */
 +    /// See llvm::LLVMTypeKind::getTypeID.
      pub fn LLVMGetTypeKind(Ty: TypeRef) -> TypeKind;
  
 -    /** See llvm::LLVMType::getContext. */
 +    /// See llvm::LLVMType::getContext.
      pub fn LLVMGetTypeContext(Ty: TypeRef) -> ContextRef;
  
      /* Operations on integer types */
      pub fn LLVMIsATerminatorInst(Inst: ValueRef) -> ValueRef;
      pub fn LLVMIsAStoreInst(Inst: ValueRef) -> ValueRef;
  
 -    /** Writes a module to the specified path. Returns 0 on success. */
 +    /// Writes a module to the specified path. Returns 0 on success.
      pub fn LLVMWriteBitcodeToFile(M: ModuleRef, Path: *const c_char) -> c_int;
  
 -    /** Creates target data from a target layout string. */
 +    /// Creates target data from a target layout string.
      pub fn LLVMCreateTargetData(StringRep: *const c_char) -> TargetDataRef;
      /// Adds the target data to the given pass manager. The pass manager
      /// references the target data only weakly.
      pub fn LLVMAddTargetData(TD: TargetDataRef, PM: PassManagerRef);
 -    /** Number of bytes clobbered when doing a Store to *T. */
 +    /// Number of bytes clobbered when doing a Store to *T.
      pub fn LLVMStoreSizeOfType(TD: TargetDataRef, Ty: TypeRef)
                                 -> c_ulonglong;
  
 -    /** Number of bytes clobbered when doing a Store to *T. */
 +    /// Number of bytes clobbered when doing a Store to *T.
      pub fn LLVMSizeOfTypeInBits(TD: TargetDataRef, Ty: TypeRef)
                                  -> c_ulonglong;
  
 -    /** Distance between successive elements in an array of T.
 -    Includes ABI padding. */
 +    /// Distance between successive elements in an array of T. Includes ABI padding.
      pub fn LLVMABISizeOfType(TD: TargetDataRef, Ty: TypeRef) -> c_ulonglong;
  
 -    /** Returns the preferred alignment of a type. */
 +    /// Returns the preferred alignment of a type.
      pub fn LLVMPreferredAlignmentOfType(TD: TargetDataRef, Ty: TypeRef)
                                          -> c_uint;
 -    /** Returns the minimum alignment of a type. */
 +    /// Returns the minimum alignment of a type.
      pub fn LLVMABIAlignmentOfType(TD: TargetDataRef, Ty: TypeRef)
                                    -> c_uint;
  
                                 Element: c_uint)
                                 -> c_ulonglong;
  
 -    /**
 -     * Returns the minimum alignment of a type when part of a call frame.
 -     */
 +    /// Returns the minimum alignment of a type when part of a call frame.
      pub fn LLVMCallFrameAlignmentOfType(TD: TargetDataRef, Ty: TypeRef)
                                          -> c_uint;
  
 -    /** Disposes target data. */
 +    /// Disposes target data.
      pub fn LLVMDisposeTargetData(TD: TargetDataRef);
  
 -    /** Creates a pass manager. */
 +    /// Creates a pass manager.
      pub fn LLVMCreatePassManager() -> PassManagerRef;
  
 -    /** Creates a function-by-function pass manager */
 +    /// Creates a function-by-function pass manager
      pub fn LLVMCreateFunctionPassManagerForModule(M: ModuleRef)
                                                    -> PassManagerRef;
  
 -    /** Disposes a pass manager. */
 +    /// Disposes a pass manager.
      pub fn LLVMDisposePassManager(PM: PassManagerRef);
  
 -    /** Runs a pass manager on a module. */
 +    /// Runs a pass manager on a module.
      pub fn LLVMRunPassManager(PM: PassManagerRef, M: ModuleRef) -> Bool;
  
 -    /** Runs the function passes on the provided function. */
 +    /// Runs the function passes on the provided function.
      pub fn LLVMRunFunctionPassManager(FPM: PassManagerRef, F: ValueRef)
                                        -> Bool;
  
 -    /** Initializes all the function passes scheduled in the manager */
 +    /// Initializes all the function passes scheduled in the manager
      pub fn LLVMInitializeFunctionPassManager(FPM: PassManagerRef) -> Bool;
  
 -    /** Finalizes all the function passes scheduled in the manager */
 +    /// Finalizes all the function passes scheduled in the manager
      pub fn LLVMFinalizeFunctionPassManager(FPM: PassManagerRef) -> Bool;
  
      pub fn LLVMInitializePasses();
  
 -    /** Adds a verification pass. */
 +    /// Adds a verification pass.
      pub fn LLVMAddVerifierPass(PM: PassManagerRef);
  
      pub fn LLVMAddGlobalOptimizerPass(PM: PassManagerRef);
          Internalize: Bool,
          RunInliner: Bool);
  
 -    /** Destroys a memory buffer. */
 +    /// Destroys a memory buffer.
      pub fn LLVMDisposeMemoryBuffer(MemBuf: MemoryBufferRef);
  
  
      /* Stuff that's in rustllvm/ because it's not upstream yet. */
  
 -    /** Opens an object file. */
 +    /// Opens an object file.
      pub fn LLVMCreateObjectFile(MemBuf: MemoryBufferRef) -> ObjectFileRef;
 -    /** Closes an object file. */
 +    /// Closes an object file.
      pub fn LLVMDisposeObjectFile(ObjFile: ObjectFileRef);
  
 -    /** Enumerates the sections in an object file. */
 +    /// Enumerates the sections in an object file.
      pub fn LLVMGetSections(ObjFile: ObjectFileRef) -> SectionIteratorRef;
 -    /** Destroys a section iterator. */
 +    /// Destroys a section iterator.
      pub fn LLVMDisposeSectionIterator(SI: SectionIteratorRef);
 -    /** Returns true if the section iterator is at the end of the section
 -    list: */
 +    /// Returns true if the section iterator is at the end of the section
 +    /// list:
      pub fn LLVMIsSectionIteratorAtEnd(ObjFile: ObjectFileRef,
                                        SI: SectionIteratorRef)
                                        -> Bool;
 -    /** Moves the section iterator to point to the next section. */
 +    /// Moves the section iterator to point to the next section.
      pub fn LLVMMoveToNextSection(SI: SectionIteratorRef);
 -    /** Returns the current section size. */
 +    /// Returns the current section size.
      pub fn LLVMGetSectionSize(SI: SectionIteratorRef) -> c_ulonglong;
 -    /** Returns the current section contents as a string buffer. */
 +    /// Returns the current section contents as a string buffer.
      pub fn LLVMGetSectionContents(SI: SectionIteratorRef) -> *const c_char;
  
 -    /** Reads the given file and returns it as a memory buffer. Use
 -    LLVMDisposeMemoryBuffer() to get rid of it. */
 +    /// Reads the given file and returns it as a memory buffer. Use
 +    /// LLVMDisposeMemoryBuffer() to get rid of it.
      pub fn LLVMRustCreateMemoryBufferWithContentsOfFile(Path: *const c_char)
                                                          -> MemoryBufferRef;
 -    /** Borrows the contents of the memory buffer (doesn't copy it) */
 +    /// Borrows the contents of the memory buffer (doesn't copy it)
      pub fn LLVMCreateMemoryBufferWithMemoryRange(InputData: *const c_char,
                                                   InputDataLength: size_t,
                                                   BufferName: *const c_char,
      pub fn LLVMIsMultithreaded() -> Bool;
      pub fn LLVMStartMultithreaded() -> Bool;
  
 -    /** Returns a string describing the last error caused by an LLVMRust*
 -    call. */
 +    /// Returns a string describing the last error caused by an LLVMRust* call.
      pub fn LLVMRustGetLastError() -> *const c_char;
  
      /// Print the pass timings since static dtors aren't picking them up.
                                  Count: c_uint)
                                  -> ValueRef;
  
 -    /** Enables LLVM debug output. */
 +    /// Enables LLVM debug output.
      pub fn LLVMSetDebug(Enabled: c_int);
  
 -    /** Prepares inline assembly. */
 +    /// Prepares inline assembly.
      pub fn LLVMInlineAsm(Ty: TypeRef,
                           AsmString: *const c_char,
                           Constraints: *const c_char,